|
|
@ -37,17 +37,30 @@ namespace SCP.BasicData |
|
|
|
var site = CurrentUser.FactoryList.FirstOrDefault(); |
|
|
|
BindData(); |
|
|
|
BindFactory(); |
|
|
|
TranslatorAgents(Toolbar2); |
|
|
|
TranslatorAgents(gp1); |
|
|
|
TranslatorAgents(FormRow_1); |
|
|
|
TranslatorAgents(FormRow_2); |
|
|
|
TranslatorAgents(FormRow_3); |
|
|
|
TranslatorAgents(FormRow_4); |
|
|
|
TranslatorAgents(FormRow_5); |
|
|
|
TranslatorAgents(FormRow_6); |
|
|
|
TranslatorAgents(FormRow_7); |
|
|
|
TranslatorAgents(gp2); |
|
|
|
TranslatorAgent(factoryList); |
|
|
|
TranslatorAgent(Grid1); |
|
|
|
TranslatorAgent(ToolbarText1); |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
Response.Write("当前用户没有操作该页面权限"); |
|
|
|
Response.Write(GetResourceKey("当前用户没有操作该页面权限")); |
|
|
|
Response.End(); |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
Response.Write("当前用户没有操作该页面权限"); |
|
|
|
Response.Write(GetResourceKey("当前用户没有操作该页面权限")); |
|
|
|
Response.End(); |
|
|
|
return; |
|
|
|
} |
|
|
@ -107,13 +120,13 @@ namespace SCP.BasicData |
|
|
|
{ |
|
|
|
FineUI.LinkButtonField deleteField = Grid1.FindColumn("Grid1_ctl15") as FineUI.LinkButtonField; |
|
|
|
deleteField.Enabled = true; |
|
|
|
deleteField.ToolTip = "删除数据"; |
|
|
|
deleteField.ToolTip = GetResourceKey("删除数据"); |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
FineUI.LinkButtonField deleteField = Grid1.FindColumn("Grid1_ctl15") as FineUI.LinkButtonField; |
|
|
|
deleteField.Enabled = false; |
|
|
|
deleteField.ToolTip = "数据不能删除"; |
|
|
|
deleteField.ToolTip = GetResourceKey("数据不能删除"); |
|
|
|
} |
|
|
|
} |
|
|
|
public void BindData() |
|
|
@ -226,7 +239,7 @@ namespace SCP.BasicData |
|
|
|
} |
|
|
|
protected void LinkButton_Click(object sender, EventArgs e) |
|
|
|
{ |
|
|
|
Alert.Show($"<a href=\'/uploadfiles/{"价格导入模板.xls"}\'>{"价格导入模板.xls"}</a>", "请点击文件名下载", MessageBoxIcon.Information); |
|
|
|
Alert.Show($"<a href=\'/uploadfiles/{"价格导入模板.xls"}\'>{"价格导入模板.xls"}</a>", GetResourceKey("请点击文件名下载"), MessageBoxIcon.Information); |
|
|
|
} |
|
|
|
/// <summary>
|
|
|
|
/// 价格导入
|
|
|
@ -238,7 +251,7 @@ namespace SCP.BasicData |
|
|
|
string _fileName = FileUp.FileName; |
|
|
|
if (string.IsNullOrEmpty(_fileName)) |
|
|
|
{ |
|
|
|
Alert.Show("选择文件为空!"); |
|
|
|
Alert.Show(GetResourceKey("选择文件为空!")); |
|
|
|
return; |
|
|
|
} |
|
|
|
string _lx = _fileName.Split('.')[1]; |
|
|
@ -257,26 +270,26 @@ namespace SCP.BasicData |
|
|
|
List<string> partCodeList = list.Select(a => a.零件编码).ToList(); |
|
|
|
if (partCodeList.Count == 0) |
|
|
|
{ |
|
|
|
Alert.Show("未填写零件编码!"); |
|
|
|
Alert.Show(GetResourceKey("未填写零件编码!")); |
|
|
|
return; |
|
|
|
} |
|
|
|
List<string> list1 = new List<string>(); |
|
|
|
list1 = CheckPartCode(partCodeList); |
|
|
|
if (list1.Count()>0 ) |
|
|
|
{ |
|
|
|
Alert.Show(string.Format( "导入文件中有不存在的零件,如{0}", list1.FirstOrDefault())); |
|
|
|
Alert.Show(GetResourceKey(string.Format( "导入文件中有不存在的零件,如{0}", list1.FirstOrDefault()))); |
|
|
|
return; |
|
|
|
} |
|
|
|
var ret = SCP_PO_CONTROLLER.EXCEL_PRICE_MOD(list, CurrentUser.Name,CurrentUser.RoleList); |
|
|
|
if (ret.State == ReturnStatus.Succeed && ret.Result == true) |
|
|
|
{ |
|
|
|
BindData(); |
|
|
|
Alert.Show("导入成功!"); |
|
|
|
Alert.Show(GetResourceKey("导入成功!")); |
|
|
|
return; |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
Alert.Show(string.Join("<br>", ret.MessageList)); |
|
|
|
Alert.Show(GetResourceKey(string.Join("<br>", ret.MessageList))); |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
@ -314,7 +327,7 @@ namespace SCP.BasicData |
|
|
|
{ |
|
|
|
if (modifyValue["Creator"] == null) |
|
|
|
{ |
|
|
|
Alert.Show("导入者不能为空!"); |
|
|
|
Alert.Show(GetResourceKey("导入者不能为空!")); |
|
|
|
return; |
|
|
|
} |
|
|
|
_entity.Creator = modifyValue["Creator"].ToString(); |
|
|
@ -323,7 +336,7 @@ namespace SCP.BasicData |
|
|
|
{ |
|
|
|
if (modifyValue["EndTime"] == null) |
|
|
|
{ |
|
|
|
Alert.Show("结束时间不能为空!"); |
|
|
|
Alert.Show(GetResourceKey("结束时间不能为空!")); |
|
|
|
return; |
|
|
|
} |
|
|
|
_entity.EndTime = ConvertHelper.To<DateTime>(modifyValue["EndTime"]); |
|
|
@ -334,7 +347,7 @@ namespace SCP.BasicData |
|
|
|
{ |
|
|
|
if (modifyValue["Amt"] == null) |
|
|
|
{ |
|
|
|
Alert.Show("价格不能为空!"); |
|
|
|
Alert.Show(GetResourceKey("价格不能为空!")); |
|
|
|
return; |
|
|
|
} |
|
|
|
_entity.Amt = ConvertHelper.To<decimal>(modifyValue["Amt"]); |
|
|
@ -359,25 +372,25 @@ namespace SCP.BasicData |
|
|
|
{ |
|
|
|
if (string.IsNullOrEmpty(price.Creator)) |
|
|
|
{ |
|
|
|
Alert.Show("导入者不能为空!"); |
|
|
|
Alert.Show(GetResourceKey("导入者不能为空!")); |
|
|
|
return; |
|
|
|
} |
|
|
|
if (price.Creator.Trim().ToUpper() != CurrentUser.Name.Trim().ToUpper()) |
|
|
|
{ |
|
|
|
Alert.Show("价格导入者不是当前登录人请修改!"); |
|
|
|
Alert.Show(GetResourceKey("价格导入者不是当前登录人请修改!")); |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
if(_list.Count==0) |
|
|
|
{ |
|
|
|
Alert.Show("无修改数据!"); |
|
|
|
Alert.Show(GetResourceKey("无修改数据!")); |
|
|
|
return; |
|
|
|
} |
|
|
|
foreach (var ls in _list) |
|
|
|
{ |
|
|
|
if (ls.State ==2) |
|
|
|
{ |
|
|
|
Alert.Show("财务已经审核的价格不能修改!"); |
|
|
|
Alert.Show(GetResourceKey("财务已经审核的价格不能修改!")); |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
@ -386,13 +399,13 @@ namespace SCP.BasicData |
|
|
|
if (ret.State == ReturnStatus.Succeed) |
|
|
|
{ |
|
|
|
// var list = ret.Result;
|
|
|
|
Alert.Show("保存成功!"); |
|
|
|
Alert.Show(GetResourceKey("保存成功!")); |
|
|
|
|
|
|
|
BindData(); |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
Alert.Show(ret.Message); |
|
|
|
Alert.Show(GetResourceKey(ret.Message)); |
|
|
|
} |
|
|
|
} |
|
|
|
/// <summary>
|
|
|
@ -486,7 +499,7 @@ namespace SCP.BasicData |
|
|
|
int[] _selections = Grid1.SelectedRowIndexArray; |
|
|
|
if (_selections.Count()==0) |
|
|
|
{ |
|
|
|
Alert.Show("请选择数据!"); |
|
|
|
Alert.Show(GetResourceKey("请选择数据!")); |
|
|
|
return; |
|
|
|
} |
|
|
|
List<long> _UidList = new List<long>(); |
|
|
@ -522,7 +535,7 @@ namespace SCP.BasicData |
|
|
|
} |
|
|
|
if (_UidList.Count != _selections.Count()) |
|
|
|
{ |
|
|
|
Alert.Show("选择的记录,有已经确认的数据!"); |
|
|
|
Alert.Show(GetResourceKey("选择的记录,有已经确认的数据!")); |
|
|
|
return; |
|
|
|
} |
|
|
|
var res = SCP_DC_UNI_CONTROLLER.UpdateTES_PURCHASE_PRICE(_UidList, CurrentUser.FactoryList[0], CurrentUser.SubSiteList[0], CurrentUser.Name, CurrentUser.ConfigList.ContainsKey("数据中心接口"), ConfirmState); |
|
|
@ -532,17 +545,17 @@ namespace SCP.BasicData |
|
|
|
if (ret.State == ReturnStatus.Succeed) |
|
|
|
{ |
|
|
|
BindData(); |
|
|
|
Alert.Show("确认成功!"); |
|
|
|
Alert.Show(GetResourceKey("确认成功!")); |
|
|
|
return; |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
Alert.Show(ret.Message); |
|
|
|
Alert.Show(GetResourceKey(ret.Message)); |
|
|
|
} |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
Alert.Show(res.Message); |
|
|
|
Alert.Show(GetResourceKey(res.Message)); |
|
|
|
} |
|
|
|
} |
|
|
|
//显示
|
|
|
@ -598,26 +611,26 @@ namespace SCP.BasicData |
|
|
|
var t1 = Grid1.DataKeys[e.RowIndex][12]; |
|
|
|
if (t1==null) |
|
|
|
{ |
|
|
|
Alert.Show("当前价格导入者为空!"); |
|
|
|
Alert.Show(GetResourceKey("当前价格导入者为空!")); |
|
|
|
return; |
|
|
|
} |
|
|
|
if (CurrentUser.Name.Trim().ToUpper() != t1.ToString().ToUpper()) |
|
|
|
{ |
|
|
|
Alert.Show("删除价格导入者不是当前登录人!"); |
|
|
|
Alert.Show(GetResourceKey("删除价格导入者不是当前登录人!")); |
|
|
|
return; |
|
|
|
} |
|
|
|
var ret = SCP_TB_PRICE_CONTROLLER.Save_TB_PRICE_STATE(_UidList, CurrentUser.Name, (int)PriceState.Reject); |
|
|
|
if (ret.State == ReturnStatus.Succeed) |
|
|
|
{ |
|
|
|
BindData(); |
|
|
|
Alert.Show("删除成功!"); |
|
|
|
Alert.Show(GetResourceKey("删除成功!")); |
|
|
|
return; |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
if (ret.MessageList.Count > 0) |
|
|
|
{ |
|
|
|
Alert.Show(string.Join("<br>", ret.MessageList)); |
|
|
|
Alert.Show(GetResourceKey(string.Join("<br>", ret.MessageList))); |
|
|
|
return; |
|
|
|
} |
|
|
|
else |
|
|
@ -646,7 +659,7 @@ namespace SCP.BasicData |
|
|
|
int[] _selections = Grid1.SelectedRowIndexArray; |
|
|
|
if (_selections.Count() == 0) |
|
|
|
{ |
|
|
|
Alert.Show("请选择数据!"); |
|
|
|
Alert.Show(GetResourceKey("请选择数据!")); |
|
|
|
return; |
|
|
|
} |
|
|
|
List<long> _UidList = new List<long>(); |
|
|
@ -664,26 +677,26 @@ namespace SCP.BasicData |
|
|
|
} |
|
|
|
if (_UidList.Count != _selections.Count()) |
|
|
|
{ |
|
|
|
Alert.Show("选择的记录中包含不可报废数据,请从新选择!"); |
|
|
|
Alert.Show(GetResourceKey("选择的记录中包含不可报废数据,请从新选择!")); |
|
|
|
return; |
|
|
|
} |
|
|
|
var ret = SCP_TB_PRICE_CONTROLLER.Save_TB_PRICE_STATE(_UidList, CurrentUser.Name, (int)PriceState.Reject); |
|
|
|
if (ret.State == ReturnStatus.Succeed) |
|
|
|
{ |
|
|
|
BindData(); |
|
|
|
Alert.Show("报废成功!"); |
|
|
|
Alert.Show(GetResourceKey("报废成功!")); |
|
|
|
return; |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
if (ret.MessageList.Count > 0) |
|
|
|
{ |
|
|
|
Alert.Show(string.Join("<br>", ret.MessageList)); |
|
|
|
Alert.Show(GetResourceKey(string.Join("<br>", ret.MessageList))); |
|
|
|
return; |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
Alert.Show(ret.Message); |
|
|
|
Alert.Show(GetResourceKey(ret.Message)); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -694,7 +707,7 @@ namespace SCP.BasicData |
|
|
|
int[] _selections = Grid1.SelectedRowIndexArray; |
|
|
|
if (_selections.Count() == 0) |
|
|
|
{ |
|
|
|
Alert.Show("请选择数据!"); |
|
|
|
Alert.Show(GetResourceKey("请选择数据!")); |
|
|
|
return; |
|
|
|
} |
|
|
|
List<long> _UidList = new List<long>(); |
|
|
@ -715,19 +728,19 @@ namespace SCP.BasicData |
|
|
|
if (ret.State == ReturnStatus.Succeed) |
|
|
|
{ |
|
|
|
BindData(); |
|
|
|
Alert.Show("删除成功!"); |
|
|
|
Alert.Show(GetResourceKey("删除成功!")); |
|
|
|
return; |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
if (ret.MessageList.Count > 0) |
|
|
|
{ |
|
|
|
Alert.Show(string.Join("<br>", ret.MessageList)); |
|
|
|
Alert.Show(GetResourceKey(string.Join("<br>", ret.MessageList))); |
|
|
|
return; |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
Alert.Show(ret.Message); |
|
|
|
Alert.Show(GetResourceKey(ret.Message)); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -736,7 +749,7 @@ namespace SCP.BasicData |
|
|
|
{ |
|
|
|
if (this.Grid1.SelectedRowIndexArray.Length == 0 && this.Grid1.SelectedRowIndexArray.Length>1) |
|
|
|
{ |
|
|
|
Alert.Show("请选择一行要操作的记录,不能选多条记录!"); |
|
|
|
Alert.Show(GetResourceKey("请选择一行要操作的记录,不能选多条记录!")); |
|
|
|
return; |
|
|
|
} |
|
|
|
string ID = GetSelectedDataKey(Grid1, 0); |
|
|
|