diff --git a/Common/CK.SCP.Common.csproj b/Common/CK.SCP.Common.csproj index e8af561..add89b3 100644 --- a/Common/CK.SCP.Common.csproj +++ b/Common/CK.SCP.Common.csproj @@ -11,6 +11,7 @@ CK.SCP.Common v4.5.2 512 + true diff --git a/Common/MyWebSmtpMail.cs b/Common/MyWebSmtpMail.cs index 87a5adb..6b40df6 100644 --- a/Common/MyWebSmtpMail.cs +++ b/Common/MyWebSmtpMail.cs @@ -33,7 +33,7 @@ namespace CK.SCP.Common this.server = Server; this.password = Password; this.username = UserName; - this.enablessl = false; + this.enablessl = true; this.port = Port; this.credentials = false; } diff --git a/Common/app.config b/Common/app.config index b5d2fd5..5573142 100644 --- a/Common/app.config +++ b/Common/app.config @@ -1,11 +1,11 @@ - + - - + + - \ No newline at end of file + diff --git a/Controller/CK.SCP.Controller.csproj b/Controller/CK.SCP.Controller.csproj index b2f6237..38d55c9 100644 --- a/Controller/CK.SCP.Controller.csproj +++ b/Controller/CK.SCP.Controller.csproj @@ -11,6 +11,7 @@ CK.SCP.Controller v4.5.2 512 + true @@ -30,6 +31,9 @@ 4 + + D:\连接orlcor\ChangKeTec.Utils.dll + ..\packages\EntityFramework.6.2.0\lib\net45\EntityFramework.dll @@ -45,15 +49,28 @@ + + + + + + False + C:\Users\Administrator\Desktop\Z.EntityFramework.Extensions.dll + + + True + True + Settings.settings + @@ -97,6 +114,26 @@ + + True + True + Reference.map + + + True + True + Reference.map + + + True + True + Reference.map + + + True + True + Reference.map + @@ -111,7 +148,94 @@ + + SettingsSingleFileGenerator + Settings.Designer.cs + + + + MSDiscoCodeGenerator + Reference.cs + + + + MSDiscoCodeGenerator + Reference.cs + + + + MSDiscoCodeGenerator + Reference.cs + + + + MSDiscoCodeGenerator + Reference.cs + + + + + + + + + + + Dynamic + Web References\BomList\ + http://10.62.144.124:8016/JsonService.asmx%3f + + + + + Settings + CK_SCP_Controller_BomList_JsonService + + + Dynamic + Web References\BomList1\ + http://10.62.144.124:8070/JsonService.asmx%3f + + + + + Settings + CK_SCP_Controller_BomList1_JsonService + + + Dynamic + Web References\BomVersion1\ + http://10.89.25.69:8085/JsonService.asmx + + + + + Settings + CK_SCP_Controller_BomVersion1_JsonService + + + Dynamic + Web References\BomListcompany\ + http://192.168.0.228:7602/JsonService.asmx%3f + + + + + Settings + CK_SCP_Controller_BomListcompany_JsonService + + + + + + + + + + + + + - \ No newline at end of file diff --git a/Controller/Properties/Settings.Designer.cs b/Controller/Properties/Settings.Designer.cs new file mode 100644 index 0000000..8934f62 --- /dev/null +++ b/Controller/Properties/Settings.Designer.cs @@ -0,0 +1,66 @@ +//------------------------------------------------------------------------------ +// +// 此代码由工具生成。 +// 运行时版本:4.0.30319.42000 +// +// 对此文件的更改可能会导致不正确的行为,并且如果 +// 重新生成代码,这些更改将会丢失。 +// +//------------------------------------------------------------------------------ + +namespace CK.SCP.Controller.Properties { + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.10.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default { + get { + return defaultInstance; + } + } + + [global::System.Configuration.ApplicationScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.SpecialSettingAttribute(global::System.Configuration.SpecialSetting.WebServiceUrl)] + [global::System.Configuration.DefaultSettingValueAttribute("http://10.89.25.69:8085/JsonService.asmx")] + public string CK_SCP_Controller_BomVersion1_JsonService { + get { + return ((string)(this["CK_SCP_Controller_BomVersion1_JsonService"])); + } + } + + [global::System.Configuration.ApplicationScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.SpecialSettingAttribute(global::System.Configuration.SpecialSetting.WebServiceUrl)] + [global::System.Configuration.DefaultSettingValueAttribute("http://10.62.144.124:8016/JsonService.asmx")] + public string CK_SCP_Controller_BomList_JsonService { + get { + return ((string)(this["CK_SCP_Controller_BomList_JsonService"])); + } + } + + [global::System.Configuration.ApplicationScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.SpecialSettingAttribute(global::System.Configuration.SpecialSetting.WebServiceUrl)] + [global::System.Configuration.DefaultSettingValueAttribute("http://192.168.0.228:7602/JsonService.asmx")] + public string CK_SCP_Controller_BomListcompany_JsonService { + get { + return ((string)(this["CK_SCP_Controller_BomListcompany_JsonService"])); + } + } + + [global::System.Configuration.ApplicationScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.SpecialSettingAttribute(global::System.Configuration.SpecialSetting.WebServiceUrl)] + [global::System.Configuration.DefaultSettingValueAttribute("http://10.62.144.124:8070/JsonService.asmx")] + public string CK_SCP_Controller_BomList1_JsonService { + get { + return ((string)(this["CK_SCP_Controller_BomList1_JsonService"])); + } + } + } +} diff --git a/Controller/Properties/Settings.settings b/Controller/Properties/Settings.settings new file mode 100644 index 0000000..dac40e1 --- /dev/null +++ b/Controller/Properties/Settings.settings @@ -0,0 +1,18 @@ + + + + + + http://10.89.25.69:8085/JsonService.asmx + + + http://10.62.144.124:8016/JsonService.asmx + + + http://192.168.0.228:7602/JsonService.asmx + + + http://10.62.144.124:8070/JsonService.asmx + + + \ No newline at end of file diff --git a/Controller/ResultObject.cs b/Controller/ResultObject.cs index 4786bb9..86ef8c4 100644 --- a/Controller/ResultObject.cs +++ b/Controller/ResultObject.cs @@ -1,4 +1,6 @@ -using System; +using CK.SCP.Models.ScpEntity; +using CK.SCP.Models.ScpEntity.ExcelExportEnttity; +using System; using System.Collections.Generic; using System.ComponentModel; using System.Linq; @@ -16,18 +18,16 @@ namespace CK.SCP.Controller public ResultObject() { ErrorList = new List(); - MessageList = new List(); - - - } + MessageList = new List(); + Kblist = new List(); + } public string Message { set; get; } - public List MessageList { set; get; } - - /// - /// 返回结果 - /// - public T Result { set; get; } + public List Kblist { set; get; } + /// + /// 返回结果 + /// + public T Result { set; get; } /// /// 错误列表 /// diff --git a/Controller/SCP_ASK_CONTROLLER.cs b/Controller/SCP_ASK_CONTROLLER.cs index de89ec5..29e9894 100644 --- a/Controller/SCP_ASK_CONTROLLER.cs +++ b/Controller/SCP_ASK_CONTROLLER.cs @@ -165,10 +165,440 @@ namespace CK.SCP.Controller throw e; } } + public static List Getlist(string ASK) + { + using (ScpEntities db = EntitiesFactory.CreateScpInstance()) + { + return db.TA_ASK_SUBPART.Where(p=>p.AskBillNum==ASK&&string.IsNullOrEmpty(p.VendBatch)).ToList(); + } + } + public static ResultObject Update_User_ErrorCount(string p_userName,int count ) + { + ResultObject _ret = new ResultObject(); + try + { + using (AppBoxContext _appdb = EntitiesFactory.CreateAppBoxInstance()) + { + var user = _appdb.Users.FirstOrDefault(p => p.Name == p_userName); + if (user != null) + { + user.ErrorCount = user.ErrorCount + 1; + if(user.ErrorCount== count) + { + user.Enabled = false; + _ret.Message = $"密码错误超过【{count}】次,账号已锁定请联系管理员"; + } + else + { + _ret.Message = $"密码错误,再输入错【{count - user.ErrorCount}】次后账户将锁定!"; + } + } + int state = _appdb.SaveChanges(); + if (state != -1) + { + _ret.State = ReturnStatus.Succeed; + _ret.Result = true; + } + else + { + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + } + } + + } + catch (System.Data.Entity.Validation.DbEntityValidationException dbEx)//捕获实体验证异常 + { + var sb = new StringBuilder(); + + foreach (var error in dbEx.EntityValidationErrors.ToList()) + { + + error.ValidationErrors.ToList().ForEach(i => + { + sb.AppendFormat("表:{0},字段:{1},信息:{2}\r\n", error.Entry.Entity.GetType().Name, i.PropertyName, i.ErrorMessage); + }); + } + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + _ret.ErrorList.Add(dbEx); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_ASK_CONTROLLER), "Update_User_ErrorCount", sb.ToString()); + throw new ScpException(ResultCode.DbEntityValidationException, sb.ToString(), "字段验证失败" + sb.ToString()); + } + catch (OptimisticConcurrencyException ex)//并发冲突异常 + { + + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + _ret.ErrorList.Add(ex); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_ASK_CONTROLLER), "Update_User_ErrorCount", ex.ToString()); + throw new ScpException(ResultCode.Exception, "9999", ex.ToString()); + } + catch (ScpException ex) + { + + + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + _ret.ErrorList.Add(ex); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_ASK_CONTROLLER), "Update_User_ErrorCount", ex.ToString()); + + if (ex.InnerException != null && ex.InnerException.GetType() == typeof(UpdateException)) + { + var inner = (UpdateException)ex.InnerException; + + + throw new ScpException(ResultCode.Exception, "0000", ex.ToString()); + } + else + { + if (ex.InnerException != null) throw ex.InnerException; + } + } + catch (Exception e) + { + _ret.State = ReturnStatus.Failed; + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_ASK_CONTROLLER), "Update_User_ErrorCount", e.Message); + _ret.Result = false; + _ret.ErrorList.Add(e); + throw e; + } + return _ret; + } + public static ResultObject Add_Vendusers(List p_order_list, string site) + { + ResultObject _ret = new ResultObject(); + try + { + using (AppBoxContext _appdb = EntitiesFactory.CreateAppBoxInstance()) + { + foreach (var vend in p_order_list) + { + string na = vend + "@" + site; + var user = _appdb.Users.FirstOrDefault(p => p.Name == na); + if (user != null) + { + VenderUsers _entit = new VenderUsers(); + _entit.UserId = user.ID; + _entit.VenderId = vend; + _appdb.VenderUsers.Add(_entit); + _appdb.SaveChanges(); + } + + } + + + + //int state = _appdb.SaveChanges(); + //if (state != -1) + //{ + _ret.State = ReturnStatus.Succeed; + _ret.Result = true; + //} + //else + //{ + // _ret.State = ReturnStatus.Failed; + // _ret.Result = false; + //} + } + + } + catch (System.Data.Entity.Validation.DbEntityValidationException dbEx)//捕获实体验证异常 + { + var sb = new StringBuilder(); + + foreach (var error in dbEx.EntityValidationErrors.ToList()) + { + + error.ValidationErrors.ToList().ForEach(i => + { + sb.AppendFormat("表:{0},字段:{1},信息:{2}\r\n", error.Entry.Entity.GetType().Name, i.PropertyName, i.ErrorMessage); + }); + } + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + _ret.ErrorList.Add(dbEx); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_ASK_CONTROLLER), "Change_Vend_state", sb.ToString()); + throw new ScpException(ResultCode.DbEntityValidationException, sb.ToString(), "字段验证失败" + sb.ToString()); + } + catch (OptimisticConcurrencyException ex)//并发冲突异常 + { + + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + _ret.ErrorList.Add(ex); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_ASK_CONTROLLER), "Change_Vend_state", ex.ToString()); + throw new ScpException(ResultCode.Exception, "9999", ex.ToString()); + } + catch (ScpException ex) + { + + + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + _ret.ErrorList.Add(ex); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_ASK_CONTROLLER), "Change_Vend_state", ex.ToString()); + + if (ex.InnerException != null && ex.InnerException.GetType() == typeof(UpdateException)) + { + var inner = (UpdateException)ex.InnerException; + + + throw new ScpException(ResultCode.Exception, "0000", ex.ToString()); + } + else + { + if (ex.InnerException != null) throw ex.InnerException; + } + } + catch (Exception e) + { + _ret.State = ReturnStatus.Failed; + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_ASK_CONTROLLER), "Change_Vend_state", e.Message); + _ret.Result = false; + _ret.ErrorList.Add(e); + throw e; + } + return _ret; + } + public static ResultObject Add_ASK_SUBPART(string ask) + { + ResultObject _ret = new ResultObject(); + try + { + using (ScpEntities db = EntitiesFactory.CreateScpInstance()) + { + var askdetail = db.TB_ASK_DETAIL.Where(p => p.AskBillNum == ask).ToList(); + var subcount = db.TA_ASK_SUBPART.Count(p => p.AskBillNum == ask); + if (subcount == 0) + { + foreach (var ak in askdetail) + { + var sub = db.TA_SubPartCode.Where(p => p.PartCode == ak.PartCode).ToList(); + if (sub.Count() > 0) + { + foreach(var su in sub) + { + TA_ASK_SUBPART subpart = new TA_ASK_SUBPART(); + subpart.PartCode = su.PartCode; + subpart.SubPartCode = su.SubPartCode; + subpart.BOMedtiton = su.BOMedtiton; + subpart.AskBillNum = ask; + subpart.Qty = su.Qty; + db.TA_ASK_SUBPART.AddOrUpdate(subpart); + db.TA_SubPartCode.Remove(su); + } + } + + } + } + + if (_ret.MessageList.Count > 0) + { + _ret.State = ReturnStatus.Failed; + + } + else + { + if (db.SaveChanges() != -1) + { + _ret.State = ReturnStatus.Succeed; + _ret.Result = true; + } + else + { + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + } + } + + } + + } + catch (System.Data.Entity.Validation.DbEntityValidationException dbEx)//捕获实体验证异常 + { + var sb = new StringBuilder(); + + foreach (var error in dbEx.EntityValidationErrors.ToList()) + { + + error.ValidationErrors.ToList().ForEach(i => + { + sb.AppendFormat("表:{0},字段:{1},信息:{2}\r\n", error.Entry.Entity.GetType().Name, i.PropertyName, i.ErrorMessage); + }); + } + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + _ret.ErrorList.Add(dbEx); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_ASK_CONTROLLER), "Change_Vend_state", sb.ToString()); + throw new ScpException(ResultCode.DbEntityValidationException, sb.ToString(), "字段验证失败" + sb.ToString()); + } + catch (OptimisticConcurrencyException ex)//并发冲突异常 + { + + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + _ret.ErrorList.Add(ex); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_ASK_CONTROLLER), "Change_Vend_state", ex.ToString()); + throw new ScpException(ResultCode.Exception, "9999", ex.ToString()); + } + catch (ScpException ex) + { + + + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + _ret.ErrorList.Add(ex); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_ASK_CONTROLLER), "Change_Vend_state", ex.ToString()); + + if (ex.InnerException != null && ex.InnerException.GetType() == typeof(UpdateException)) + { + var inner = (UpdateException)ex.InnerException; + + + throw new ScpException(ResultCode.Exception, "0000", ex.ToString()); + } + else + { + if (ex.InnerException != null) throw ex.InnerException; + } + } + catch (Exception e) + { + _ret.State = ReturnStatus.Failed; + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_ASK_CONTROLLER), "Change_Vend_state", e.Message); + _ret.Result = false; + _ret.ErrorList.Add(e); + throw e; + } + return _ret; + } + + public static ResultObject Add_Vend_User(List p_order_list, string site) + { + ResultObject _ret = new ResultObject(); + try + { + using (AppBoxContext _appdb = EntitiesFactory.CreateAppBoxInstance()) + { + foreach (var vend in p_order_list) + { + var user = _appdb.Users.FirstOrDefault(p => p.Name == vend); + + if (user == null) + { + var _factory = _appdb.TA_FACTORY.Where(p => p.ErpDomain == site).FirstOrDefault(); + var _vend = _appdb.Roles.Where(p => p.Name == "供应商").FirstOrDefault(); + User _entity = new User(); + string na = vend + "@" + site; + _entity.Name = na; + _entity.Remark = site; + _entity.Password = PasswordUtil.CreateDbPassword("555555"); + using (ScpEntities db = EntitiesFactory.CreateScpInstance()) + { + var vendname = db.TA_VENDER.FirstOrDefault(p => p.VendId == vend); + _entity.ChineseName = vendname.VendName; + } + _entity.Email = vend + "@163.com"; + _entity.Gender = "男"; + _entity.Enabled = true; + _entity.Roles = new List(); + + Role t = _appdb.Set().Local.Where(x => x.ID == _vend.ID).FirstOrDefault(); + if (t == null) + { + t = new Role { ID = _vend.ID }; + _appdb.Set().Attach(t); + } + _entity.Roles.Add(t); + _entity.TA_FACTORY = new List(); + TA_FACTORY f = _appdb.Set().Local.Where(x => x.ID == _factory.ID).FirstOrDefault(); + if (f == null) + { + f = new TA_FACTORY { ID = _factory.ID }; + _appdb.Set().Attach(f); + } + _entity.TA_FACTORY.Add(f); + _appdb.Users.Add(_entity); + _appdb.SaveChanges(); + + } + } + + + + //int state = _appdb.SaveChanges(); + //if (state != -1) + //{ + _ret.State = ReturnStatus.Succeed; + _ret.Result = true; + //} + //else + //{ + // _ret.State = ReturnStatus.Failed; + // _ret.Result = false; + //} + } + + } + catch (System.Data.Entity.Validation.DbEntityValidationException dbEx)//捕获实体验证异常 + { + var sb = new StringBuilder(); + + foreach (var error in dbEx.EntityValidationErrors.ToList()) + { + + error.ValidationErrors.ToList().ForEach(i => + { + sb.AppendFormat("表:{0},字段:{1},信息:{2}\r\n", error.Entry.Entity.GetType().Name, i.PropertyName, i.ErrorMessage); + }); + } + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + _ret.ErrorList.Add(dbEx); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_ASK_CONTROLLER), "Change_Vend_state", sb.ToString()); + throw new ScpException(ResultCode.DbEntityValidationException, sb.ToString(), "字段验证失败" + sb.ToString()); + } + catch (OptimisticConcurrencyException ex)//并发冲突异常 + { + + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + _ret.ErrorList.Add(ex); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_ASK_CONTROLLER), "Change_Vend_state", ex.ToString()); + throw new ScpException(ResultCode.Exception, "9999", ex.ToString()); + } + catch (ScpException ex) + { + + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + _ret.ErrorList.Add(ex); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_ASK_CONTROLLER), "Change_Vend_state", ex.ToString()); + if (ex.InnerException != null && ex.InnerException.GetType() == typeof(UpdateException)) + { + var inner = (UpdateException)ex.InnerException; + throw new ScpException(ResultCode.Exception, "0000", ex.ToString()); + } + else + { + if (ex.InnerException != null) throw ex.InnerException; + } + } + catch (Exception e) + { + _ret.State = ReturnStatus.Failed; + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_ASK_CONTROLLER), "Change_Vend_state", e.Message); + _ret.Result = false; + _ret.ErrorList.Add(e); + throw e; + } + return _ret; + } /// /// 要货看板减产数量 @@ -488,6 +918,7 @@ namespace CK.SCP.Controller throw e; } } + public static List RejectQty_SUM(List p_list) { using (ScpEntities db = EntitiesFactory.CreateScpInstance()) @@ -1198,7 +1629,221 @@ namespace CK.SCP.Controller + public static ResultObject Save_ASK_TO_WWDZJASN(V_TB_ASK p_ask, List p_order_list, string p_PlateNumber + , string p_buyer, string p_buyerPhone) + { + ResultObject _ret = new ResultObject(); + try + { + using (ScpEntities db = EntitiesFactory.CreateScpInstance()) + { + TB_ASN _t = new TB_ASN(); + _t.AsnBillNum = SCP_BILLCODE_CONTROLLER.MakeASNCode(); + _t.AskBillNum = p_ask.AskBillNum; + _t.PoBillNum = p_ask.PoBillNum; + _t.ReceivedPort = p_ask.ReceivedPort; + _t.CreateUser = p_buyer; + _t.CreateTime = DateTime.Now; + _t.UpdateUser = p_buyer; + _t.UpdateTime = _t.CreateTime; + _t.ReceiveUser = p_ask.Buyer; + _t.ReceiveTime = p_ask.BeginTime; + _t.VendId = p_ask.VendId; + _t.IsDeleted = false;//操作员 + _t.CreateTime = DateTime.Now; + _t.CreateUser = p_buyer; + _t.Site = p_ask.Site; + _t.SubSite = p_ask.SubSite; + _t.Remark = p_ask.Remark; + _t.State = (int)AsnState.New; + _t.Remark = p_ask.Remark; + _t.GUID = Guid.NewGuid(); + _t.PlateNumber = p_PlateNumber; + _t.ShipUser = p_ask.ShipUser; + _t.ShipTime = p_ask.ShipTime; + _t.ReceiveTime = p_ask.ReceiveTime; + foreach (var itm in p_order_list) + { + var partgroup = db.TA_PART.Where(p => p.PartCode == itm.PartCode).FirstOrDefault(); + _t.Extend3 = partgroup.PartGroup; + } + db.TB_ASN.AddOrUpdate(p => p.AsnBillNum, _t); + List _list = new List(); + foreach (var itm in p_order_list) + { + TB_ASN_DETAIL _tDetail = new TB_ASN_DETAIL(); + _tDetail.PoBillNum = _t.PoBillNum; + _tDetail.AsnBillNum = _t.AsnBillNum; + _tDetail.PoLine = itm.PoLine; + _tDetail.PoUnit = itm.PoUnit; + _tDetail.Batch = itm.Batch; + if (itm.VendBatch == "55") + { + _tDetail.VendBatch = ""; + } + else + { + _tDetail.VendBatch = itm.VendBatch; + } + var subpart = db.TA_ASK_SUBPART.Where(p=>p.PartCode== itm.PartCode&&p.AskBillNum==itm.AskBillNum).ToList(); + string str1 = ""; + string str2 = ""; + foreach(var sub in subpart) + { + string str = sub.SubPartCode + "," + sub.BOMedtiton + "," + sub.VendBatch + "#"; + str2 = str2 + sub.VendBatch; + str1 = str1 + str; + } + _tDetail.VendBatch = str1; + _tDetail.UpdateUser = str2; + _tDetail.PackQty = itm.PackQty == 0 ? 1 : itm.PackQty; + _tDetail.PartCode = itm.PartCode; + _tDetail.State = (int)AsnState.New; + _tDetail.Qty = (decimal)itm.TempQty; + _tDetail.Price = itm.Price; + _tDetail.EndTime = itm.EndTime; + _tDetail.CreateTime = _t.CreateTime; + _tDetail.CreateUser = _t.CreateUser; + _tDetail.ProduceDate = itm.ProduceDate; + _tDetail.IsDeleted = false; + _tDetail.DockCode = itm.ReceivedPort; + _tDetail.LocUnit = itm.LocUnit; + _tDetail.UnConv = itm.UnConv; + _tDetail.State = _t.State; + _tDetail.UpdateInfo = itm.UpdateInfo; + _tDetail.ReceivedPort = itm.ReceivedPort; + _tDetail.GUID = Guid.NewGuid(); + _tDetail.SubSite = itm.SubSite; + _tDetail.Site = itm.Site; + _tDetail.Extend2 = itm.ReceivedQty.ToString(); + _tDetail.Remark = itm.ReceivedQty.ToString(); + _tDetail.UpdateInfo = itm.UpdateInfo; + var partgroup = db.TA_PART.Where(p => p.PartCode == itm.PartCode).FirstOrDefault(); + _tDetail.Extend3 = partgroup.PartGroup; + db.TB_ASN_DETAIL.Add(_tDetail); + var _order_detail = db.TB_ASK_DETAIL.Where(p => p.UID == itm.UID).FirstOrDefault(); + _order_detail.ShippedQty = (decimal)itm.ShippedQty; + db.TB_ASK_DETAIL.AddOrUpdate(p => p.UID, _order_detail); + foreach (var sub in subpart) + { + TS_UNI_API uni = new TS_UNI_API(); + uni.InterfaceType = "Receive"; + uni.TableName = "TS_UNI_API"; + uni.BillType = 0; + uni.SubBillType = 0; + uni.BillNum = _tDetail.AsnBillNum; + uni.PartCode = _tDetail.PartCode; + uni.Batch = _tDetail.Batch; + uni.Qty = _tDetail.Qty; + uni.State = 2; + uni.CreateOper=_t.CreateUser; + uni.CreateTime = DateTime.Now; + uni.PutTime= DateTime.Now; + uni.VendId = _t.VendId; + uni.PoUnit = _tDetail.PoUnit; + uni.LocUnit = _tDetail.PoUnit; + uni.ValidDate= DateTime.Now; + uni.ErpBillNum = _tDetail.PoBillNum; + uni.ErpLineNum = _tDetail.PoLine; + uni.VendBatch = sub.VendBatch; + uni.PackQty= _tDetail.Qty; + uni.Price = _tDetail.Price; + uni.UmConv = 1; + uni.Buyer = _t.ShipUser; + uni.BuyerPhone = ""; + uni.Site = _t.Site; + uni.Domain = _t.Site; + uni.ModType = sub.SubPartCode; + uni.Barcode = sub.BOMedtiton; + uni.Extend3 = _tDetail.PoLine.ToString(); + db.TS_UNI_API.Add(uni); + } + } + + var subpartcode = db.TA_ASK_SUBPART.Where(p => p.AskBillNum == _t.AskBillNum).ToList(); + foreach (var sub in subpartcode) + { + sub.VendBatch = ""; + db.TA_ASK_SUBPART.AddOrUpdate(sub); + } + int state = db.SaveChanges(); + if (state != -1) + { + var _askDetailList = db.V_TB_ASK_DETAIL.Where(p => p.AskBillNum == p_ask.AskBillNum && p.IsDeleted == false).ToList();//查询要货单明细 + var _lst = Get_CAN_SHIPQTY(_askDetailList);//算出可发数量 + if (_lst.Select(p => p.CanQty).Sum() <= 0)//可发数量为零时,修改状态 + { + var _ary = db.TB_ASK.Where(p => p.AskBillNum == p_ask.AskBillNum && p.IsDeleted == false).ToList(); + _ary.ForEach(p => p.State = (int)AskState.Ship); + if (_ary.Count() > 0) + { + db.TB_ASK.AddOrUpdate(_ary.ToArray()); + } + } + _ret.State = ReturnStatus.Succeed; + _ret.Result = true; + } + else + { + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + } + } + } + catch (System.Data.Entity.Validation.DbEntityValidationException dbEx)//捕获实体验证异常 + { + var sb = new StringBuilder(); + + foreach (var error in dbEx.EntityValidationErrors.ToList()) + { + + error.ValidationErrors.ToList().ForEach(i => + { + sb.AppendFormat("表:{0},字段:{1},信息:{2}\r\n", error.Entry.Entity.GetType().Name, i.PropertyName, i.ErrorMessage); + }); + } + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + _ret.ErrorList.Add(dbEx); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_ASK_CONTROLLER), "Save_ASK_TO_ASN", sb.ToString()); + throw new ScpException(ResultCode.DbEntityValidationException, sb.ToString(), "字段验证失败" + sb.ToString()); + } + catch (OptimisticConcurrencyException ex)//并发冲突异常 + { + + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + _ret.ErrorList.Add(ex); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_ASK_CONTROLLER), "Save_ASK_TO_ASN", ex.ToString()); + throw new ScpException(ResultCode.Exception, "9999", ex.ToString()); + } + catch (ScpException ex) + { + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + _ret.ErrorList.Add(ex); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_ASK_CONTROLLER), "Save_ASK_TO_ASN", ex.ToString()); + if (ex.InnerException != null && ex.InnerException.GetType() == typeof(UpdateException)) + { + var inner = (UpdateException)ex.InnerException; + throw new ScpException(ResultCode.Exception, "0000", ex.ToString()); + } + else + { + if (ex.InnerException != null) throw ex.InnerException; + } + } + catch (Exception e) + { + _ret.State = ReturnStatus.Failed; + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_ASK_CONTROLLER), "Save_ASK_TO_ASN", e.Message); + _ret.Result = false; + _ret.ErrorList.Add(e); + throw e; + } + return _ret; + } public static ResultObject Save_ASK_TO_ASN(V_TB_ASK p_ask, List p_order_list, string p_PlateNumber , string p_buyer, string p_buyerPhone) { @@ -1207,6 +1852,7 @@ namespace CK.SCP.Controller { using (ScpEntities db = EntitiesFactory.CreateScpInstance()) { + var po = db.TB_PO.FirstOrDefault(p=>p.PoBillNum==p_ask.PoBillNum); TB_ASN _t = new TB_ASN(); _t.AsnBillNum = SCP_BILLCODE_CONTROLLER.MakeASNCode(); _t.AskBillNum = p_ask.AskBillNum; @@ -1232,7 +1878,12 @@ namespace CK.SCP.Controller _t.ShipUser = p_ask.ShipUser; _t.ShipTime = p_ask.ShipTime; _t.ReceiveTime = p_ask.ReceiveTime; - db.TB_ASN.AddOrUpdate(p => p.AsnBillNum, _t); + foreach (var itm in p_order_list) + { + var partgroup = db.TA_PART.Where(p => p.PartCode == itm.PartCode).FirstOrDefault(); + _t.Extend3 = partgroup.PartGroup; + } + db.TB_ASN.AddOrUpdate(p => p.AsnBillNum, _t); List _list = new List(); foreach (var itm in p_order_list) { @@ -1242,14 +1893,21 @@ namespace CK.SCP.Controller _tDetail.PoLine = itm.PoLine; _tDetail.PoUnit = itm.PoUnit; _tDetail.Batch = itm.Batch; - if (!string.IsNullOrEmpty(itm.VendBatch)) + if (itm.VendBatch=="55") + { + _tDetail.VendBatch = ""; + } + else { _tDetail.VendBatch = itm.VendBatch; } - else + + if (_t.PoBillNum.Substring(0, 5) == "CYD03"&&_t.Site=="W21") { - _tDetail.VendBatch = itm.Batch; + var podetail = db.TB_PO_DETAIL.FirstOrDefault(t=>t.PoBillNum==_t.PoBillNum&&t.PartCode==itm.PartCode&&t.PoLine==itm.PoLine); + _tDetail.VendBatch = podetail.SubSite + "," + podetail.Extend3 + "," + itm.VendBatch + "#"; } + _tDetail.UpdateUser= itm.VendBatch; _tDetail.PackQty = itm.PackQty == 0 ? 1 : itm.PackQty; _tDetail.PartCode = itm.PartCode; _tDetail.State = (int)AsnState.New; @@ -1267,12 +1925,82 @@ namespace CK.SCP.Controller _tDetail.UpdateInfo = itm.UpdateInfo; _tDetail.ReceivedPort = itm.ReceivedPort; _tDetail.GUID = Guid.NewGuid(); - _tDetail.SubSite = itm.SubSite; + _tDetail.SubSite = itm.SubSite; _tDetail.Site = itm.Site; + _tDetail.Extend2 = itm.ReceivedQty.ToString(); + _tDetail.Remark= itm.ReceivedQty.ToString(); + _tDetail.UpdateInfo = itm.UpdateInfo; + var partgroup = db.TA_PART.Where(p => p.PartCode == itm.PartCode).FirstOrDefault(); + var askdetail=db.TB_ASK_DETAIL.Where(p => p.PartCode == itm.PartCode&&p.AskBillNum==itm.AskBillNum).FirstOrDefault(); + _tDetail.Extend3 = partgroup.PartGroup; + _tDetail.Extend1 =po.VendId; + if (itm.Site == "U32") + { + var _applin = db.TA_Appliance.FirstOrDefault(p=>p.PartNumber==itm.SubSite&&p.VendID==p_ask.VendId); + if (_applin != null) + { + var _boxtype = db.TA_BOXTYPE.FirstOrDefault(p=>p.BoxType==_applin.BoxType&&p.Enabled==true); + if (_boxtype != null) + { + TB_ASN_PARTBOX PARTBOX = new TB_ASN_PARTBOX(); + PARTBOX.AsnBillNum = _t.AsnBillNum; + PARTBOX.PartCode = itm.PartCode; + PARTBOX.BoxType = _boxtype.BoxType; + PARTBOX.Box = Convert.ToInt32(_tDetail.Qty) / Convert.ToInt32(_tDetail.PackQty); + if(Convert.ToInt32(_tDetail.Qty) % Convert.ToInt32(_tDetail.PackQty) > 0) + { + PARTBOX.Box = PARTBOX.Box + 1; + } + PARTBOX.SumBox = PARTBOX.Box; + PARTBOX.PoBillNum = _t.PoBillNum; + PARTBOX.VendId = _t.VendId; + PARTBOX.ShipTime =DateTime.Parse(_t.ShipTime.ToString()).ToShortDateString(); + PARTBOX.Batch = _tDetail.Batch; + PARTBOX.PoLine = _tDetail.PoLine; + PARTBOX.PackQty = _tDetail.PackQty; + db.TB_ASN_PARTBOX.AddOrUpdate(PARTBOX); + } + } + if (!string.IsNullOrEmpty(askdetail.Extend2)) + { + var ModelList = db.TA_CarModel.ToList(); + foreach (var model in ModelList) + { + if(model.Model.Length<=askdetail.Extend2.Length) + { + + if (askdetail.Extend2.Contains(model.Model)) + { + _tDetail.Extend1 = "FT"; + break; + } + } + + _tDetail.Extend1 = "PT"; + } + //if (askdetail.Extend2.Contains("941B") || askdetail.Extend2.Contains("330B") || askdetail.Extend2.Contains("812B") || askdetail.Extend2.Contains("260B") || askdetail.Extend2.Contains("875B") || askdetail.Extend2.Contains("710B") || askdetail.Extend2.Contains("280B") || askdetail.Extend2.Contains("770B") || askdetail.Extend2.Contains("290D") || askdetail.Extend2.Contains("891B") || askdetail.Extend2.Contains("031D") || askdetail.Extend2.Contains("822B") || askdetail.Extend2.Contains("845B") || askdetail.Extend2.Contains("067D") || askdetail.Extend2.Contains("115D")) + //{ + // _tDetail.Extend1 = "FT"; + //} + //else + //{ + // _tDetail.Extend1 = "PT"; + //} + } + else + { + _tDetail.Extend1 = "PT"; + } + + + } db.TB_ASN_DETAIL.Add(_tDetail); var _order_detail = db.TB_ASK_DETAIL.Where(p => p.UID == itm.UID).FirstOrDefault(); _order_detail.ShippedQty = (decimal)itm.ShippedQty; + + db.TB_ASK_DETAIL.AddOrUpdate(p => p.UID, _order_detail); + } int state = db.SaveChanges(); if (state != -1) @@ -1358,7 +2086,7 @@ namespace CK.SCP.Controller { using (ScpEntities db = EntitiesFactory.CreateScpInstance()) { - var _ls = p_list.Select(p => p.AskBillNum); + var _ls = p_list.Select(p => p.AskBillNum); StringBuilder _buffer = new StringBuilder(); _buffer.Append(" select distinct (C.AskBillNum)from V_TB_ASK_DETAIL C"); _buffer.Append(" left JOIN "); @@ -1382,6 +2110,39 @@ namespace CK.SCP.Controller } return p_list; } + + public static List GET_IS_COMPLETED_SEND1(List p_list,string lz) + { + using (ScpEntities db = EntitiesFactory.CreateScpInstance()) + { + List lt = new List(); + var _ls = p_list.Select(p => p.AskBillNum); + StringBuilder _buffer = new StringBuilder(); + _buffer.Append(" select AskBillNum from V_TB_ASK_DETAIL "); + _buffer.Append($" WHERE Currency like '%{lz}%'"); + var _str = string.Format(_buffer.ToString(), string.Join("','", _ls.ToArray())); + var _list = db.Database.SqlQuery(_str).ToList(); + var ll= p_list.Where(p => _list.Contains(p.AskBillNum)).ToList(); + return ll; + } + + } + public static List GET_IS_COMPLETED_SEND2(List p_list, string lz) + { + using (ScpEntities db = EntitiesFactory.CreateScpInstance()) + { + List lt = new List(); + var _ls = p_list.Select(p => p.AskBillNum); + StringBuilder _buffer = new StringBuilder(); + _buffer.Append(" select AskBillNum from V_TB_ASK_DETAIL "); + _buffer.Append($" WHERE SubSite='{lz}'"); + var _str = string.Format(_buffer.ToString(), string.Join("','", _ls.ToArray())); + var _list = db.Database.SqlQuery(_str).ToList(); + var ll = p_list.Where(p => _list.Contains(p.AskBillNum)).ToList(); + return ll; + } + + } public static decimal Get_ASN_DETAIL_CAN(V_TB_ASK_DETAIL p_asn_detail) { decimal _canqty = 0; @@ -1450,7 +2211,9 @@ namespace CK.SCP.Controller p_list.ForEach(itm => { - + var maxtime = db.TB_ASN_DETAIL.Where(p=>p.PartCode==itm.PartCode&&p.State>-1).Select(t=>t.ProduceDate).Max(); + + itm.MaxTime = maxtime.ToString(); groupList.ForEach(p => { if (p.PoBillNum == itm.PoBillNum && p.PoLine == itm.PoLine && p.PartCode == itm.PartCode) @@ -1465,6 +2228,7 @@ namespace CK.SCP.Controller itm.RejectQty = Math.Abs(p.BackSum);//寄售退货数 } }); + decimal a = itm.AskQty - (itm.ShippedQty == null ? 0 : (decimal)itm.ShippedQty) + itm.RejectQty - (itm.ReduceQty == null ? 0 : (decimal)itm.ReduceQty); itm.CanQty = a; itm.PackQty = (itm.PackQty == 0) ? 1 : itm.PackQty; @@ -1885,7 +2649,8 @@ namespace CK.SCP.Controller try { using (ScpEntities db = EntitiesFactory.CreateScpInstance()) - { + { + if (p_state == AskState.Close) { var _ls = db.TB_ASK.Where(p => p_list.Contains(p.AskBillNum)).ToList(); @@ -1899,13 +2664,16 @@ namespace CK.SCP.Controller _ret.State = ReturnStatus.Failed; _ret.Result = false; _ret.MessageList.Add(p.AskBillNum + "存在未发货的发货单!"); + } else - { - p.State = (int)AskState.Close; - var _list = db.TB_ASK_DETAIL.Where(itm => itm.AskBillNum == p.AskBillNum).ToList(); + { + p.State = (int)AskState.Close; + var _list = db.TB_ASK_DETAIL.Where(itm => itm.AskBillNum == p.AskBillNum).ToList(); _list.ForEach(itm => itm.State = (int)AskState.Close); db.TB_ASK_DETAIL.AddOrUpdate(itm => itm.UID, _list.ToArray()); + + } } ); @@ -2018,6 +2786,15 @@ namespace CK.SCP.Controller if (p_state == AskState.Release) { var _ls = db.TB_ASK.Where(p => p_list.Contains(p.AskBillNum)).ToList(); + foreach (var mail in _ls) + { + TB_SUPPLIER_MAIL mall = new TB_SUPPLIER_MAIL(); + mall.State = 0; + mall.SupplicerCode = mail.VendId; + mall.MailBody = "有新的要货订单" + mail.AskBillNum; + mall.Email = mail.PoBillNum; + db.TB_SUPPLIER_MAIL.Add(mall); + } int count = _ls.Count(p => p.State == (int)AskState.New); if (count > 0) { diff --git a/Controller/SCP_ASN_CONTROLLER.cs b/Controller/SCP_ASN_CONTROLLER.cs index 47f2768..5d137f1 100644 --- a/Controller/SCP_ASN_CONTROLLER.cs +++ b/Controller/SCP_ASN_CONTROLLER.cs @@ -69,6 +69,7 @@ namespace CK.SCP.Controller } return dt; } + public static void Get_V_TB_ASN_List(V_TB_ASN p_entity, Action>> p_action,string p_language="CN") { ResultObject> _ret = new ResultObject>(); @@ -231,6 +232,287 @@ namespace CK.SCP.Controller throw e; } } + public static ResultObject Save_Asn_Vendbatch(List p_order_list) + { + ResultObject _ret = new ResultObject(); + try + { + using (ScpEntities db = EntitiesFactory.CreateScpInstance()) + { + List _list = new List(); + var PartList = p_order_list.GroupBy(p => p.PartCode).ToList(); + + PartList.ForEach(p=> + { + var list = p.ToList(); + var batchList = list.Select(t => t.VendBatch).Distinct(); + if(list.Count()!= batchList.Count()) + { + _ret.MessageList.Add("同一物料号,不同子件物料号的原卷号不能相同"); + } + }); + foreach (var itm in p_order_list) + { + var detail = db.TA_ASK_SUBPART.FirstOrDefault(P => P.UID == itm.UID); + detail.VendBatch = itm.VendBatch; + db.TA_ASK_SUBPART.AddOrUpdate(p => p.UID, detail); + } + + if (_ret.MessageList.Count() == 0) + { + int state = db.SaveChanges(); + _ret.State = ReturnStatus.Succeed; + _ret.Result = true; + } + else + { + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + } + + + } + } + catch (System.Data.Entity.Validation.DbEntityValidationException dbEx)//捕获实体验证异常 + { + var sb = new StringBuilder(); + + foreach (var error in dbEx.EntityValidationErrors.ToList()) + { + + error.ValidationErrors.ToList().ForEach(i => + { + sb.AppendFormat("表:{0},字段:{1},信息:{2}\r\n", error.Entry.Entity.GetType().Name, i.PropertyName, i.ErrorMessage); + }); + } + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + _ret.ErrorList.Add(dbEx); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_ASN_CONTROLLER), "Save_Asn_ProduceDate", sb.ToString()); + throw new ScpException(ResultCode.DbEntityValidationException, sb.ToString(), "字段验证失败" + sb.ToString()); + } + catch (OptimisticConcurrencyException ex)//并发冲突异常 + { + + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + _ret.ErrorList.Add(ex); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_ASN_CONTROLLER), "Save_Asn_ProduceDate", ex.ToString()); + throw new ScpException(ResultCode.Exception, "9999", ex.ToString()); + } + catch (ScpException ex) + { + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + _ret.ErrorList.Add(ex); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_ASN_CONTROLLER), "Save_Asn_ProduceDate", ex.ToString()); + + if (ex.InnerException != null && ex.InnerException.GetType() == typeof(UpdateException)) + { + var inner = (UpdateException)ex.InnerException; + throw new ScpException(ResultCode.Exception, "0000", ex.ToString()); + } + else + { + if (ex.InnerException != null) throw ex.InnerException; + } + } + catch (Exception e) + { + _ret.State = ReturnStatus.Failed; + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_ASN_CONTROLLER), "Save_Asn_ProduceDate", e.Message); + _ret.Result = false; + _ret.ErrorList.Add(e); + throw e; + } + return _ret; + } + public static ResultObject Delete_asn(List asn) + { + ResultObject _ret = new ResultObject(); + try + { + using (ScpEntities db = EntitiesFactory.CreateScpInstance()) + { + + { + int number = 1; + List lineError = new List(); + List ErrorList = new List(); + + foreach (var nn in asn) + { + var _ls = CheckExce2(db, nn); + if (_ls.Count > 0) + { + lineError.Add(number.ToString()); + ErrorList.Add(string.Join("
", _ls.ToArray())); + number++; + } + if (lineError.Count > 0) + { + _ret.State = ReturnStatus.Failed; + _ret.MessageList.AddRange(ErrorList); + _ret.Result = false; + } + else + { + + var ASN = db.TB_ASN.Where(p => p.AsnBillNum == nn).FirstOrDefault(); + var detail = db.TB_ASN_DETAIL.Where(p => p.AsnBillNum == nn).ToArray(); + if (ASN != null) + { + ASN.State = -1; + ASN.IsDeleted = true; + db.TB_ASN.AddOrUpdate(ASN); + } + if (detail.Count() > 0) + { + foreach (var itm in detail) + { + itm.IsDeleted = true; + itm.State = -1; + + } + db.TB_ASN_DETAIL.AddOrUpdate(detail); + } + + } + } + } + + if (_ret.MessageList.Count == 0) + { + int state = db.SaveChanges(); + if (state != -1) + { + _ret.State = ReturnStatus.Succeed; + _ret.Result = true; + } + else + { + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + } + } + else + { + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + } + + } + } + catch (System.Data.Entity.Validation.DbEntityValidationException dbEx)//捕获实体验证异常 + { + var sb = new StringBuilder(); + + foreach (var error in dbEx.EntityValidationErrors.ToList()) + { + + error.ValidationErrors.ToList().ForEach(i => + { + sb.AppendFormat("表:{0},字段:{1},信息:{2}\r\n", error.Entry.Entity.GetType().Name, i.PropertyName, i.ErrorMessage); + }); + } + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + _ret.ErrorList.Add(dbEx); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "Delete_asn", sb.ToString()); + throw new ScpException(ResultCode.DbEntityValidationException, sb.ToString(), "字段验证失败" + sb.ToString()); + } + catch (OptimisticConcurrencyException ex)//并发冲突异常 + { + + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + _ret.ErrorList.Add(ex); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "Delete_asn", ex.ToString()); + throw new ScpException(ResultCode.Exception, "9999", ex.ToString()); + } + catch (ScpException ex) + { + + + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + _ret.ErrorList.Add(ex); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "Delete_asn", ex.ToString()); + + if (ex.InnerException != null && ex.InnerException.GetType() == typeof(UpdateException)) + { + var inner = (UpdateException)ex.InnerException; + + + throw new ScpException(ResultCode.Exception, "0000", ex.ToString()); + } + else + { + if (ex.InnerException != null) throw ex.InnerException; + } + } + catch (Exception e) + { + _ret.State = ReturnStatus.Failed; + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "Delete_asn", e.Message); + _ret.Result = false; + _ret.ErrorList.Add(e); + throw e; + } + return _ret; + } + + private static List CheckExce2(ScpEntities db, string lt) + { + List ErrorList = new List(); + var _asn = db.TB_ASN.Count(p => p.AsnBillNum == lt&&p.State>0); + if (_asn > 0) + { + ErrorList.Add(string.Format("发货单【{0}】不是新建状态,不能作废", lt)); + } + return ErrorList; + } + + public static List SearchCxcount(string asn) + { + using (ScpEntities db = EntitiesFactory.CreateScpInstance()) + { + var asndetail= db.TB_ASN_DETAIL.Where(p => p.AsnBillNum==asn&&p.Extend1=="FT").ToList(); + return asndetail; + + } + + } + public static List SearchCxcount1(string asn) + { + using (ScpEntities db = EntitiesFactory.CreateScpInstance()) + { + var asndetail = db.TB_ASN_DETAIL.Where(p => p.AsnBillNum== asn && p.Extend1 == "PT").ToList(); + return asndetail; + + } + + } + public static List SearchPartBox(string asn) + { + using (ScpEntities db = EntitiesFactory.CreateScpInstance()) + { + var PartBox = db.TB_ASN_PARTBOX.Where(p => p.AsnBillNum == asn && p.Box>0).ToList(); + return PartBox; + + } + + } + public static List SearchBarcode(string asn) + { + using (ScpEntities db = EntitiesFactory.CreateScpInstance()) + { + var barcode = db.TS_BARCODE.Where(p => p.BillNum == asn).ToList(); + return barcode; + + } + + } public static void Get_TB_Pallet_List(V_TB_PALLETS p_entity, Action>> p_action) { ResultObject> _ret = new ResultObject>(); @@ -798,7 +1080,7 @@ namespace CK.SCP.Controller return _ret; } - public static DataSet ASN_REPORT(string p_AsnBillNum) + public static DataSet ASN_REPORT(string p_AsnBillNum,string CurrentUserPhone) { DataSet ds = new DataSet(); SCP_ASN_CONTROLLER.Get_V_TB_ASN_List(new V_TB_ASN { AsnBillNum = p_AsnBillNum }, (ret) => @@ -816,12 +1098,34 @@ namespace CK.SCP.Controller _print.SupplierNo = _asn.VendId; _print.SupplierName = _asn.VendName; _print.SupplierContacter = _asn.ShipUser; - _print.DueDeliveryDate = _asn.ReceiveTime.ToString(); + _print.DueDeliveryDate = _asn.EndTime.ToShortDateString(); _print.MaterialPlanner = _asn.Buyer; _print.CAAIPhone = ""; _print.CAAIFax = ""; _print.Site = _asn.Site; _print.Total = "0"; + _print.CurrentUserPhone = CurrentUserPhone; + if (_asn.Site == "U32") + { + using (ScpEntities db = EntitiesFactory.CreateScpInstance()) + { + var Bb = db.TA_Receiving_Information.Count(t => t.Shift == "白班"); + if (Bb > 0) + { + var Bb1 = db.TA_Receiving_Information.FirstOrDefault(t => t.Shift == "白班"); + _print.SupplierContacter = Bb1.Name + ":" + Bb1.Phone; + } + + var Yb = db.TA_Receiving_Information.Count(t => t.Shift == "夜班"); + if (Bb > 0) + { + var Yb1 = db.TA_Receiving_Information.FirstOrDefault(t => t.Shift == "夜班"); + _print.FileNo = Yb1.Name + ":" + Yb1.Phone; + } + _print.CAAIFax = _asn.ShipUser; + } + } + using (AppBoxContext _appdb = EntitiesFactory.CreateAppBoxInstance()) { StringBuilder _buffer = new StringBuilder(); @@ -859,13 +1163,23 @@ namespace CK.SCP.Controller _detail.Boxes = (Math.Truncate((p.Qty / p.PackQty)) + (((p.Qty % p.PackQty) > 0) ? 1 : 0)).ToString(); _detail.DeliverQty = p.Qty.ToString(); _detail.ReceiveQty = p.Qty.ToString(); - _detail.PoNo = p.PoBillNum+"."+p.AskBillNum; + //_detail.PoNo = p.PoBillNum + "." + p.AskBillNum; + //if (p.Site == "U32") + //{ + _detail.PoNo = p.PoBillNum; + //} + _detail.LineNO = p.PoLine.ToString(); _detail.Memo = p.Remark; _detail.Batch = p.Batch; _detail.VendBatch = p.VendBatch; - _detail.DockCode = p.DockCode; - _detail.ProjectId = _lst.Where(itm => itm.PartCode == p.PartCode).FirstOrDefault().ProjectId; + _detail.DockCode = p.Extend2; + using (ScpEntities db = EntitiesFactory.CreateScpInstance()) + { + var Poqty = db.TB_PO_DETAIL.FirstOrDefault(t=>t.PartCode== p.PartCode&&t.PoBillNum==p.PoBillNum&&t.PoLine==p.PoLine); + _detail.PoQty = Poqty.PlanQty.ToString(); + } + // _detail.ProjectId = _lst.Where(itm => itm.PartCode == p.PartCode).FirstOrDefault().ProjectId; _lsDetail.Add(_detail); }); @@ -902,7 +1216,8 @@ namespace CK.SCP.Controller _print.CAAIPhone = ""; _print.CAAIFax = ""; _print.Total = "0"; - using (AppBoxContext _appdb = EntitiesFactory.CreateAppBoxInstance()) + + using (AppBoxContext _appdb = EntitiesFactory.CreateAppBoxInstance()) { StringBuilder _buffer = new StringBuilder(); var _ls = _appdb.Users.Where(p => p.Roles.Select(itm => itm.Name).Contains("物流人员")).ToList(); @@ -1492,25 +1807,30 @@ namespace CK.SCP.Controller { string _asnBillNum = p_list[0].AsnBillNum; var _asn = db.TB_ASN.Where(p => p.IsDeleted == false && p.AsnBillNum == _asnBillNum).FirstOrDefault(); + var _asn1 = db.TB_ASN_DETAIL.Where(p => p.IsDeleted == false && p.AsnBillNum == _asnBillNum).FirstOrDefault(); + List _asnList = new List(); p_list.ForEach(p => { decimal _qty = 0; decimal _packQty = 0; + var partcount = p_list.Where(t=>t.PartCode==p.PartCode); + if (decimal.TryParse(p.Qty.ToString(), out _qty) && decimal.TryParse(p.PackQty.ToString(), out _packQty)) { decimal _n = _qty / _packQty; var _count=int.Parse( Math.Truncate(_n).ToString()); if (_qty / _packQty > 0) { + for (int i = 0; i < _count; i++) { V_TB_ASN_DETAIL _asndetail = new V_TB_ASN_DETAIL(); _asndetail.PoBillNum = p.PoBillNum; _asndetail.Batch = p.Batch; _asndetail.PartCode = p.PartCode; - _asndetail.ProduceDate = p.ProduceDate; - _asndetail.Qty = _packQty; + _asndetail.ProduceDate = p.ProduceDate; + _asndetail.Qty = _packQty; _asndetail.AsnBillNum = p.AsnBillNum; _asndetail.PoLine = p.PoLine; _asndetail.VendId = p.VendId; @@ -1522,6 +1842,7 @@ namespace CK.SCP.Controller _asndetail.PoUnit = p.PoUnit; _asndetail.Site = p.Site; _asndetail.UpdateInfo = p.UpdateInfo; + _asndetail.UpdateUser = p.UpdateUser; _asnList.Add(_asndetail); } if (_qty % _packQty > 0) @@ -1543,6 +1864,8 @@ namespace CK.SCP.Controller _asndetail.PoUnit = p.PoUnit; _asndetail.UpdateInfo = p.UpdateInfo; _asndetail.Site = p.Site; + _asndetail.UpdateInfo = p.UpdateInfo; + _asndetail.UpdateUser = p.UpdateUser; _asnList.Add(_asndetail); } } @@ -1567,17 +1890,46 @@ namespace CK.SCP.Controller _asndetail.PoUnit = p.PoUnit; _asndetail.Site = p.Site; _asndetail.UpdateInfo = p.UpdateInfo; + _asndetail.UpdateUser = p.UpdateUser; _asnList.Add(_asndetail); } } } }); - foreach (var itm in _asnList) + + if (_asnList.Count>=1000&& _asnList[0].Site== "U32")//本特勒大于1000时采用批量生成方式 { - var _bar = SCP_BARCODE_CONTROLLER.CreateBarcode(itm); - _ls.Add(_bar); + var groups = _asnList.GroupBy(r => new { r.PartCode, r.Batch, r.Site, r.PoBillNum, r.AskBillNum }).ToList(); + foreach (var group in groups) + { + var list = _asnList.Where(r => r.PartCode == group.Key.PartCode && r.Batch == group.Key.Batch && r.Site == group.Key.Site && r.PoBillNum == group.Key.PoBillNum && r.AskBillNum == group.Key.AskBillNum).ToList(); + var ret = SCP_BARCODE_CONTROLLER.CreateBatchBarcodeList(list); + if (ret.State == ReturnStatus.Succeed) + { + _ls.AddRange(ret.Result); + + } + else + { + _ret.MessageList.Add(ret.Message); + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + return _ret; + } + } + db.TS_BARCODE.BulkInsert(_ls.ToArray()); } - db.TS_BARCODE.AddOrUpdate(p => new { p.BarCode, p.BillNum }, _ls.ToArray()); + else + { + + foreach (var itm in _asnList) + { + var _bar = SCP_BARCODE_CONTROLLER.CreateBarcode(itm); + _ls.Add(_bar); + } + + db.TS_BARCODE.AddOrUpdate(p => new { p.BarCode, p.BillNum }, _ls.ToArray()); + } } else { @@ -1897,6 +2249,150 @@ namespace CK.SCP.Controller } return _ret; } + public static ResultObject Save_TB_PALLET_BTL(List p_list) + { + ResultObject _ret = new ResultObject(); + try + { + using (ScpEntities db = EntitiesFactory.CreateScpInstance()) + { + int _sumbox = p_list.Sum(p => p.Qty); + SqlParameter[] prams = new SqlParameter[1]; + prams[0] = new SqlParameter("@a", 105); + string lastNumber = db.Database.SqlQuery("exec dbo.P_GetBillNum @a", prams).SingleOrDefault(); + if (lastNumber.Length != 8 || !lastNumber.Contains('P')) + { + _ret.MessageList.Add("托盘生成失败!"); + } + string str = ""; + decimal _qy = 0; + foreach (var li in p_list) + { + + var ts = db.TS_BARCODE.OrderBy(T => T.UID).Where(T => string.IsNullOrEmpty(T.PalletNum) && T.BillNum == li.AsnBillNum && T.PartCode == li.PartCode).ToList().Take(li.Qty); + var tss = ts.ToList(); + decimal _qty = tss.Sum(p => p.Qty); + string str1 = li.PartCode + "," + li.Batch+","+ _qty+","+li.PoLine+"#"; + tss.ForEach(itm => itm.PalletNum = lastNumber); + db.TS_BARCODE.AddOrUpdate(itm => itm.UID, tss.ToArray()); + str = str + str1; + _qy = _qy + _qty; + li.Box = li.Box - li.Qty; + li.Qty1 = 0; + db.TB_ASN_PARTBOX.AddOrUpdate(li); + } + var _ls = p_list.First(); + TB_PALLETS_BTL pallet = new TB_PALLETS_BTL(); + pallet.AsnBillNum = _ls.AsnBillNum; + + pallet.PalletNum = lastNumber; + pallet.PoBillNum = _ls.PoBillNum; + pallet.VendId = _ls.VendId; + var vend = db.TA_VENDER.FirstOrDefault(p => p.VendId == _ls.VendId); + pallet.VendName = vend.VendName; + pallet.ShipTime = _ls.ShipTime; + + pallet.SumBox = _sumbox; + pallet.PalletCode = lastNumber+";"+ _ls.AsnBillNum+";" + _ls.PoBillNum+";" + _ls.VendId+";"+ str; + pallet.SumQty = _qy; + if (p_list.Count() > 0) + { + int _count = 6 - p_list.Count(); + if (_count > 0) + { + for (int a = 1; a <= _count; a++) + { + TB_ASN_PARTBOX _partbox = new TB_ASN_PARTBOX(); + + p_list.Add(_partbox); + } + } + pallet.PackQty = p_list.First().PackQty.ToString(); + pallet.PartCode = p_list.First().PartCode.ToString(); + pallet.Box = p_list.First().Qty.ToString(); + pallet.PackQty1 = p_list[p_list.Count - 5].PackQty==0?"": p_list[p_list.Count - 5].PackQty.ToString(); + pallet.PartCode1 = string.IsNullOrEmpty(p_list[p_list.Count - 5].PartCode)?"": p_list[p_list.Count - 5].PartCode; + pallet.Box1 = p_list[p_list.Count - 5].Qty==0 ? "": p_list[p_list.Count - 5].Qty.ToString(); + pallet.PackQty2 = p_list[p_list.Count - 4].PackQty==0 ?"": p_list[p_list.Count - 4].PackQty.ToString(); + pallet.PartCode2 =string.IsNullOrEmpty(p_list[p_list.Count - 4].PartCode)?"": p_list[p_list.Count - 4].PartCode; + pallet.Box2 = p_list[p_list.Count - 4].Qty==0?"" : p_list[p_list.Count - 4].Qty.ToString(); + pallet.PackQty3 = p_list[p_list.Count - 3].PackQty==0 ? "": p_list[p_list.Count - 3].PackQty.ToString(); + pallet.PartCode3 = string.IsNullOrEmpty(p_list[p_list.Count - 3].PartCode)?"": p_list[p_list.Count - 3].PartCode; + pallet.Box3 = p_list[p_list.Count - 3].Qty==0?"" : p_list[p_list.Count - 3].Qty.ToString(); + pallet.PackQty4 = p_list[p_list.Count - 2].PackQty==0 ? "": p_list[p_list.Count - 2].PackQty.ToString(); + pallet.PartCode4 = string.IsNullOrEmpty(p_list[p_list.Count - 2].PartCode)?"": p_list[p_list.Count - 2].PartCode; + pallet.Box4 = p_list[p_list.Count - 2].Qty==0 ? "": p_list[p_list.Count - 2].Qty.ToString(); + pallet.PackQty5 = p_list.Last().PackQty == 0 ? "" : p_list.Last().PackQty.ToString(); + pallet.PartCode5 =string.IsNullOrEmpty(p_list.Last().PartCode) ? "" : p_list.Last().PartCode; + pallet.Box5 = p_list.Last().Qty==0 ?"": p_list.Last().Qty.ToString(); + pallet.IsDeleted = false; + } + db.TB_PALLETS_BTL.AddOrUpdate(pallet); + int state = db.SaveChanges(); + if (state != -1) + { + _ret.State = ReturnStatus.Succeed; + _ret.Result = true; + } + else + { + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + + } + + } + } + catch (System.Data.Entity.Validation.DbEntityValidationException dbEx)//捕获实体验证异常 + { + var sb = new StringBuilder(); + foreach (var error in dbEx.EntityValidationErrors.ToList()) + { + error.ValidationErrors.ToList().ForEach(i => + { + sb.AppendFormat("表:{0},字段:{1},信息:{2}\r\n", error.Entry.Entity.GetType().Name, i.PropertyName, i.ErrorMessage); + }); + } + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + _ret.ErrorList.Add(dbEx); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_ASN_CONTROLLER), "Save_TB_PALLET_BTL", sb.ToString()); + throw new ScpException(ResultCode.DbEntityValidationException, sb.ToString(), "字段验证失败" + sb.ToString()); + } + catch (OptimisticConcurrencyException ex)//并发冲突异常 + { + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + _ret.ErrorList.Add(ex); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_ASN_CONTROLLER), "Save_TB_PALLET_BTL", ex.ToString()); + throw new ScpException(ResultCode.Exception, "9999", ex.ToString()); + } + catch (ScpException ex) + { + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + _ret.ErrorList.Add(ex); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_ASN_CONTROLLER), "Save_TB_PALLET_BTL", ex.ToString()); + if (ex.InnerException != null && ex.InnerException.GetType() == typeof(UpdateException)) + { + var inner = (UpdateException)ex.InnerException; + throw new ScpException(ResultCode.Exception, "0000", ex.ToString()); + } + else + { + if (ex.InnerException != null) throw ex.InnerException; + } + } + catch (Exception e) + { + _ret.State = ReturnStatus.Failed; + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_ASN_CONTROLLER), "Save_TB_PALLET_BTL", e.Message); + _ret.Result = false; + _ret.ErrorList.Add(e); + throw e; + } + return _ret; + } public static ResultObject Save_TB_PALLET_JZJH(List p_list) { @@ -2329,7 +2825,7 @@ namespace CK.SCP.Controller { using (ScpEntities db = EntitiesFactory.CreateScpInstance()) { - var _list = db.TS_UNI_API.Where(p => p.BillNum == p_asn.AsnBillNum).ToList(); + var _list = db.TS_UNI_API.Where(p => p.BillNum == p_asn.AsnBillNum&&p.State==1).ToList(); if (_list.Count > 0) { _ret.State = ReturnStatus.Failed; @@ -2400,15 +2896,128 @@ namespace CK.SCP.Controller } return _ret; } - public static ResultObject Save_TB_ASN_DETAIL(V_TB_ASN p_asn, List p_entitys) + + public static ResultObject Get_TB_ASN_BACH(V_TB_ASN p_asn) { ResultObject _ret = new ResultObject(); try { using (ScpEntities db = EntitiesFactory.CreateScpInstance()) { + int i = 0; + List asn1 =new List (); + var asn = db.V_TB_ASN_DETAIL.Count(p=>p.VendId== p_asn.VendId&& p.State==0&&p.AsnBillNum!=p_asn.AsnBillNum); + if (asn > 0) + { + var _list = db.V_TB_ASN_DETAIL.Where(p => p.AsnBillNum == p_asn.AsnBillNum&& p.VendId == p_asn.VendId).ToList(); + foreach(var part in _list) + { + var pa = db.V_TB_ASN_DETAIL.Count(p => p.PartCode == part.PartCode&&p.State==0&&p.ProduceDate 0) + { + var pa1 = db.V_TB_ASN_DETAIL.Where(p => p.PartCode == part.PartCode && p.State == 0 && p.ProduceDate < part.ProduceDate && p.VendId == p_asn.VendId).ToList(); + foreach(var p in pa1) + { + if (!asn1.Contains(p.AsnBillNum)) + { + asn1.Add(p.AsnBillNum); + } + + } + i++; + } + + } + + } + string STR = ""; + if (asn1.Count() > 0) + { + STR = String.Join(";", asn1); + } + + if (i > 0) + { + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + _ret.Message = STR; + + + } + else + { + _ret.State = ReturnStatus.Succeed; + _ret.Result = true; + } + } + } + catch (System.Data.Entity.Validation.DbEntityValidationException dbEx)//捕获实体验证异常 + { + var sb = new StringBuilder(); + + foreach (var error in dbEx.EntityValidationErrors.ToList()) + { + + error.ValidationErrors.ToList().ForEach(i => + { + sb.AppendFormat("表:{0},字段:{1},信息:{2}\r\n", error.Entry.Entity.GetType().Name, i.PropertyName, i.ErrorMessage); + }); + } + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + _ret.ErrorList.Add(dbEx); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_ASN_CONTROLLER), "Get_TS_UNI_API", sb.ToString()); + throw new ScpException(ResultCode.DbEntityValidationException, sb.ToString(), "字段验证失败" + sb.ToString()); + } + catch (OptimisticConcurrencyException ex)//并发冲突异常 + { + + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + _ret.ErrorList.Add(ex); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_ASN_CONTROLLER), "Get_TS_UNI_API", ex.ToString()); + throw new ScpException(ResultCode.Exception, "9999", ex.ToString()); + } + catch (ScpException ex) + { + + + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + _ret.ErrorList.Add(ex); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_ASN_CONTROLLER), "Get_TS_UNI_API", ex.ToString()); + + if (ex.InnerException != null && ex.InnerException.GetType() == typeof(UpdateException)) + { + var inner = (UpdateException)ex.InnerException; + + throw new ScpException(ResultCode.Exception, "0000", ex.ToString()); + } + else + { + if (ex.InnerException != null) throw ex.InnerException; + } + } + catch (Exception e) + { + _ret.State = ReturnStatus.Failed; + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_ASN_CONTROLLER), "Get_TS_UNI_API", e.Message); + _ret.Result = false; + _ret.ErrorList.Add(e); + throw e; + } + return _ret; + } + public static ResultObject Save_TB_ASN_DETAIL(V_TB_ASN p_asn, List p_entitys) + { + ResultObject _ret = new ResultObject(); + try + { + using (ScpEntities db = EntitiesFactory.CreateScpInstance()) + { DateTime now = DateTime.Now; + List consumlist = new List(); List _ls = new List(); var _asn =db.TB_ASN.Where(p => p.IsDeleted == false && p.AsnBillNum == p_asn.AsnBillNum).ToList(); if (_asn != null && _asn.Count>0) @@ -2420,7 +3029,83 @@ namespace CK.SCP.Controller db.TB_ASN.AddOrUpdate(p => p.UID, _asn.ToArray()); var ask = db.TB_ASK.Where(p => p.IsDeleted == false && p.AskBillNum == p_asn.AskBillNum).ToList(); ask.ForEach(p => p.State = (int)AskState.Ship); - db.TB_ASK.AddOrUpdate(p => p.UID, ask.ToArray()); + db.TB_ASK.AddOrUpdate(p => p.UID, ask.ToArray()); + var Asn = p_entitys.First(); + var po = db.TB_PO.FirstOrDefault(p=>p.PoBillNum==Asn.PoBillNum); + if (po.UpdateInfo == "Y"&&po.Site=="W21") + { + p_entitys.ForEach(p => + { + var _maxpolist = db.TB_MAXPO_DETAIL.Where(t => t.PartCode == p.PartCode && t.VendId == p.Extend1&&t.AsnQty>0).ToList().OrderBy(t=>t.ContractMonth); + decimal sum = 0; + if (_maxpolist.Count() > 0) + { + sum = _maxpolist.Sum(t => t.AsnQty); + } + decimal Qtyy = p.Qty; + + if(sum< Qtyy) + { + _ret.MessageList.Add(string.Format("确认发货失败,零件号{0}大订单剩余数量不足,请联系业务人员维护", p.PartCode)); + } + else + { + foreach (var _maxpo in _maxpolist) + { + if (_maxpo.AsnQty > Qtyy) + { + _maxpo.AsnQty = _maxpo.AsnQty - Qtyy; + TB_MAXPO_CONSUME consumne = new TB_MAXPO_CONSUME(); + consumne.PoBillNum = _maxpo.PoBillNum; + consumne.BillNum = p.AsnBillNum; + consumne.PoQty = Qtyy; + consumne.VendId = _maxpo.VendId; + consumne.PartCode = _maxpo.PartCode; + consumne.ShipTime = _maxpo.CreateTime; + consumlist.Add(consumne); + + db.TB_MAXPO_DETAIL.AddOrUpdate(_maxpo); + + break; + } + else if (_maxpo.AsnQty == Qtyy) + { + TB_MAXPO_CONSUME consumne = new TB_MAXPO_CONSUME(); + consumne.PoBillNum = _maxpo.PoBillNum; + consumne.BillNum = p.AsnBillNum; + consumne.PoQty = Qtyy; + consumne.VendId = _maxpo.VendId; + consumne.PartCode = _maxpo.PartCode; + consumne.ShipTime = _maxpo.CreateTime; + consumlist.Add(consumne); + _maxpo.AsnQty = 0; + + db.TB_MAXPO_DETAIL.AddOrUpdate(_maxpo); + + break; + } + else if (_maxpo.AsnQty < Qtyy) + { + + TB_MAXPO_CONSUME consumne = new TB_MAXPO_CONSUME(); + consumne.PoBillNum = _maxpo.PoBillNum; + consumne.BillNum = p.AsnBillNum; + consumne.PoQty = _maxpo.AsnQty; + consumne.VendId = _maxpo.VendId; + consumne.PartCode = _maxpo.PartCode; + consumne.ShipTime = _maxpo.CreateTime; + Qtyy = Qtyy - _maxpo.AsnQty; + consumlist.Add(consumne); + _maxpo.AsnQty = 0; + db.TB_MAXPO_DETAIL.AddOrUpdate(_maxpo); + } + + } + } + + + }); + } p_entitys.ForEach(itm => { @@ -2432,8 +3117,8 @@ namespace CK.SCP.Controller && p.PoBillNum == p_asn.PoBillNum && p.PoLine == itm.PoLine && p.IsDeleted == false).Select(p => p.Qty).Sum(); var _rejct = db.TB_ARRIVE_DETAIL.Where(p => p.Remark == p_asn.AskBillNum && p.PartCode == itm.PartCode && p.PoBillNum == p_asn.PoBillNum && p.PoLine == itm.PoLine && p.IsDeleted == false&&p.BillType==3).Select(p => p.Qty).ToList().Sum(); - if (_currSum - _curr + itm.Qty- Math.Abs(_rejct) <= _sum) - { + //if (_currSum - _curr + itm.Qty- Math.Abs(_rejct) <= _sum) + //{ TB_ASN_DETAIL _detail = new TB_ASN_DETAIL(); _detail.UID = itm.UID; _detail.UnConv = itm.UnConv; @@ -2455,20 +3140,32 @@ namespace CK.SCP.Controller _detail.PoUnit = itm.PoUnit; _detail.LocUnit = itm.LocUnit; _detail.IsDeleted = itm.IsDeleted; - _detail.State = (int)AsnState.Ship; - + _detail.State = (int)AsnState.Ship; _detail.GUID = itm.Guid; + _detail.UpdateInfo = itm.UpdateInfo; + _detail.UpdateUser = itm.UpdateUser; + _detail.Extend1 = itm.Extend1; _ls.Add(_detail); - - - TS_UNI_API api = UniApiController.CreateBy(p_asn, itm, UniApiType.Receive); - api.State = 1; - db.TS_UNI_API.AddOrUpdate(api);//同步更新中间表 + + var UNI = db.TS_UNI_API.Count(p=>p.BillNum==itm.AsnBillNum);//多组件订单更新中间表 + if (UNI > 0) + { + var UN = db.TS_UNI_API.Where(p => p.BillNum == itm.AsnBillNum).ToList(); + foreach(var u in UN) + { + u.PutTime = DateTime.Now; + u.State = 1; + db.TS_UNI_API.AddOrUpdate(u); + } } else { - _ret.MessageList.Add(string.Format("行号{0}零件名称:{1}数量合计已大于要货单{2}数量", itm.PoLine, itm.PartDesc1, itm.AskBillNum)); + TS_UNI_API api = UniApiController.CreateBy(p_asn, itm, UniApiType.Receive); + api.State = 1; + db.TS_UNI_API.AddOrUpdate(api);//同步更新中间表 } + + } ); var _asnBillNum = _asn[0].AsnBillNum; @@ -2487,7 +3184,10 @@ namespace CK.SCP.Controller else { db.TB_ASN_DETAIL.AddOrUpdate(p => p.UID, _ls.ToArray()); - + if (consumlist.Count() > 0) + { + db.TB_MAXPO_CONSUME.AddRange(consumlist); + } if (db.SaveChanges() != -1) { _ret.State = ReturnStatus.Succeed; @@ -3340,5 +4040,6 @@ namespace CK.SCP.Controller } return ErrorList; } - } + } + } diff --git a/Controller/SCP_BARCODE_CONTROLLER.cs b/Controller/SCP_BARCODE_CONTROLLER.cs index 41741c6..3829d0a 100644 --- a/Controller/SCP_BARCODE_CONTROLLER.cs +++ b/Controller/SCP_BARCODE_CONTROLLER.cs @@ -96,8 +96,217 @@ namespace CK.SCP.Controller } return _ret; } + public static ResultObject DELETE_TB_PALLETS_BTL(List _ls) + { + ResultObject _ret = new ResultObject(); + try + { + using (ScpEntities db = EntitiesFactory.CreateScpInstance()) + { + foreach(var ls in _ls) + { + List list = new List(); + var _pallete = db.TB_PALLETS_BTL.FirstOrDefault(p=>p.UID.ToString()==ls); + if (!string.IsNullOrEmpty(_pallete.PartCode)) + { + var _asnpart = db.TB_ASN_PARTBOX.FirstOrDefault(p=>p.PartCode== _pallete.PartCode&&p.AsnBillNum== _pallete.AsnBillNum); + _asnpart.Box = _asnpart.Box +int.Parse(_pallete.Box); + list.Add(_asnpart); + } + if (!string.IsNullOrEmpty(_pallete.PartCode1)) + { + var _asnpart = db.TB_ASN_PARTBOX.FirstOrDefault(p => p.PartCode == _pallete.PartCode1 && p.AsnBillNum == _pallete.AsnBillNum); + _asnpart.Box = _asnpart.Box + int.Parse(_pallete.Box1); + list.Add(_asnpart); + } + if (!string.IsNullOrEmpty(_pallete.PartCode2)) + { + var _asnpart = db.TB_ASN_PARTBOX.FirstOrDefault(p => p.PartCode == _pallete.PartCode2 && p.AsnBillNum == _pallete.AsnBillNum); + _asnpart.Box = _asnpart.Box + int.Parse(_pallete.Box2); + list.Add(_asnpart); + } + if (!string.IsNullOrEmpty(_pallete.PartCode3)) + { + var _asnpart = db.TB_ASN_PARTBOX.FirstOrDefault(p => p.PartCode == _pallete.PartCode3 && p.AsnBillNum == _pallete.AsnBillNum); + _asnpart.Box = _asnpart.Box + int.Parse(_pallete.Box3); + list.Add(_asnpart); + } + if (!string.IsNullOrEmpty(_pallete.PartCode4)) + { + var _asnpart = db.TB_ASN_PARTBOX.FirstOrDefault(p => p.PartCode == _pallete.PartCode4 && p.AsnBillNum == _pallete.AsnBillNum); + _asnpart.Box = _asnpart.Box + int.Parse(_pallete.Box4); + list.Add(_asnpart); + } + if (!string.IsNullOrEmpty(_pallete.PartCode5)) + { + var _asnpart = db.TB_ASN_PARTBOX.FirstOrDefault(p => p.PartCode == _pallete.PartCode5 && p.AsnBillNum == _pallete.AsnBillNum); + _asnpart.Box = _asnpart.Box + int.Parse(_pallete.Box5); + list.Add(_asnpart); + } + _pallete.IsDeleted = true; + var _ts = db.TS_BARCODE.Where(p => p.PalletNum == _pallete.PalletNum).ToList(); + _ts.ForEach(p=>{ + p.PalletNum = ""; + }); + db.TS_BARCODE.AddOrUpdate(_ts.ToArray()); + db.TB_ASN_PARTBOX.AddOrUpdate(list.ToArray()); + db.TB_PALLETS_BTL.AddOrUpdate(_pallete); + } + + if (_ret.MessageList.Count > 0) + { + _ret.State = ReturnStatus.Failed; + + } + else + { + if (db.SaveChanges() != -1) + { + _ret.State = ReturnStatus.Succeed; + _ret.Result = true; + } + else + { + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + } + } + + } + + } + catch (System.Data.Entity.Validation.DbEntityValidationException dbEx)//ʵ֤쳣 + { + var sb = new StringBuilder(); + + foreach (var error in dbEx.EntityValidationErrors.ToList()) + { + + error.ValidationErrors.ToList().ForEach(i => + { + sb.AppendFormat("{0}ֶΣ{1}Ϣ{2}\r\n", error.Entry.Entity.GetType().Name, i.PropertyName, i.ErrorMessage); + }); + } + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + _ret.ErrorList.Add(dbEx); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_ASK_CONTROLLER), "Change_Vend_state", sb.ToString()); + throw new ScpException(ResultCode.DbEntityValidationException, sb.ToString(), "ֶ֤ʧ" + sb.ToString()); + } + catch (OptimisticConcurrencyException ex)//ͻ쳣 + { + + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + _ret.ErrorList.Add(ex); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_ASK_CONTROLLER), "Change_Vend_state", ex.ToString()); + throw new ScpException(ResultCode.Exception, "9999", ex.ToString()); + } + catch (ScpException ex) + { + + + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + _ret.ErrorList.Add(ex); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_ASK_CONTROLLER), "Change_Vend_state", ex.ToString()); + + if (ex.InnerException != null && ex.InnerException.GetType() == typeof(UpdateException)) + { + var inner = (UpdateException)ex.InnerException; + + + throw new ScpException(ResultCode.Exception, "0000", ex.ToString()); + } + else + { + if (ex.InnerException != null) throw ex.InnerException; + } + } + catch (Exception e) + { + _ret.State = ReturnStatus.Failed; + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_ASK_CONTROLLER), "Change_Vend_state", e.Message); + _ret.Result = false; + _ret.ErrorList.Add(e); + throw e; + } + return _ret; + } + public static void Get_TS_PALLETS_BTL_List(TB_PALLETS_BTL p_entity, Action>> p_action) + { + ResultObject> _ret = new ResultObject>(); + try + { + using (ScpEntities db = EntitiesFactory.CreateScpInstance()) + { + IQueryable q = db.TB_PALLETS_BTL; + + if (!string.IsNullOrEmpty(p_entity.PalletNum)) + { + q = q.Where(p => p.PalletNum == p_entity.PalletNum); + } + if (!string.IsNullOrEmpty(p_entity.AsnBillNum)) + { + q = q.Where(p => p.AsnBillNum == p_entity.AsnBillNum); + } + q = q.Where(p => p.IsDeleted == p_entity.IsDeleted); + _ret.State = ReturnStatus.Succeed; + _ret.Result = q; + p_action(_ret); + } + } + catch (System.Data.Entity.Validation.DbEntityValidationException dbEx)//ʵ֤쳣 + { + var sb = new StringBuilder(); + + foreach (var error in dbEx.EntityValidationErrors.ToList()) + { + + error.ValidationErrors.ToList().ForEach(i => + { + sb.AppendFormat("{0}ֶΣ{1}Ϣ{2}\r\n", error.Entry.Entity.GetType().Name, i.PropertyName, i.ErrorMessage); + }); + } + _ret.State = ReturnStatus.Failed; + _ret.ErrorList.Add(dbEx); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_BARCODE_CONTROLLER), "Get_TS_BARCODE_List", sb.ToString()); + throw new ScpException(ResultCode.DbEntityValidationException, sb.ToString(), "ֶ֤ʧ" + sb.ToString()); + } + catch (OptimisticConcurrencyException ex)//ͻ쳣 + { + + _ret.State = ReturnStatus.Failed; + _ret.ErrorList.Add(ex); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_BARCODE_CONTROLLER), "Get_TS_BARCODE_List", ex.ToString()); + throw new ScpException(ResultCode.Exception, "9999", ex.ToString()); + } + catch (ScpException ex) + { + _ret.State = ReturnStatus.Failed; + _ret.ErrorList.Add(ex); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_BARCODE_CONTROLLER), "Get_TS_BARCODE_List", ex.ToString()); + if (ex.InnerException != null && ex.InnerException.GetType() == typeof(UpdateException)) + { + var inner = (UpdateException)ex.InnerException; + throw new ScpException(ResultCode.Exception, "0000", ex.ToString()); + } + else + { + if (ex.InnerException != null) throw ex.InnerException; + } + } + catch (Exception e) + { + _ret.State = ReturnStatus.Failed; + _ret.ErrorList.Add(e); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_BARCODE_CONTROLLER), "Get_TS_BARCODE_List", e.Message); + throw e; + } + } + public static ResultObject> Get_TB_PRINT_COUNT_List(TB_PRINT_COUNT p_entity) { ResultObject> _ret = new ResultObject>(); @@ -483,7 +692,7 @@ namespace CK.SCP.Controller _ret.MessageList.Add("Ϣδҵñ!"); } var vendPart= db.TA_VEND_PART.FirstOrDefault(p => p.PartCode == p_entity.PartCode && p.VendId == p_entity.VendId); - var ret = GetSmallBarcodeRule(p_entity.PartCode, p_entity.Batch, cnt); + var ret = GetSmallBarcodeRule(p_entity.PartCode, p_entity.Batch, cnt); var _part = db.TA_PART.FirstOrDefault(p => p.PartCode == p_entity.PartCode && p.Site == p_entity.Site); if (ret.State == ReturnStatus.Succeed) { @@ -521,6 +730,7 @@ namespace CK.SCP.Controller Remark = p_entity.Remark, SmallPackQty = p_entity.PackQty, Site = p_entity.Site + }; if (_part == null) { @@ -670,14 +880,222 @@ namespace CK.SCP.Controller } return _ret; } + /// + /// 루ͬţʱأ + /// + /// + /// + public static ResultObject> CreateBatchBarcodeList(List details) + { + + ResultObject> _ret = new ResultObject>(); + try + { + using (ScpEntities db = EntitiesFactory.CreateScpInstance()) + { + var checkitem = details.Select(r => new { r.PartCode, r.Batch }).Distinct(); + + if (checkitem.Count() > 1) + { + _ret.State = ReturnStatus.Failed; + _ret.Message = ",ڶβܵӡ,ϵԱ!"; + return _ret; + } + var list = new List(); + var ret = GetBarcodeRule(details[0].PartCode, details[0].Batch, details.Count); + if (ret.State == ReturnStatus.Succeed) + { + var barcodeRule = ret.Result; + var partcode = details[0].PartCode; + var vendId = details[0].VendId; + var asnBillNum = details[0].AsnBillNum; + var site= details[0].Site; + var poBillNum= details[0].PoBillNum; + var part = db.TA_PART.FirstOrDefault(p => p.PartCode == partcode); + if (part == null) + { + _ret.MessageList.Add("Ϣδҵñ!"); + //throw e; + } + var vendPart = db.TA_VEND_PART.FirstOrDefault(p => p.PartCode == partcode && p.VendId == vendId && p.Site == site); + var _part1 = db.TB_ASN_DETAIL.FirstOrDefault(p => p.PartCode == partcode && p.AsnBillNum == asnBillNum && p.PoBillNum == poBillNum); + string coustomer = ""; + if (_part1.Extend1 == "FT") + { + var _coustomer = db.TA_SubPart.FirstOrDefault(p => p.PartCode == partcode); + if (_coustomer != null) + { + coustomer = _coustomer.SubPart.Replace("-", ""); + } + } + else + { + coustomer = part.PartCode.Replace("-", ""); + } + var _part = db.TA_PART.FirstOrDefault(p => p.PartCode == partcode && p.Site == site); + var _AsnBillNum = db.TB_ASN.FirstOrDefault(p => p.AsnBillNum == asnBillNum); + var _Ask = db.TB_ASK_DETAIL.FirstOrDefault(p => p.PartCode == part.PartCode); + var _Askde = db.TB_ASK_DETAIL.FirstOrDefault(p => p.PartCode == part.PartCode && p.AskBillNum == _AsnBillNum.AskBillNum); + string str; + string str1; + string str2; + string str3; + string str4; + string str5; + string str6; + str2 = _AsnBillNum.ReceiveTime.ToString(); + var _PinFan = db.TA_PinFan.FirstOrDefault(p => p.PartCode == partcode); + str6 = _PinFan == null ? "" : _PinFan.Barcodnt; + var _Appliance = db.TA_Appliance.FirstOrDefault(p => p.VendID == _AsnBillNum.VendId && p.PartNumber == _Askde.SubSite); + str = _Appliance == null ? "" : _Appliance.Model;// + str1 = _Appliance == null ? "" : _Appliance.ReciteNumber;// + str3 = _Appliance == null ? "" : _Appliance.SufanLand;// + str4 = _Appliance == null ? "" : _Appliance.BoxType;// + str5 = _Appliance == null ? "" : _Appliance.PostEngineering;//󹤳 + for (int i = 0; i < details.Count; i++) + { + var barcodenum = barcodeRule.LastNumber - details.Count+i+1; + V_TB_ASN_DETAIL p_entity = details[i]; + var createTime = ScpCache.GetServerTime(); + var code = GetLastBarCode(p_entity.PartCode, p_entity.Batch, barcodenum); + if (part.PartDesc1.ToUpper().Contains("") || part.PartDesc1.ToUpper().Contains("LEFT") || + part.PartDesc2.ToUpper().Contains("") || part.PartDesc1.ToUpper().Contains("LEFT")) + p_entity.Remark = "L" + p_entity.Remark; + if (part.PartDesc1.ToUpper().Contains("") || part.PartDesc1.ToUpper().Contains("LEFT") || + part.PartDesc2.ToUpper().Contains("") || part.PartDesc1.ToUpper().Contains("LEFT")) + p_entity.Remark = "R" + p_entity.Remark; + string _check = (_part.Ischeck == false || _part.Ischeck == null) ? "" : "()"; + var barcode = new TS_BARCODE + { + BarCode = code, + PartCode = part.PartCode, + Extend12 = coustomer, + VendPartCode = vendPart?.VendPartCode, + Batch = p_entity.Batch, + ProduceDate = (DateTime)p_entity.ProduceDate, + SerialNum = barcodenum.ToString(ScpCache.Config.кŸʽ), + PoUnit = p_entity.PoUnit, + Qty = p_entity.Qty, + BarCodeType = 1, + BillNum = p_entity.AsnBillNum, + PoBillNum = p_entity.PoBillNum, + PoBillLine = p_entity.PoLine, + VendId = p_entity.VendId, + VendBatch = p_entity.VendBatch, + Extend1 = _part.PartDesc2, + Extend2 = _part.ReceivePort,//ë + Extend3 = _part.PalletSize,// + CreateTime = p_entity.CreateTime, + CreateOper = p_entity.CreateUser, + State = 0, + Remark = p_entity.UpdateInfo, + PackQty = p_entity.PackQty, + Site = p_entity.Site, + IsScanned = false, + Extend4 = _Askde.SubSite,//ŲϺ + Extend5 = str,// + Extend7 = part.PartDesc1, + Extend6 = DateTime.Parse(str2), + Extend8 = str1,// + Extend9 = str3,// + Extend10 = str4,// + Extend11 = str5,//󹤳 + Extend13 = (_AsnBillNum.ShipTime).Value, + Extend14 = _part1.Extend2, + Extend15 = str6,//Ʒ + Extend16 = _part1.Extend1, + ProjectId = p_entity.UpdateUser + + }; + + if (_part == null) + { + _ret.MessageList.Add("δҵ,ŻصϢ," + p_entity.PartCode); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_BARCODE_CONTROLLER), "CreateBarcodeList", "δҵ,ŻصϢ," + p_entity.PartCode); + } + else + { + var _isCheck = (_part.Ischeck == null) ? false : _part.Ischeck; + barcode.Qlevel = _part.Qlevel; + barcode.QMark = (_isCheck == true) ? "" : "ȫ"; + //barcode.ProjectId = _part.ProjectId; + } + var fullCode = GetFullCode(barcode); + barcode.FullBarCode = fullCode; + list.Add(barcode); + } + _ret.State = ReturnStatus.Succeed; + _ret.Result = list; + } + else + { + _ret.State = ReturnStatus.Failed; + _ret.Message = "!"; + } + } + } + catch (System.Data.Entity.Validation.DbEntityValidationException dbEx)//ʵ֤쳣 + { + var sb = new StringBuilder(); + + foreach (var error in dbEx.EntityValidationErrors.ToList()) + { + + error.ValidationErrors.ToList().ForEach(i => + { + sb.AppendFormat("{0}ֶΣ{1}Ϣ{2}\r\n", error.Entry.Entity.GetType().Name, i.PropertyName, i.ErrorMessage); + }); + } + _ret.State = ReturnStatus.Failed; + _ret.ErrorList.Add(dbEx); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_BARCODE_CONTROLLER), "CreateBatchBarcodeList", sb.ToString()); + throw new ScpException(ResultCode.DbEntityValidationException, sb.ToString(), "ֶ֤ʧ" + sb.ToString()); + } + catch (OptimisticConcurrencyException ex)//ͻ쳣 + { + + _ret.State = ReturnStatus.Failed; + _ret.ErrorList.Add(ex); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_BARCODE_CONTROLLER), "CreateBatchBarcodeList", ex.ToString()); + throw new ScpException(ResultCode.Exception, "9999", ex.ToString()); + } + catch (ScpException ex) + { + + + _ret.State = ReturnStatus.Failed; + _ret.ErrorList.Add(ex); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_BARCODE_CONTROLLER), "CreateBatchBarcodeList", ex.ToString()); + + if (ex.InnerException != null && ex.InnerException.GetType() == typeof(UpdateException)) + { + var inner = (UpdateException)ex.InnerException; + + + throw new ScpException(ResultCode.Exception, "0000", ex.ToString()); + } + else + { + if (ex.InnerException != null) throw ex.InnerException; + } + } + catch (Exception e) + { + _ret.State = ReturnStatus.Failed; + _ret.ErrorList.Add(e); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_BARCODE_CONTROLLER), "CreateBarcodeList", e.Message); + throw e; + } + return _ret; + } public static ResultObject> CreateBarcodeList(V_TB_ASN_DETAIL p_entity, int cnt = 1) { ResultObject> _ret = new ResultObject>(); try { - + using (ScpEntities db = EntitiesFactory.CreateScpInstance()) { var list = new List(); @@ -687,12 +1105,44 @@ namespace CK.SCP.Controller _ret.MessageList.Add("Ϣδҵñ!"); //throw e; } - var vendPart - = db.TA_VEND_PART.FirstOrDefault(p => p.PartCode == p_entity.PartCode && p.VendId == p_entity.VendId && p.Site==p_entity.Site); + var vendPart = db.TA_VEND_PART.FirstOrDefault(p => p.PartCode == p_entity.PartCode && p.VendId == p_entity.VendId && p.Site == p_entity.Site); var ret = GetBarcodeRule(p_entity.PartCode, p_entity.Batch, cnt); - + var _part1 = db.TB_ASN_DETAIL.FirstOrDefault(p => p.PartCode == p_entity.PartCode && p.AsnBillNum == p_entity.AsnBillNum && p.PoBillNum == p_entity.PoBillNum); + string coustomer = ""; + if (_part1.Extend1 == "FT") + { + var _coustomer = db.TA_SubPart.FirstOrDefault(p => p.PartCode == p_entity.PartCode); + if (_coustomer != null) + { + coustomer = _coustomer.SubPart.Replace("-", ""); + } + } + else + { + coustomer = part.PartCode.Replace("-", ""); + } + + var _part=db.TA_PART.FirstOrDefault(p=>p.PartCode==p_entity.PartCode && p.Site==p_entity.Site); - + var _AsnBillNum=db.TB_ASN.FirstOrDefault(p => p.AsnBillNum == p_entity.AsnBillNum ); + var _Ask = db.TB_ASK_DETAIL.FirstOrDefault(p => p.PartCode == part.PartCode); + var _Askde = db.TB_ASK_DETAIL.FirstOrDefault(p => p.PartCode == part.PartCode&&p.AskBillNum== _AsnBillNum.AskBillNum); + string str; + string str1; + string str2; + string str3; + string str4; + string str5; + string str6; + str2 = _AsnBillNum.ReceiveTime.ToString(); + var _PinFan = db.TA_PinFan.FirstOrDefault(p => p.PartCode == p_entity.PartCode); + str6 = _PinFan == null ? "" : _PinFan.Barcodnt; + var _Appliance = db.TA_Appliance.FirstOrDefault(p => p.VendID == _AsnBillNum.VendId && p.PartNumber == _Askde.SubSite); + str = _Appliance == null ? "" : _Appliance.Model;// + str1 = _Appliance == null ? "" : _Appliance.ReciteNumber;// + str3 = _Appliance == null ? "" : _Appliance.SufanLand;// + str4 = _Appliance == null ? "" : _Appliance.BoxType;// + str5 = _Appliance == null ? "" : _Appliance.PostEngineering;//󹤳 if (ret.State == ReturnStatus.Succeed) { var barcodeRule = ret.Result; @@ -711,6 +1161,8 @@ namespace CK.SCP.Controller { BarCode = code, PartCode = part.PartCode, + Extend12 = coustomer, + VendPartCode = vendPart?.VendPartCode, Batch = p_entity.Batch, ProduceDate = (DateTime)p_entity.ProduceDate, @@ -719,19 +1171,34 @@ namespace CK.SCP.Controller Qty = p_entity.Qty, BarCodeType = 1, BillNum = p_entity.AsnBillNum, - PoBillNum=p_entity.PoBillNum, + PoBillNum = p_entity.PoBillNum, PoBillLine = p_entity.PoLine, VendId = p_entity.VendId, VendBatch = p_entity.VendBatch, - + Extend1 = _part.PartDesc2, + Extend2 = _part.ReceivePort,//ë + Extend3 = _part.PalletSize,// CreateTime = p_entity.CreateTime, CreateOper = p_entity.CreateUser, State = 0, Remark = p_entity.UpdateInfo, PackQty = p_entity.PackQty, Site = p_entity.Site, - IsScanned = false - + IsScanned = false, + Extend4 = _Askde.SubSite,//ŲϺ + Extend5 = str,// + Extend7 = part.PartDesc1, + Extend6 = DateTime.Parse(str2), + Extend8 = str1,// + Extend9 = str3,// + Extend10 = str4,// + Extend11 = str5,//󹤳 + Extend13 = (_AsnBillNum.ShipTime).Value, + Extend14 = _part1.Extend2, + Extend15 = str6,//Ʒ + Extend16 = _part1.Extend1, + ProjectId = p_entity.UpdateUser + }; if (_part == null) @@ -744,7 +1211,7 @@ namespace CK.SCP.Controller var _isCheck=(_part.Ischeck == null)?false:_part.Ischeck; barcode.Qlevel = _part.Qlevel; barcode.QMark = (_isCheck == true) ? "" : "ȫ"; - barcode.ProjectId = _part.ProjectId; + //barcode.ProjectId = _part.ProjectId; } var fullCode = GetFullCode(barcode); barcode.FullBarCode = fullCode; @@ -994,7 +1461,111 @@ namespace CK.SCP.Controller } return _ret; } - private static ResultObject GetBarcodeRule( string partcode, string batch, int cnt = 1) + public static ResultObject updatebarder(List barder) + { + ResultObject _ret = new ResultObject(); + try + { + using (ScpEntities db = EntitiesFactory.CreateScpInstance()) + { + + foreach (var yy in barder) + { + var _barder = db.TS_BARCODE.SingleOrDefault(t => t.UID.ToString() == yy); + var _second1 = db.TS_BARCODE.Where(p => p.PartCode == _barder.PartCode).Select(r => r.SerialNum).Max(); + var _bard = db.TS_BARCODE.SingleOrDefault(t => t.SerialNum.ToString() == _second1.ToString()&&t.PartCode==_barder.PartCode); + string str = _barder.BarCode; + //str.Split('.'); + + //string str1 = str.Substring(str.Length - 6); + string str1 = _bard.SerialNum; + string str3 = str.Substring(0, str.Length - 6); + int i = Int32.Parse(str1); + i = i + 1; + string ss = i.ToString().PadLeft(6, '0'); + string str4=str3+ss; + var _barder1 = db.TS_BARCODE.Count(t => t.BarCode.ToString() == str4); + _barder.BarCode = str4; + _barder.SerialNum = ss; + db.TS_BARCODE.AddOrUpdate(_barder); + + + if (db.SaveChanges() != -1) + { + _ret.State = ReturnStatus.Succeed; + + } + else + { + _ret.State = ReturnStatus.Failed; + + } + } + } + } + catch (System.Data.Entity.Validation.DbEntityValidationException dbEx)//ʵ֤쳣 + { + var sb = new StringBuilder(); + + foreach (var error in dbEx.EntityValidationErrors.ToList()) + { + + error.ValidationErrors.ToList().ForEach(i => + { + sb.AppendFormat("{0}ֶΣ{1}Ϣ{2}\r\n", error.Entry.Entity.GetType().Name, i.PropertyName, i.ErrorMessage); + }); + } + _ret.State = ReturnStatus.Failed; + _ret.ErrorList.Add(dbEx); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_BARCODE_CONTROLLER), "GetBarcodeRule", sb.ToString()); + throw new ScpException(ResultCode.DbEntityValidationException, sb.ToString(), "ֶ֤ʧ" + sb.ToString()); + } + catch (OptimisticConcurrencyException ex)//ͻ쳣 + { + + _ret.State = ReturnStatus.Failed; + _ret.ErrorList.Add(ex); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_BARCODE_CONTROLLER), "GetBarcodeRule", ex.ToString()); + throw new ScpException(ResultCode.Exception, "9999", ex.ToString()); + } + catch (ScpException ex) + { + _ret.State = ReturnStatus.Failed; + _ret.ErrorList.Add(ex); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_BARCODE_CONTROLLER), "GetBarcodeRule", ex.ToString()); + + if (ex.InnerException != null && ex.InnerException.GetType() == typeof(UpdateException)) + { + var inner = (UpdateException)ex.InnerException; + + + throw new ScpException(ResultCode.Exception, "0000", ex.ToString()); + } + else + { + if (ex.InnerException != null) throw ex.InnerException; + } + } + catch (Exception e) + { + _ret.State = ReturnStatus.Failed; + _ret.ErrorList.Add(e); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_BARCODE_CONTROLLER), "GetBarcodeRule", e.Message); + throw e; + } + return _ret; + } + public static string Save_TS_Asn(string ls) + { + using (ScpEntities db = EntitiesFactory.CreateScpInstance()) + { + var TT= db.TS_BARCODE.Where(p => p.UID.ToString() == ls).FirstOrDefault(); + var SS=db.TA_PART.Where(p => p.PartCode == TT.PartCode).FirstOrDefault(); + string part = SS.PartGroup; + return part; + } + } + private static ResultObject GetBarcodeRule(string partcode, string batch, int cnt = 1) { ResultObject _ret = new ResultObject(); try @@ -1027,13 +1598,13 @@ namespace CK.SCP.Controller { _ret.State = ReturnStatus.Succeed; _ret.Result = barcodeRule; - + } else { _ret.State = ReturnStatus.Failed; - - } + + } } } catch (System.Data.Entity.Validation.DbEntityValidationException dbEx)//ʵ֤쳣 @@ -1055,7 +1626,7 @@ namespace CK.SCP.Controller } catch (OptimisticConcurrencyException ex)//ͻ쳣 { - + _ret.State = ReturnStatus.Failed; _ret.ErrorList.Add(ex); LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_BARCODE_CONTROLLER), "GetBarcodeRule", ex.ToString()); @@ -1071,7 +1642,7 @@ namespace CK.SCP.Controller { var inner = (UpdateException)ex.InnerException; - + throw new ScpException(ResultCode.Exception, "0000", ex.ToString()); } else @@ -1088,7 +1659,6 @@ namespace CK.SCP.Controller } return _ret; } - private static ResultObject GetPalletsRule(string partcode, string batch, int cnt = 1) { ResultObject _ret = new ResultObject(); diff --git a/Controller/SCP_BILLCODE_CONTROLLER.cs b/Controller/SCP_BILLCODE_CONTROLLER.cs index 916e5ab..935e9aa 100644 --- a/Controller/SCP_BILLCODE_CONTROLLER.cs +++ b/Controller/SCP_BILLCODE_CONTROLLER.cs @@ -24,6 +24,36 @@ namespace CK.SCP.Controller return GetTablePK("P", "TB_PO", "PoBillNum", "yyMMdd", 4); + } + public static string MakemaxPOCode(string vendid,string time) + { + + return GetTablePK(vendid, "TB_MAXPO", "PoBillNum", time, 4); + + } + public static string MakePOCode1() + { + + return GetTablePK("CYD03", "TB_PO", "PoBillNum", "yyMM", 5); + + } + public static string MakePOCode3() + { + + return GetTablePK("FB2", "TB_PO", "PoBillNum", "yyyyMMdd", 3); + + } + public static string MakePOCode4() + { + + return GetTablePK("FB1", "TB_PO", "PoBillNum", "yyyyMMdd", 3); + + } + public static string MakePOCode2() + { + + return GetTablePK("CYD01", "TB_PO", "PoBillNum", "yyMM", 5); + } public static string MakeQualityCode() { @@ -67,6 +97,10 @@ namespace CK.SCP.Controller { return GetTablePKByNum("K", "TB_ASK", "AskBillNum", "yyMMdd", 4, num); } + public static string MakeASKCodeByNum1(int num) + { + return GetTablePKByNum("K", "TB_ASK", "AskBillNum", "yyMM",6 , num); + } public static string MakeASKCode() { diff --git a/Controller/SCP_CONTRACT_CONTROLLER.cs b/Controller/SCP_CONTRACT_CONTROLLER.cs index 2a83b29..415fe4c 100644 --- a/Controller/SCP_CONTRACT_CONTROLLER.cs +++ b/Controller/SCP_CONTRACT_CONTROLLER.cs @@ -361,7 +361,91 @@ namespace CK.SCP.Controller } return p_list; } + public static List GET_SUB_PART_LIST(List p_list) + { + + if (p_list.Count > 0) + { + + p_list.ForEach(p => + { + using (ScpEntities db = EntitiesFactory.CreateScpInstance()) + { + if (!string.IsNullOrEmpty(p.SubSite)) + { + var part = db.TA_PART.FirstOrDefault(t => t.PartCode == p.SubSite); + if (part != null) + { + p.Subpartspec = part.PartDesc2; + } + } + } + }); + + } + return p_list; + } + public static List GET_MAXPO_LIST(List p_list) + { + + if (p_list.Count > 0) + { + p_list.ForEach(p => + { + using (ScpEntities db = EntitiesFactory.CreateScpInstance()) + { + List _ls = new List(); + var _No = db.TB_MAXPO_CONSUME.Where(t => t.PartCode == p.PartCode&&t.BillNum==p.PoBillNum).ToList(); + var _Month = db.V_TB_MAXPO_CONSUME.Where(t => t.PartCode == p.PartCode && t.BillNum == p.PoBillNum).ToList(); + + foreach(var Mo in _Month) + { + if (!_ls.Contains(Mo.ContractMonth)) + { + _ls.Add(Mo.ContractMonth); + } + } + string ContactNo = string.Join(";",_ls); + p.ContractMonth = ContactNo; + foreach (var pa in _No) + { + ContactNo = ContactNo + pa.PoBillNum + ";"; + } + p.ContractNo = ContactNo.Substring(0, ContactNo.Length - 1).Trim(); + } + + + }); + + } + return p_list; + } + + public static List GET_SUB_PART_LIST_CYJ(List p_list) + { + + if (p_list.Count > 0) + { + + p_list.ForEach(p => + { + using (ScpEntities db = EntitiesFactory.CreateScpInstance()) + { + if (!string.IsNullOrEmpty(p.PartCode)) + { + var part = db.TA_PART.FirstOrDefault(t => t.PartCode == p.PartCode); + if (part != null) + { + p.Partname = part.PartDesc1; + } + } + } + }); + + } + return p_list; + } public static List GET_CONTRACT_PRICE_LIST(List p_list) { diff --git a/Controller/SCP_EXCEL_CONTROLLER.cs b/Controller/SCP_EXCEL_CONTROLLER.cs index cb77c5a..3942ec5 100644 --- a/Controller/SCP_EXCEL_CONTROLLER.cs +++ b/Controller/SCP_EXCEL_CONTROLLER.cs @@ -62,8 +62,9 @@ namespace CK.SCP.Controller po_detail.发货数 = itm.ShippedQty.ToString(); po_detail.收货数 = itm.ReceivedQty.ToString(); po_detail.退货数 = itm.RejectQty; - po_detail.到货日期 = itm.EndTime == null ? string.Empty : ((DateTime)itm.BeginTime).ToString("yyyyMMdd"); ; + po_detail.预计到货日期 = itm.EndTime.ToString(); po_detail.单位 = itm.PoUnit; + po_detail.存储地点 = itm.Extend2; _exportDetailList.Add(po_detail); }); var _list_dt = ConvertHelper.ToDataTable(_exportDetailList); @@ -71,6 +72,56 @@ namespace CK.SCP.Controller } return _ds; } + public static DataSet GET_MAXPO_EXECEL(List p_lst, bool p_IsDetail = false) + { + DataSet _ds = new DataSet(); + using (ScpEntities db = EntitiesFactory.CreateScpInstance()) + { + if (p_IsDetail == false) + { + var _ls = db.V_TB_MAXPO.Where(p => p_lst.Contains(p.PoBillNum)).ToList(); + var _exportList = new List(); + _ls.ForEach(itm => + { + SCP_MAXPODC_EXPORT _export = new SCP_MAXPODC_EXPORT(); + _export.订单编号 = itm.PoBillNum; + _export.合同月 = itm.ContractMonth; + _export.供应商编码 = itm.VendId; + _export.供应商名称 = itm.VendName; + _exportList.Add(_export); + }); + var _dt = ConvertHelper.ToDataTable(_exportList); + _ds.Tables.Add(_dt); + } + var _detailList = db.V_TB_MAXPO_DETAIL.Where(p => p_lst.Contains(p.PoBillNum)).ToList(); + var _exportDetailList = new List(); + _detailList.ForEach(itm => + { + var po_detail = new SCP_MAXPO_DETAIL_EXPORT(); + var part = db.TA_PART.FirstOrDefault(p=>p.PartCode==itm.PartCode); + po_detail.原材物料号 = itm.PartNumber; + po_detail.零件号 = itm.PartCode; + po_detail.订货件数 = itm.OrderNumber.ToString(); + po_detail.订货量吨 = itm.OrderQtyd.ToString(); + po_detail.起定量 = itm.MinordQty.ToString(); + po_detail.技术标准 = itm.TechStandard; + po_detail.材料厂家 = itm.Matermanu; + po_detail.行号 = itm.PoLine.ToString(); + po_detail.材质 = part.PartDesc2; + po_detail.车型 = itm.Model; + po_detail.预测1 = itm.forecastone; + po_detail.预测2 = itm.forecasttwo; + po_detail.预测3 = itm.forecastthree; + po_detail.预测4 = itm.forecastfour; + po_detail.预测5 = itm.forecastfive; + po_detail.预测6 = itm.forecastsix; + _exportDetailList.Add(po_detail); + }); + var _list_dt = ConvertHelper.ToDataTable(_exportDetailList); + _ds.Tables.Add(_list_dt); + } + return _ds; + } public static DataSet GET_OTD_VendId_REPORT_EXECEL(List p_lst) { DataSet _ds = new DataSet(); @@ -239,7 +290,7 @@ namespace CK.SCP.Controller } return _ds; - } + } public static DataSet GET_ASN_EXECEL(List p_lst) { DataSet _ds = new DataSet(); @@ -342,7 +393,9 @@ namespace CK.SCP.Controller //_entity.折扣价格 = itm.DiscountPrice.ToString(); //_entity.折扣备注 = itm.DiscountRemark; _entity.开票数量 = itm.Qty.ToString(); - _entity.备注 = itm.Remark; + _entity.备注 = itm.Remark; + _entity.发票金额 = itm.Extend1 =( itm.Price*itm.Qty).ToString(); + _entity.订单金额 = itm.Extend2 = (itm.PurCost * itm.Qty).ToString(); _exportDetailList.Add(_entity); }); var _list_dt = ConvertHelper.ToDataTable(_exportDetailList); diff --git a/Controller/SCP_INVOICE_CONTROLLER.cs b/Controller/SCP_INVOICE_CONTROLLER.cs index ad98597..059a4e1 100644 --- a/Controller/SCP_INVOICE_CONTROLLER.cs +++ b/Controller/SCP_INVOICE_CONTROLLER.cs @@ -336,7 +336,343 @@ namespace CK.SCP.Controller throw e; } } + public static void Get_V_TB_INVOICE_List1(V_TB_REEEE p_entity, Action>> p_action) + { + ResultObject> _ret = new ResultObject>(); + try + { + using (ScpEntities db = EntitiesFactory.CreateScpInstance()) + { + IQueryable q = db.V_TB_REEEE; + if (!string.IsNullOrEmpty(p_entity.PoBillNum)) + { + q = q.Where(p => p.PoBillNum == p_entity.PoBillNum); + } + if (!string.IsNullOrEmpty(p_entity.VendId)) + { + q = q.Where(p => p.VendId == p_entity.VendId); + } + if (!string.IsNullOrEmpty(p_entity.VendName)) + { + q = q.Where(p => p.VendName.Contains(p_entity.VendName)); + } + if (!string.IsNullOrEmpty(p_entity.PartCode)) + { + q = q.Where(p => p.PartCode.Contains(p_entity.PartCode)); + } + if (!string.IsNullOrEmpty(p_entity.PartDesc2)) + { + q = q.Where(p => p.PartDesc2.Contains(p_entity.PartDesc2)); + } + if (!string.IsNullOrEmpty(p_entity.PartGroup)) + { + q = q.Where(p => p.PartGroup.Contains(p_entity.PartGroup)); + } + if (!string.IsNullOrEmpty(p_entity.CreateUser)) + { + q = q.Where(p => p.CreateUser.Contains(p_entity.CreateUser)); + } + if (!string.IsNullOrEmpty(p_entity.DockCode)) + { + q = q.Where(p => p.DockCode.Contains(p_entity.DockCode)); + } + if (!string.IsNullOrEmpty(p_entity.Buyer)) + { + q = q.Where(p => p.Buyer.Contains(p_entity.Buyer)); + } + if (!string.IsNullOrEmpty(p_entity.Describe)) + { + q = q.Where(p => p.Describe.Contains(p_entity.Describe)); + } + if (p_entity.ReceiveTimeBegin != null) + { + + q = q.Where(p => p.CreateTime >= p_entity.ReceiveTimeBegin); + } + + if (p_entity.ReceiveTimeEnd != null) + { + q = q.Where(p => p.CreateTime <= p_entity.ReceiveTimeEnd); + + + } + if (p_entity.Qty != 0) + { + q = q.Where(p => p.Qty == p_entity.Qty); + } + _ret.State = ReturnStatus.Succeed; + _ret.Result = q; + p_action(_ret); + } + } + catch (System.Data.Entity.Validation.DbEntityValidationException dbEx)//捕获实体验证异常 + { + var sb = new StringBuilder(); + + foreach (var error in dbEx.EntityValidationErrors.ToList()) + { + + error.ValidationErrors.ToList().ForEach(i => + { + sb.AppendFormat("表:{0},字段:{1},信息:{2}\r\n", error.Entry.Entity.GetType().Name, i.PropertyName, i.ErrorMessage); + }); + } + _ret.State = ReturnStatus.Failed; + _ret.ErrorList.Add(dbEx); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_INVOICE_CONTROLLER), "Get_V_TB_INVOICE_List", sb.ToString()); + throw new ScpException(ResultCode.DbEntityValidationException, sb.ToString(), "字段验证失败" + sb.ToString()); + } + catch (OptimisticConcurrencyException ex)//并发冲突异常 + { + + _ret.State = ReturnStatus.Failed; + _ret.ErrorList.Add(ex); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_INVOICE_CONTROLLER), "Get_V_TB_INVOICE_List", ex.ToString()); + throw new ScpException(ResultCode.Exception, "9999", ex.ToString()); + } + catch (ScpException ex) + { + + + _ret.State = ReturnStatus.Failed; + _ret.ErrorList.Add(ex); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_INVOICE_CONTROLLER), "Get_V_TB_INVOICE_List", ex.ToString()); + + if (ex.InnerException != null && ex.InnerException.GetType() == typeof(UpdateException)) + { + var inner = (UpdateException)ex.InnerException; + + + throw new ScpException(ResultCode.Exception, "0000", ex.ToString()); + } + else + { + if (ex.InnerException != null) throw ex.InnerException; + } + } + catch (Exception e) + { + _ret.State = ReturnStatus.Failed; + _ret.ErrorList.Add(e); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_INVOICE_CONTROLLER), "Get_V_TB_INVOICE_List", e.Message); + throw e; + } + } + public static void Get_V_TB_INVOICE_List_APPLIANCE(V_TA_APPLIANCE p_entity, Action>> p_action) + { + ResultObject> _ret = new ResultObject>(); + try + { + using (ScpEntities db = EntitiesFactory.CreateScpInstance()) + { + IQueryable q = db.V_TA_APPLIANCE; + if (!string.IsNullOrEmpty(p_entity.PartNumber)) + { + q = q.Where(p => p.PartNumber == p_entity.PartNumber); + } + if (!string.IsNullOrEmpty(p_entity.VendID)) + { + q = q.Where(p => p.VendID == p_entity.VendID); + } + _ret.State = ReturnStatus.Succeed; + _ret.Result = q; + p_action(_ret); + } + } + catch (System.Data.Entity.Validation.DbEntityValidationException dbEx)//捕获实体验证异常 + { + var sb = new StringBuilder(); + + foreach (var error in dbEx.EntityValidationErrors.ToList()) + { + + error.ValidationErrors.ToList().ForEach(i => + { + sb.AppendFormat("表:{0},字段:{1},信息:{2}\r\n", error.Entry.Entity.GetType().Name, i.PropertyName, i.ErrorMessage); + }); + } + _ret.State = ReturnStatus.Failed; + _ret.ErrorList.Add(dbEx); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_INVOICE_CONTROLLER), "Get_V_TB_INVOICE_List", sb.ToString()); + throw new ScpException(ResultCode.DbEntityValidationException, sb.ToString(), "字段验证失败" + sb.ToString()); + } + catch (OptimisticConcurrencyException ex)//并发冲突异常 + { + + _ret.State = ReturnStatus.Failed; + _ret.ErrorList.Add(ex); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_INVOICE_CONTROLLER), "Get_V_TB_INVOICE_List", ex.ToString()); + throw new ScpException(ResultCode.Exception, "9999", ex.ToString()); + } + catch (ScpException ex) + { + + + _ret.State = ReturnStatus.Failed; + _ret.ErrorList.Add(ex); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_INVOICE_CONTROLLER), "Get_V_TB_INVOICE_List", ex.ToString()); + + if (ex.InnerException != null && ex.InnerException.GetType() == typeof(UpdateException)) + { + var inner = (UpdateException)ex.InnerException; + + + throw new ScpException(ResultCode.Exception, "0000", ex.ToString()); + } + else + { + if (ex.InnerException != null) throw ex.InnerException; + } + } + catch (Exception e) + { + _ret.State = ReturnStatus.Failed; + _ret.ErrorList.Add(e); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_INVOICE_CONTROLLER), "Get_V_TB_INVOICE_List", e.Message); + throw e; + } + } + public static void Get_TA_SubPartCode(V_TA_SubPartCode p_entity, Action>> p_action) + { + ResultObject> _ret = new ResultObject>(); + try + { + using (ScpEntities db = EntitiesFactory.CreateScpInstance()) + { + IQueryable q = db.V_TA_SubPartCode; + if (p_entity.PartList != null && p_entity.PartList.Count > 0) + { + q = q.Where(p => p_entity.PartList.Contains(p.PartCode)); + } + _ret.State = ReturnStatus.Succeed; + _ret.Result = q; + p_action(_ret); + } + } + catch (System.Data.Entity.Validation.DbEntityValidationException dbEx)//捕获实体验证异常 + { + var sb = new StringBuilder(); + + foreach (var error in dbEx.EntityValidationErrors.ToList()) + { + + error.ValidationErrors.ToList().ForEach(i => + { + sb.AppendFormat("表:{0},字段:{1},信息:{2}\r\n", error.Entry.Entity.GetType().Name, i.PropertyName, i.ErrorMessage); + }); + } + _ret.State = ReturnStatus.Failed; + _ret.ErrorList.Add(dbEx); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_INVOICE_CONTROLLER), "Get_V_TB_INVOICE_List", sb.ToString()); + throw new ScpException(ResultCode.DbEntityValidationException, sb.ToString(), "字段验证失败" + sb.ToString()); + } + catch (OptimisticConcurrencyException ex)//并发冲突异常 + { + + _ret.State = ReturnStatus.Failed; + _ret.ErrorList.Add(ex); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_INVOICE_CONTROLLER), "Get_V_TB_INVOICE_List", ex.ToString()); + throw new ScpException(ResultCode.Exception, "9999", ex.ToString()); + } + catch (ScpException ex) + { + + + _ret.State = ReturnStatus.Failed; + _ret.ErrorList.Add(ex); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_INVOICE_CONTROLLER), "Get_V_TB_INVOICE_List", ex.ToString()); + + if (ex.InnerException != null && ex.InnerException.GetType() == typeof(UpdateException)) + { + var inner = (UpdateException)ex.InnerException; + + + throw new ScpException(ResultCode.Exception, "0000", ex.ToString()); + } + else + { + if (ex.InnerException != null) throw ex.InnerException; + } + } + catch (Exception e) + { + _ret.State = ReturnStatus.Failed; + _ret.ErrorList.Add(e); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_INVOICE_CONTROLLER), "Get_V_TB_INVOICE_List", e.Message); + throw e; + } + } + public static void Get_TA_RECEING(TA_Receiving_Information p_entity, Action>> p_action) + { + ResultObject> _ret = new ResultObject>(); + try + { + using (ScpEntities db = EntitiesFactory.CreateScpInstance()) + { + IQueryable q = db.TA_Receiving_Information; + + if (!string.IsNullOrEmpty(p_entity.Shift)) + { + q = q.Where(p => p.Shift == p_entity.Shift); + } + _ret.State = ReturnStatus.Succeed; + _ret.Result = q; + p_action(_ret); + } + } + catch (System.Data.Entity.Validation.DbEntityValidationException dbEx)//捕获实体验证异常 + { + var sb = new StringBuilder(); + + foreach (var error in dbEx.EntityValidationErrors.ToList()) + { + error.ValidationErrors.ToList().ForEach(i => + { + sb.AppendFormat("表:{0},字段:{1},信息:{2}\r\n", error.Entry.Entity.GetType().Name, i.PropertyName, i.ErrorMessage); + }); + } + _ret.State = ReturnStatus.Failed; + _ret.ErrorList.Add(dbEx); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_INVOICE_CONTROLLER), "Get_V_TB_INVOICE_List", sb.ToString()); + throw new ScpException(ResultCode.DbEntityValidationException, sb.ToString(), "字段验证失败" + sb.ToString()); + } + catch (OptimisticConcurrencyException ex)//并发冲突异常 + { + + _ret.State = ReturnStatus.Failed; + _ret.ErrorList.Add(ex); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_INVOICE_CONTROLLER), "Get_V_TB_INVOICE_List", ex.ToString()); + throw new ScpException(ResultCode.Exception, "9999", ex.ToString()); + } + catch (ScpException ex) + { + + + _ret.State = ReturnStatus.Failed; + _ret.ErrorList.Add(ex); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_INVOICE_CONTROLLER), "Get_V_TB_INVOICE_List", ex.ToString()); + + if (ex.InnerException != null && ex.InnerException.GetType() == typeof(UpdateException)) + { + var inner = (UpdateException)ex.InnerException; + + + throw new ScpException(ResultCode.Exception, "0000", ex.ToString()); + } + else + { + if (ex.InnerException != null) throw ex.InnerException; + } + } + catch (Exception e) + { + _ret.State = ReturnStatus.Failed; + _ret.ErrorList.Add(e); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_INVOICE_CONTROLLER), "Get_V_TB_INVOICE_List", e.Message); + throw e; + } + } public static void Get_V_TB_INVOICE_ERP_List(V_TB_INVOICE p_entity, Action>> p_action) { ResultObject> _ret = new ResultObject>(); diff --git a/Controller/SCP_PALLET_CONTROLLER.cs b/Controller/SCP_PALLET_CONTROLLER.cs index 37ccd14..4571a60 100644 --- a/Controller/SCP_PALLET_CONTROLLER.cs +++ b/Controller/SCP_PALLET_CONTROLLER.cs @@ -175,6 +175,87 @@ namespace CK.SCP.Controller } } + public static void Get_TB_PALLETS_BTL_List(TB_PALLETS_BTL p_entity, Action>> p_action) + { + ResultObject> _ret = new ResultObject>(); + try + { + using (ScpEntities db = EntitiesFactory.CreateScpInstance()) + { + IQueryable q = db.TB_PALLETS_BTL; + if (p_entity.UID != 0) + { + q = q.Where(p => p.UID == p_entity.UID); + } + if (p_entity.UIDList != null && p_entity.UIDList.Count > 0) + { + q = q.Where(p => p_entity.UIDList.Contains(p.UID)); + } + if (!string.IsNullOrEmpty(p_entity.AsnBillNum)) + { + q = q.Where(p => p.AsnBillNum.Contains(p_entity.AsnBillNum)); + } + if (!string.IsNullOrEmpty(p_entity.VendId)) + { + q = q.Where(p => p.VendId.Contains(p_entity.VendId)); + } + if (!string.IsNullOrEmpty(p_entity.PartCode)) + { + q = q.Where(p => p.PartCode.Contains(p_entity.PartCode)); + } + q = q.Where(p => p.IsDeleted == p_entity.IsDeleted); + _ret.State = ReturnStatus.Succeed; + _ret.Result = q; + p_action(_ret); + } + } + catch (System.Data.Entity.Validation.DbEntityValidationException dbEx)//捕获实体验证异常 + { + var sb = new StringBuilder(); + + foreach (var error in dbEx.EntityValidationErrors.ToList()) + { + + error.ValidationErrors.ToList().ForEach(i => + { + sb.AppendFormat("表:{0},字段:{1},信息:{2}\r\n", error.Entry.Entity.GetType().Name, i.PropertyName, i.ErrorMessage); + }); + } + _ret.State = ReturnStatus.Failed; + _ret.ErrorList.Add(dbEx); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_INVOICE_CONTROLLER), "Get_TB_PALLETS_List", sb.ToString()); + throw new ScpException(ResultCode.DbEntityValidationException, sb.ToString(), "字段验证失败" + sb.ToString()); + } + catch (OptimisticConcurrencyException ex)//并发冲突异常 + { + _ret.State = ReturnStatus.Failed; + _ret.ErrorList.Add(ex); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_INVOICE_CONTROLLER), "Get_TB_PALLETS_List", ex.ToString()); + throw new ScpException(ResultCode.Exception, "9999", ex.ToString()); + } + catch (ScpException ex) + { + _ret.State = ReturnStatus.Failed; + _ret.ErrorList.Add(ex); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_INVOICE_CONTROLLER), "Get_TB_PALLETS_List", ex.ToString()); + if (ex.InnerException != null && ex.InnerException.GetType() == typeof(UpdateException)) + { + var inner = (UpdateException)ex.InnerException; + throw new ScpException(ResultCode.Exception, "0000", ex.ToString()); + } + else + { + if (ex.InnerException != null) throw ex.InnerException; + } + } + catch (Exception e) + { + _ret.State = ReturnStatus.Failed; + _ret.ErrorList.Add(e); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_INVOICE_CONTROLLER), "Get_TB_PALLETS_List", e.Message); + throw e; + } + } public static void Get_TB_PALLETS_List(TB_PALLETS p_entity, Action>> p_action) { ResultObject> _ret = new ResultObject>(); diff --git a/Controller/SCP_PO_CONTROLLER.cs b/Controller/SCP_PO_CONTROLLER.cs index f863109..428ccfd 100644 --- a/Controller/SCP_PO_CONTROLLER.cs +++ b/Controller/SCP_PO_CONTROLLER.cs @@ -13,6 +13,9 @@ using System.Data.Entity.Core; using CK.SCP.Models.ScpEntity.ExcelExportEnttity; using System.Text.RegularExpressions; using System.Threading; +using System.Data; +using Newtonsoft.Json; +using CK.SCP.Models.UniApiEntity; namespace CK.SCP.Controller { @@ -37,7 +40,7 @@ namespace CK.SCP.Controller } if (!string.IsNullOrEmpty(p_entity.ErpBillNum)) { - q = q.Where(p => p.ErpBillNum==p_entity.ErpBillNum); + q = q.Where(p => p.ErpBillNum == p_entity.ErpBillNum); } if (!string.IsNullOrEmpty(p_entity.VendId)) { @@ -94,7 +97,11 @@ namespace CK.SCP.Controller } if (p_entity.EndTime != null) { - q = q.Where(p => p.EndTime <= p_entity.EndTime); + q = q.Where(p => p.EndTime >= p_entity.EndTime); + } + if (p_entity.EndTime_End != null) + { + q = q.Where(p => p.EndTime <= p_entity.EndTime_End); } if (p_entity.UserInAddress != null && p_entity.UserInAddress.Count > 0) { @@ -104,7 +111,7 @@ namespace CK.SCP.Controller { q = q.Where(p => p_entity.UserInVendIds.Contains(p.VendId)); } - + if (!string.IsNullOrEmpty(p_entity.SubSite)) { q = q.Where(p => p.SubSite.Contains(p_entity.SubSite)); @@ -121,23 +128,26 @@ namespace CK.SCP.Controller { q = q.Where(p => p.Extend3.Contains(p_entity.Extend3)); } - - //if (!string.IsNullOrEmpty(p_entity.PartCode)) - //{ - // var _po = db.TB_PO_DETAIL.Where(p => p.PartCode == p_entity.PartCode && p.IsDeleted== false); - // if (_po.Count() > 0) - // { - // List _list = new List(); - // _po.ToList().ForEach(itm => - // { - // _list.Add(itm.PoBillNum); - // }); - // if (_list.Count() > 0) - // { - // q = q.Where(p => _list.Contains(p.PoBillNum)); - // } - // } - //} + if (p_entity.MaxpoList != null && p_entity.MaxpoList.Count > 0) + { + q = q.Where(p => p_entity.MaxpoList.Contains(p.PoBillNum)); + } + if (!string.IsNullOrEmpty(p_entity.PartCode)) + { + var _po = db.TB_PO_DETAIL.Where(p => p.PartCode == p_entity.PartCode ); + if (_po.Count() > 0) + { + List _list = new List(); + _po.ToList().ForEach(itm => + { + _list.Add(itm.PoBillNum); + }); + if (_list.Count() > 0) + { + q = q.Where(p => _list.Contains(p.PoBillNum)); + } + } + } _ret.State = ReturnStatus.Succeed; _ret.Result = q; p_action(_ret); @@ -191,8 +201,7 @@ namespace CK.SCP.Controller throw e; } } - - + public static List LOAD_ASK_DETAIL_SUM(List p_list) { using (ScpEntities db = EntitiesFactory.CreateScpInstance()) @@ -216,8 +225,153 @@ namespace CK.SCP.Controller } return p_list; } + public static ResultObject Save_TB_MAXPO_DETAIL_QTY(List p_entitys) + { + ResultObject _ret = new ResultObject(); + try + { + using (ScpEntities db = EntitiesFactory.CreateScpInstance()) + { + + foreach (var itm in p_entitys) + { + var _entity = db.TB_MAXPO_DETAIL.Where(p => p.UID == itm.UID).FirstOrDefault(); + if(itm.OrderQtykg <_entity.OrderQtykg- _entity.AsnQty) + { + _ret.MessageList.Add("零件号"+_entity.PartCode+"剩余可消耗订货量不足!"); + } + if( itm.OrderQtykg == 0) + { + _ret.MessageList.Add("订货量不能修改为0!"); + } + else + { + _entity.SurplusQty = itm.OrderQtykg - _entity.OrderQtykg + _entity.SurplusQty; + _entity.AsnQty=itm.OrderQtykg - _entity.OrderQtykg + _entity.AsnQty; + _entity.OrderQtykg = itm.OrderQtykg; + _entity.OrderQtyd = itm.OrderQtykg / 1000; + db.TB_MAXPO_DETAIL.AddOrUpdate(p => p.UID, _entity); + TS_UNI_API maxuni = new TS_UNI_API(); + maxuni.BillNum = _entity.PoBillNum; + maxuni.InterfaceType = "MaxPobillnum"; + maxuni.TableName = "TS_UNI_API"; + maxuni.BillType = 701; + maxuni.SubBillType = 0; + maxuni.PartCode = _entity.PartCode; + maxuni.VendId = _entity.VendId;//供应商编号 + if (string.IsNullOrEmpty(_entity.Texture)) + { + maxuni.Batch = ""; + } + else + { + maxuni.Batch = _entity.Texture;//材质 + } + maxuni.Qty = _entity.OrderNumber; + maxuni.State = 1; + maxuni.CreateOper = _entity.CreateUser;//创建者 + maxuni.CreateTime =DateTime.Now; + maxuni.PutTime = DateTime.Now; + maxuni.Extend1 = _entity.PartNumber; + maxuni.PackQty = _entity.MinordQty; + maxuni.Price = _entity.OrderQtyd; + maxuni.VendBatch = _entity.ContractMonth;//合同月 + maxuni.Currency = _entity.Model; + maxuni.Buyer = _entity.TechStandard; + maxuni.BuyerPhone =_entity.Finprspec;//规格 + maxuni.Tax = 0; + maxuni.PoUnit = _entity.forecastone;//预测1 + maxuni.LocUnit = _entity.forecasttwo;//预测2 + maxuni.Attn =_entity.forecastthree;//预测3 + maxuni.Receiver = _entity.forecastfour;//预测4 + maxuni.ModType = _entity.forecastfive;//预测5 + maxuni.SubSite = _entity.forecastsix;//预测6 + maxuni.Site = _entity.Site; + maxuni.Extend2 = _entity.Matermanu; + maxuni.TaxAmt = _entity.Singlecon;//单件消耗 + maxuni.ValidDate = DateTime.Now; + maxuni.ErpLineNum = _entity.PoLine; + maxuni.Domain = _entity.Site; + maxuni.Extend3 = "U"; + db.TS_UNI_API.AddOrUpdate(maxuni); + } + + + } + if (_ret.MessageList.Count == 0) + { + int state = db.SaveChanges(); + if (state != -1) + { + _ret.State = ReturnStatus.Succeed; + _ret.Result = true; + } + else + { + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + } + } + else + { + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + } + + } + } + catch (System.Data.Entity.Validation.DbEntityValidationException dbEx)//捕获实体验证异常 + { + var sb = new StringBuilder(); + foreach (var error in dbEx.EntityValidationErrors.ToList()) + { + error.ValidationErrors.ToList().ForEach(i => + { + sb.AppendFormat("表:{0},字段:{1},信息:{2}\r\n", error.Entry.Entity.GetType().Name, i.PropertyName, i.ErrorMessage); + }); + } + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + _ret.ErrorList.Add(dbEx); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_ASK_CONTROLLER), "Save_TB_ASK_DETAIL_LIER", sb.ToString()); + throw new ScpException(ResultCode.DbEntityValidationException, sb.ToString(), "字段验证失败" + sb.ToString()); + } + catch (OptimisticConcurrencyException ex)//并发冲突异常 + { + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + _ret.ErrorList.Add(ex); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_ASK_CONTROLLER), "Save_TB_ASK_DETAIL_LIER", ex.ToString()); + throw new ScpException(ResultCode.Exception, "9999", ex.ToString()); + } + catch (ScpException ex) + { + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + _ret.ErrorList.Add(ex); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_ASK_CONTROLLER), "Save_TB_ASK_DETAIL_LIER", ex.ToString()); + if (ex.InnerException != null && ex.InnerException.GetType() == typeof(UpdateException)) + { + var inner = (UpdateException)ex.InnerException; + throw new ScpException(ResultCode.Exception, "0000", ex.ToString()); + } + else + { + if (ex.InnerException != null) throw ex.InnerException; + } + } + catch (Exception e) + { + _ret.State = ReturnStatus.Failed; + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_ASK_CONTROLLER), "Save_TB_ASK_DETAIL_LIER", e.Message); + _ret.Result = false; + _ret.ErrorList.Add(e); + throw e; + } + return _ret; + } public static List LOAD_PO_DETAIL_SUM(List p_list) { using (ScpEntities db = EntitiesFactory.CreateScpInstance()) @@ -229,7 +383,7 @@ namespace CK.SCP.Controller { var _ask = db.TB_ASK_DETAIL.Where(p => p.PoBillNum == _detail.PoBillNum && p.IsDeleted == false).GroupBy(p => new { p.PoBillNum, p.PoLine, p.PartCode }).Select(p => new { AskSum = p.Sum(itm => itm.AskQty), PoLine = p.Key.PoLine, PoBillNum = p.Key.PoBillNum, PartCode = p.Key.PartCode }); - var rec = db.TB_RECEIVE_DETAIL.Where(p => p.PoBillNum == _detail.PoBillNum && p.IsDeleted == false && p.State == (int)ReceiveState.Check && p.BillType == 0 ) + var rec = db.TB_RECEIVE_DETAIL.Where(p => p.PoBillNum == _detail.PoBillNum && p.IsDeleted == false && p.State == (int)ReceiveState.Check && p.BillType == 0) .GroupBy(p => new { p.PoBillNum, p.PoLine, p.PartCode }).Select(p => new { ReceiveSum = p.Sum(itm => itm.Qty), PoLine = p.Key.PoLine, PoBillNum = p.Key.PoBillNum, PartCode = p.Key.PartCode }); var reject = db.TB_RECEIVE_DETAIL.Where(p => p.PoBillNum == _detail.PoBillNum && p.IsDeleted == false && p.State == (int)RejectState.Check && p.BillType == 1).GroupBy(p => new { p.PoBillNum, p.PoLine, p.PartCode }).Select(p => new { RejectSum = p.Sum(itm => itm.Qty), PoLine = p.Key.PoLine, PoBillNum = p.Key.PoBillNum, PartCode = p.Key.PartCode }); @@ -245,7 +399,7 @@ namespace CK.SCP.Controller if (_detail.PoBillNum == itm.PoBillNum && _detail.PoLine == itm.PoLine && _detail.PartCode == itm.PartCode) { _detail.ReceivedQty = itm.ReceiveSum; - + } }); @@ -492,7 +646,27 @@ namespace CK.SCP.Controller return _ret; } - + public static List GetPoDetailList(List p_lst) + { + using (ScpEntities db = EntitiesFactory.CreateScpInstance()) + { + return db.V_TB_PO_DETAIL.Where(p => p_lst.Contains(p.PoBillNum)).ToList(); + } + } + public static List GetMaxpoConsume(string maxpobillnum) + { + using (ScpEntities db = EntitiesFactory.CreateScpInstance()) + { + return db.TB_MAXPO_CONSUME.Where(p => p.PoBillNum == maxpobillnum).ToList(); + } + } + public static List GetMaxPoDetailList(List p_lst) + { + using (ScpEntities db = EntitiesFactory.CreateScpInstance()) + { + return db.V_TB_MAXPO_DETAIL.Where(p => p_lst.Contains(p.PoBillNum)).ToList(); + } + } public static ResultObject Save_TB_PO(List p_entitys) { ResultObject _ret = new ResultObject(); @@ -547,7 +721,7 @@ namespace CK.SCP.Controller { - _ret.State = ReturnStatus.Failed; + _ret.State = ReturnStatus.Failed; _ret.Result = false; _ret.ErrorList.Add(ex); LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "Save_TB_PO", ex.ToString()); @@ -608,7 +782,7 @@ namespace CK.SCP.Controller } - var _list = db.TB_PO_DETAIL.Where(p => p.PoBillNum == p_excel.QAD订单号 && p.PartCode == p_excel.零件号).ToList(); + var _list = db.TB_PO_DETAIL.Where(p => p.PoBillNum == p_excel.QAD订单号 && p.PartCode == p_excel.零件号).ToList(); if ( string.IsNullOrEmpty(p_excel.分组编号) || string.IsNullOrEmpty(p_excel.QAD订单号) || @@ -627,7 +801,7 @@ namespace CK.SCP.Controller else { p_excel.行号 = _list[0].PoLine.ToString(); - p_excel.价格= _list[0].Price.ToString(); + p_excel.价格 = _list[0].Price.ToString(); p_excel.单位 = _list[0].PoUnit.ToString(); p_excel.币种 = _list[0].Currency.ToString(); } @@ -635,6 +809,26 @@ namespace CK.SCP.Controller return ErrorList; } + private static List CheckExce2(ScpEntities db, string lt) + { + List ErrorList = new List(); + var _asn = db.TB_ASN_DETAIL.Count(p => p.PoBillNum ==lt); + if (_asn> 0) + { + ErrorList.Add(string.Format("订单【{0}】已经生成发货单了,不能作废", lt)); + } + return ErrorList; + } + private static List CheckExce3(ScpEntities db, string lt) + { + List ErrorList = new List(); + var _asn = db.TB_ASK.SingleOrDefault(p => p.AskBillNum == lt); + if (_asn.State > 0) + { + ErrorList.Add(string.Format("看板【{0}】不是新建状态,不能删除", lt)); + } + return ErrorList; + } public static ResultObject Save_EXCEL_PO_MOD(List p_order_list, string site, string p_creator, DateTime p_time, BillModType p_modtype, string subsite, string p_chineseName, string p_buyerPhone) { ResultObject _ret = new ResultObject(); @@ -688,7 +882,7 @@ namespace CK.SCP.Controller _PO_Detail.LocUnit = itm.单位; _PO_Detail.PoUnit = itm.单位; _PO_Detail.UnConv = 1; - _PO_Detail.Price = string.IsNullOrEmpty(itm.单价) ? 0 : decimal.Parse(itm.单价); + _PO_Detail.Price = string.IsNullOrEmpty(itm.单价) ? 0 : decimal.Parse(itm.单价); db.TB_PO_DETAIL.AddOrUpdate(_PO_Detail); }); _polist = _polist + _po.PoBillNum + ","; @@ -884,7 +1078,7 @@ namespace CK.SCP.Controller return _ret; } - public static ResultObject Save_EXCEL_PO_MOD1(List p_order_list, string site, string p_creator, DateTime p_time, string subsite, string p_chineseName, string p_buyerPhone,string CreateTime,string EN,string EndTime,string PartCode,string PoBillNum,string Remark, string Time,string VendId,string PoUnit) + public static ResultObject Save_EXCEL_PO_MOD1(List p_order_list, string site, string p_creator, DateTime p_time, string subsite, string p_chineseName, string p_buyerPhone, string CreateTime, string EN, string EndTime, string PartCode, string PoBillNum, string Remark, string Time, string VendId, string PoUnit) { ResultObject _ret = new ResultObject(); try @@ -899,7 +1093,7 @@ namespace CK.SCP.Controller OrderList.ForEach((p) => { var list = p.ToList(); - if (list.Count>0) + if (list.Count > 0) { TB_PO _po = new TB_PO(); _po.GUID = Guid.NewGuid(); @@ -1023,7 +1217,7 @@ namespace CK.SCP.Controller _ret.Result = false; } } - } + } catch (System.Data.Entity.Validation.DbEntityValidationException dbEx)//捕获实体验证异常 { var sb = new StringBuilder(); @@ -1272,7 +1466,7 @@ namespace CK.SCP.Controller { ErrorList.Add(string.Format("订单编号【{0}】行号【{1}】已经存在,请更换行号!", p_excel.订单编号, p_excel.行号)); } - var checkcount = db.TB_PRICE.Where(p => p.PartCode == p_excel.零件号 && p.Site == site && p.VendId == p_excel.供应商编号 && p.StartTime <= DateTime.Now && DateTime.Now <= p.EndTime).ToList(); + var checkcount = db.TB_PRICE.Where(p => p.PartCode == p_excel.零件号 && p.Site == site && p.VendId == p_excel.供应商编号 && p.StartTime <= DateTime.Now && DateTime.Now <= p.EndTime).ToList(); if (checkcount.Count == 0) { ErrorList.Add(string.Format("零件名称【{0}】供应编码【{1}】价格表没有维护信息!", p_excel.零件号, p_excel.供应商编号)); @@ -1378,7 +1572,7 @@ namespace CK.SCP.Controller var ls = db.TA_VENDER.SingleOrDefault(p => p.VendId == p_excel.供应商编号); if (ls == null) { - ErrorList.Add(string.Format("订单编号【{1}】零件名称【{0}】的供应商编号不存在", p_excel.零件号, p_excel.订单编号)); + ErrorList.Add(string.Format("订单编号【{1}】零件名称【{0}】的供应商编号不存在", p_excel.零件号, p_excel.订单编号)); } decimal a = decimal.Parse(p_excel.数量); if (a <= 0) @@ -1426,7 +1620,7 @@ namespace CK.SCP.Controller else { ErrorList.Add(string.Format("订单编号【{2}】零件名称【{0}】供应编码【{1}】的订单创建日期或要求到货日期要求为文本格式!", p_excel.零件号, p_excel.供应商编号, p_excel.订单编号)); - } + } if (!string.IsNullOrEmpty(p_excel.订单类型)) { if (p_excel.订单类型.ToUpper() != "S" && p_excel.订单类型.ToUpper() != "M") @@ -1547,13 +1741,153 @@ namespace CK.SCP.Controller if ( string.IsNullOrEmpty(p_excel.供应商代码) || string.IsNullOrEmpty(p_excel.零件号) || - string.IsNullOrEmpty(p_excel.标包数)||string.IsNullOrEmpty(p_excel.小包装数)||string.IsNullOrEmpty(p_excel.托盘包装数)) + string.IsNullOrEmpty(p_excel.标包数) || string.IsNullOrEmpty(p_excel.小包装数) || string.IsNullOrEmpty(p_excel.托盘包装数)) { ErrorList.Add(string.Format("供应商代码【{0}】零件编号【{1}】有填写为空!", p_excel.供应商代码, p_excel.零件号)); } return ErrorList; } /// + /// 供应商零件导入验证 + /// + /// + /// + /// + private static List CheckExcelMode_VenderPart1(ScpEntities db, SCP_VENDER_PART_EXPORT p_excel, string site) + { + List ErrorList = new List(); + //if (!string.IsNullOrEmpty(p_excel.零件号)) + //{ + // //int count = db.TA_PART.Count(p => p.PartCode == p_excel.零件号); + // //if (count <= 0) + // //{ + // // ErrorList.Add(string.Format("零件编号【{0}】不存在!", p_excel.零件号)); + // //} + // int count1 = db.TA_Appliance.Count(p => p.PartCode == p_excel.零件号 && p.Appliancenumber==p_excel.器具型号/*&&p.Model==p_excel.车型*/); + // if (count1 > 0) + // { + // ErrorList.Add(string.Format("零件编号【{0}】已存在!", p_excel.零件号)); + // } + //} + if ( + string.IsNullOrEmpty(p_excel.零件号码)|| + string.IsNullOrEmpty(p_excel.收货口)|| + string.IsNullOrEmpty(p_excel.供应商代码)|| + string.IsNullOrEmpty(p_excel.标包数) + ) + { + ErrorList.Add(string.Format("零件号码【{0}】有填写为空!", p_excel.零件号码)); + } + return ErrorList; + } + + /// + /// 供应商零件导入验证 + /// + /// + /// + /// + private static List CheckExcelMode_CousmterPart1(ScpEntities db, SCP_VENDER_PART_EXPORT p_excel, string site) + { + List ErrorList = new List(); + if (!string.IsNullOrEmpty(p_excel.零件号)) + { + int count = db.TA_PART.Count(p => p.PartCode == p_excel.零件号); + if (count <= 0) + { + ErrorList.Add(string.Format("零件号【{0}】不存在!", p_excel.零件号)); + } + } + + if ( + string.IsNullOrEmpty(p_excel.零件号) || + string.IsNullOrEmpty(p_excel.客户零件号) + ) + { + ErrorList.Add(string.Format("零件号【{0}】有填写为空!", p_excel.零件号)); + } + return ErrorList; + } + + + /// + /// 本特勒收货信息导入验证 + /// + /// + /// + /// + private static List CheckExcelMode_Receiving(ScpEntities db, SCP_VENDER_PART_EXPORT p_excel, string site) + { + List ErrorList = new List(); + if(p_excel.班次!="白班"&& p_excel.班次 != "夜班") + { + ErrorList.Add(string.Format("班次【{0}】填写不对,班次只能为白班或者夜班!", p_excel.班次)); + } + if ( + string.IsNullOrEmpty(p_excel.班次) || + string.IsNullOrEmpty(p_excel.收货人) || + string.IsNullOrEmpty(p_excel.收货人电话) + + ) + { + ErrorList.Add(string.Format("班次【{0}】有填写为空!", p_excel.班次)); + } + return ErrorList; + } + private static List CheckExcelMode_PurchasingGroup(ScpEntities db, SCP_VENDER_PART_EXPORT p_excel, string site) + { + List ErrorList = new List(); + + if ( + string.IsNullOrEmpty(p_excel.采购组) || + string.IsNullOrEmpty(p_excel.中文名称) || + string.IsNullOrEmpty(p_excel.描述) + ) + { + ErrorList.Add(string.Format("采购组【{0}】有填写为空!", p_excel.采购组)); + } + return ErrorList; + } + private static List CheckExcelMode_Sort(ScpEntities db, SCP_VENDER_EXPORT p_excel, string site) + { + List ErrorList = new List(); + + if ( + string.IsNullOrEmpty(p_excel.品番) || + string.IsNullOrEmpty(p_excel.Code39条码) || + + string.IsNullOrEmpty(p_excel.条码内容) + ) + { + ErrorList.Add(string.Format("品番【{0}】有填写为空!", p_excel.品番)); + } + return ErrorList; + } + private static List CheckExcelMode_Box(ScpEntities db, SCP_VENDER_PART_EXPORT p_excel, string site) + { + List ErrorList = new List(); + + if ( + + string.IsNullOrEmpty(p_excel.箱种) + ) + { + ErrorList.Add(string.Format("箱种【{0}】有填写为空!", p_excel.箱种)); + } + return ErrorList; + } + private static List CheckExcel_Model(ScpEntities db, SCP_VENDER_EXPORT p_excel, string site) + { + List ErrorList = new List(); + + var ModelCount = db.TA_CarModel.Count(p=>p.Model==p_excel.车型); + if (ModelCount > 0) + { + ErrorList.Add(string.Format("车型【{0}】已经存在,请不要重复导入!", p_excel.车型)); + } + return ErrorList; + } + /// /// 供应商导入验证 /// /// @@ -1645,7 +1979,7 @@ namespace CK.SCP.Controller string.IsNullOrEmpty(p_excel.零件名称) || string.IsNullOrEmpty(p_excel.项目编号)) { - ErrorList.Add(string.Format("零件编号【{0}】有填写为空!", p_excel.零件编号)); + ErrorList.Add(string.Format("零件编号{0}有填写为空!", p_excel.零件编号)); } return ErrorList; } @@ -1658,210 +1992,6119 @@ namespace CK.SCP.Controller private static List CheckExcelMode_Po(ScpEntities db, SCP_PO_EXPORT_IMPORT_MODEL p_excel) { List ErrorList = new List(); - if (!string.IsNullOrEmpty(p_excel.订单编号)) + if (!string.IsNullOrEmpty(p_excel.零件号)) { + var _count = db.TA_Appliance.Count(p => p.PartNumber == p_excel.零件号&&p.VendID==p_excel.供应商编号); + if (_count == 0) { - int count = db.TB_PO.Count(p => p.PoBillNum == p_excel.订单编号); - if (count > 0) + ErrorList.Add(string.Format("零件号码{0}与供应商{1}没有对应的基础信息!", p_excel.零件号,p_excel.供应商编号)); + } + } + var _count1 = db.TA_PART.Count(p => p.PartCode == p_excel.物料号码); + if (_count1 == 0) + { + ErrorList.Add(string.Format("物料号码{0}不存在!", p_excel.物料号码)); + } + + + if (_count1 > 0) + { + if (!string.IsNullOrEmpty(p_excel.组件物料号)) + { + ErrorList.Add(string.Format("普通采购订单不涉及组件物料号,请到委外采购订单菜单导入")); + } + var _part = db.TA_PART.SingleOrDefault(p => p.PartCode == p_excel.物料号码); + if (_part.PartCode.ToString()!= p_excel.物料号码.ToString()) + { + ErrorList.Add(string.Format("物料号码{0}填写不正确请注意大小写!", p_excel.物料号码)); + } + var _Unit = db.TA_PART.Count(p => p.PartCode == p_excel.物料号码&&p.Unit==p_excel.单位); + if (_Unit==0) + { + ErrorList.Add(string.Format("物料号码{0}单位填写不正确!", p_excel.物料号码)); + } + + if(_part.Unit.ToString()!= p_excel.单位.ToString()) + { + ErrorList.Add(string.Format("物料号码{0}单位填写不正确,请注意大小写!", p_excel.物料号码)); + } + + + var _checkpart = db.TA_PART.FirstOrDefault(p => p.PartCode == p_excel.物料号码); + if (decimal.Parse(_checkpart.Remark) <= 0) { - ErrorList.Add(string.Format("订单编号{0}已经存在!", p_excel.订单编号)); + ErrorList.Add(string.Format("物料号码{0}没有价格!", p_excel.物料号码)); } } - else + var _count2 = db.TA_VENDER.Count(p => p.VendId == p_excel.供应商编号); + if (_count2 == 0) { - ErrorList.Add(string.Format("订单编号为空!")); + ErrorList.Add(string.Format("供应商{0}不存在!", p_excel.供应商编号)); } - decimal _result = 0; - - if (!decimal.TryParse(p_excel.数量, out _result)) + if (_count2 > 0) { - ErrorList.Add(string.Format("订单编号{0}零件编号{1}数量填写有问题", p_excel.订单编号, p_excel.数量)); + var _countvend = db.TA_VENDER.SingleOrDefault(p => p.VendId == p_excel.供应商编号); + if (_countvend.VendId != p_excel.供应商编号) + { + ErrorList.Add(string.Format("供应商编号{0}不正确!", p_excel.供应商编号)); + } } + var _count7 = db.TA_PurchasGroup.Count(p => p.PurchasingGroup == p_excel.采购组 && p.ChineseName == p_excel.采购员); + if (_count7 == 0) + { + ErrorList.Add(string.Format("采购组{0}不存在!", p_excel.采购组)); + } + if (_count7 > 0) + { + var _count9 = db.TA_PurchasGroup.SingleOrDefault(p => p.PurchasingGroup == p_excel.采购组 && p.ChineseName == p_excel.采购员 && p.ChineseName == p_excel.采购员); + if (_count9.PurchasingGroup.ToString() != p_excel.采购组.ToString()) + { + ErrorList.Add(string.Format("采购组{0}填写错误,请注意大小写!", p_excel.采购组)); + } + } - //var _count = db.TA_PART.Count(p => p.PartCode == p_excel.零件号); - if ( - string.IsNullOrEmpty(p_excel.订单编号) || - string.IsNullOrEmpty(p_excel.行号) || - string.IsNullOrEmpty(p_excel.订单创建时间) || - string.IsNullOrEmpty(p_excel.要求到货日期) || - string.IsNullOrEmpty(p_excel.零件号) || + var _count8 = db.TA_StorageLocation.Count(p => p.StLocation == p_excel.存储地点); + if (_count8 == 0) + { + ErrorList.Add(string.Format("存储地点{0}不存在!", p_excel.存储地点)); + } + if (_count8 > 0) + { + var _count10 = db.TA_StorageLocation.SingleOrDefault(p => p.StLocation == p_excel.存储地点); + if (_count10.StLocation.ToString() != p_excel.存储地点.ToString()) + { + ErrorList.Add(string.Format("存储地点{0}填写错误,请注意大小写!", p_excel.存储地点)); + } + } + if ( + string.IsNullOrEmpty(p_excel.供应商编号) || + string.IsNullOrEmpty(p_excel.物料号码) || + string.IsNullOrEmpty(p_excel.采购员) || + string.IsNullOrEmpty(p_excel.采购组) || + string.IsNullOrEmpty(p_excel.采购员电话) || + string.IsNullOrEmpty(p_excel.存储地点) || + string.IsNullOrEmpty(p_excel.单位) || + string.IsNullOrEmpty(p_excel.订单创建时间)) + { + ErrorList.Add(string.Format("分组【{0}】物料号码有填写为空!", p_excel.物料号码)); + } + return ErrorList; + } + /// + /// 期货订单导入检查 + /// + /// + /// + /// + private static List CheckExcelMode_QH_Po(ScpEntities db, SCP_PO_EXPORT_IMPORT_MODEL p_excel) + { + List ErrorList = new List(); + if (!string.IsNullOrEmpty(p_excel.零件号)) + { + var _count = db.TA_Appliance.Count(p => p.PartNumber == p_excel.零件号 && p.VendID == p_excel.供应商编号); + if (_count == 0) + { + ErrorList.Add(string.Format("零件号码{0}与供应商{1}没有对应的基础信息!", p_excel.零件号, p_excel.供应商编号)); + } + } + var _count1 = db.TA_PART.Count(p => p.PartCode == p_excel.物料号码); + if (_count1 == 0) + { + ErrorList.Add(string.Format("物料号码{0}不存在!", p_excel.物料号码)); + } + if (!string.IsNullOrEmpty(p_excel.期货订单)) + { + if (p_excel.期货订单 != "Y") + { + ErrorList.Add(string.Format("物料号码{0}期货订单必须填Y!", p_excel.物料号码)); + } + } + + if (_count1 > 0) + { + var _part = db.TA_PART.SingleOrDefault(p => p.PartCode == p_excel.物料号码); + if (_part.PartCode.ToString() != p_excel.物料号码.ToString()) + { + ErrorList.Add(string.Format("物料号码{0}填写不正确请注意大小写!", p_excel.物料号码)); + } + var _Unit = db.TA_PART.Count(p => p.PartCode == p_excel.物料号码 && p.Unit == p_excel.单位); + if (_Unit == 0) + { + ErrorList.Add(string.Format("物料号码{0}单位填写不正确!", p_excel.物料号码)); + } + + if (_part.Unit.ToString() != p_excel.单位.ToString()) + { + ErrorList.Add(string.Format("物料号码{0}单位填写不正确,请注意大小写!", p_excel.物料号码)); + } + + + var _checkpart = db.TA_PART.FirstOrDefault(p => p.PartCode == p_excel.物料号码); + if (decimal.Parse(_checkpart.Remark) <= 0) + { + ErrorList.Add(string.Format("物料号码{0}没有价格!", p_excel.物料号码)); + } + } + var _count2 = db.TA_VENDER.Count(p => p.VendId == p_excel.供应商编号); + if (_count2 == 0) + { + ErrorList.Add(string.Format("供应商{0}不存在!", p_excel.供应商编号)); + } + if (_count2 > 0) + { + var _countvend = db.TA_VENDER.SingleOrDefault(p => p.VendId == p_excel.供应商编号); + if (_countvend.VendId != p_excel.供应商编号) + { + ErrorList.Add(string.Format("供应商编号{0}不正确!", p_excel.供应商编号)); + } + } + var maxpocount = db.TB_MAXPO_DETAIL.Count(p=>p.PartCode==p_excel.物料号码&&p.VendId == p_excel.供应商编号); + if (maxpocount ==0) + { + ErrorList.Add(string.Format("物料号码{0}供应商编号{1}没有对应的大订单!",p_excel.物料号码, p_excel.供应商编号)); + } + var _count7 = db.TA_PurchasGroup.Count(p => p.PurchasingGroup == p_excel.采购组 && p.ChineseName == p_excel.采购员); + if (_count7 == 0) + { + ErrorList.Add(string.Format("采购组{0}不存在!", p_excel.采购组)); + } + if (_count7 > 0) + { + var _count9 = db.TA_PurchasGroup.SingleOrDefault(p => p.PurchasingGroup == p_excel.采购组 && p.ChineseName == p_excel.采购员 && p.ChineseName == p_excel.采购员); + if (_count9.PurchasingGroup.ToString() != p_excel.采购组.ToString()) + { + ErrorList.Add(string.Format("采购组{0}填写错误,请注意大小写!", p_excel.采购组)); + } + } + + var _count8 = db.TA_StorageLocation.Count(p => p.StLocation == p_excel.存储地点); + if (_count8 == 0) + { + ErrorList.Add(string.Format("存储地点{0}不存在!", p_excel.存储地点)); + } + if (_count8 > 0) + { + var _count10 = db.TA_StorageLocation.SingleOrDefault(p => p.StLocation == p_excel.存储地点); + if (_count10.StLocation.ToString() != p_excel.存储地点.ToString()) + { + ErrorList.Add(string.Format("存储地点{0}填写错误,请注意大小写!", p_excel.存储地点)); + } + } + if ( + string.IsNullOrEmpty(p_excel.供应商编号) || + string.IsNullOrEmpty(p_excel.物料号码) || string.IsNullOrEmpty(p_excel.采购员) || + string.IsNullOrEmpty(p_excel.采购组) || string.IsNullOrEmpty(p_excel.采购员电话) || - string.IsNullOrEmpty(p_excel.数量) || + string.IsNullOrEmpty(p_excel.存储地点) || string.IsNullOrEmpty(p_excel.单位) || - string.IsNullOrEmpty(p_excel.单价) || + string.IsNullOrEmpty(p_excel.期货订单) || string.IsNullOrEmpty(p_excel.订单创建时间)) { - ErrorList.Add(string.Format("分组【{1}】零件名称【{0}】有填写为空!", p_excel.零件号, p_excel.订单编号)); + ErrorList.Add(string.Format("分组【{0}】物料号码有填写为空!", p_excel.物料号码)); + } + return ErrorList; + } + /// + /// 富维订单导入检查 + /// + /// + /// + /// + private static List CheckExcelMode_Po1(ScpEntities db, SCP_PO_EXPORT_IMPORT_MODEL p_excel) + { + List ErrorList = new List(); + var _count = db.TA_Appliance.Count(p => p.PartNumber == p_excel.零件号 && p.VendID == p_excel.供应商编号); + if (_count == 0) + { + ErrorList.Add(string.Format("零件号码{0}与供应商{1}没有对应的基础信息!", p_excel.零件号, p_excel.供应商编号)); + } + BomList1.JsonService bomVersionRe = new BomList1.JsonService(); + var _ReturnRelust = bomVersionRe.GetBomVersion(p_excel.物料号码, p_excel.组件物料号); + if (p_excel.BOM版本 != _ReturnRelust) + { + ErrorList.Add(string.Format("物料号码{0}的BOM版本号填写错误", p_excel.物料号码)); + } + var price = db.TB_NetPrice.Count(p => p.PartCode == p_excel.物料号码 && p.VendId == p_excel.供应商编号 && p.EndTime > DateTime.Now); + if (price == 0) + { + ErrorList.Add(string.Format("物料号码{0}不存在净价", p_excel.物料号码)); + } + var _count1 = db.TA_PART.Count(p => p.PartCode == p_excel.物料号码); + if (_count1 == 0) + { + ErrorList.Add(string.Format("物料号码{0}不存在!", p_excel.物料号码)); + } + if (_count1 > 0) + { + var _part = db.TA_PART.SingleOrDefault(p => p.PartCode == p_excel.物料号码); + if (_part.PartCode.ToString() != p_excel.物料号码.ToString()) + { + ErrorList.Add(string.Format("物料号码{0}填写不正确请注意大小写和空格!", p_excel.物料号码)); + } + if (_part.Unit.ToString() != p_excel.单位.ToString()) + { + ErrorList.Add(string.Format("物料号码{0}单位填写不正确,请注意大小写!", p_excel.物料号码)); + } + var _part5 = db.TA_PART.SingleOrDefault(p => p.PartCode == p_excel.组件物料号); + if (_part5.PartCode.ToString() != p_excel.组件物料号.ToString()) + { + ErrorList.Add(string.Format("组件物料号码{0}填写不正确请注意大小写和空格!", p_excel.组件物料号)); + } + if (_part5.Unit.ToString() != p_excel.组件计量单位.ToString()) + { + ErrorList.Add(string.Format("组件物料号{0}计量单位填写不正确,请注意大小写!", p_excel.组件物料号)); + } + var _Unit = db.TA_PART.Count(p => p.PartCode == p_excel.物料号码 && p.Unit == p_excel.单位); + if (_Unit == 0) + { + ErrorList.Add(string.Format("物料号码{0}单位填写不正确!", p_excel.物料号码)); + } + var _Unit1 = db.TA_PART.Count(p => p.PartCode == p_excel.组件物料号 && p.Unit == p_excel.组件计量单位); + if (_Unit1 == 0) + { + ErrorList.Add(string.Format("组件物料号{0}组件计量单位填写不正确!", p_excel.组件物料号)); + } + + + if (decimal.Parse(_part.Remark) <= 0) + { + ErrorList.Add(string.Format("物料号码没有标准价格!", p_excel.物料号码)); + } + } + + + var _count3 = db.TA_PART.Count(p => p.PartCode == p_excel.组件物料号); + if (_count3 == 0) + { + ErrorList.Add(string.Format("组件物料号{0}不存在!", p_excel.组件物料号)); + } + + var _count2 = db.TA_VENDER.Count(p => p.VendId == p_excel.供应商编号); + if (_count2 == 0) + { + ErrorList.Add(string.Format("供应商{0}不存在!", p_excel.供应商编号)); + } + if (_count2 > 0) + { + var _countvend = db.TA_VENDER.SingleOrDefault(p => p.VendId == p_excel.供应商编号); + if (_countvend.VendId != p_excel.供应商编号) + { + ErrorList.Add(string.Format("供应商编号{0}不正确!", p_excel.供应商编号)); + } + } + + var _count7 = db.TA_PurchasGroup.Count(p => p.PurchasingGroup == p_excel.采购组 && p.ChineseName == p_excel.采购员); + if (_count7 == 0) + { + ErrorList.Add(string.Format("采购组{0}不存在!", p_excel.采购组)); + } + if (_count7 > 0) + { + var _count9 = db.TA_PurchasGroup.SingleOrDefault(p => p.PurchasingGroup == p_excel.采购组 && p.ChineseName == p_excel.采购员 && p.ChineseName == p_excel.采购员); + if(_count9.PurchasingGroup.ToString() != p_excel.采购组.ToString()) + { + ErrorList.Add(string.Format("采购组{0}填写错误,请注意大小写!", p_excel.采购组)); + } + } + + var _count8 = db.TA_StorageLocation.Count(p => p.StLocation == p_excel.存储地点); + if (_count8 == 0) + { + ErrorList.Add(string.Format("存储地点{0}不存在!", p_excel.存储地点)); + } + if (_count8 > 0) + { + var _count10= db.TA_StorageLocation.SingleOrDefault(p => p.StLocation == p_excel.存储地点); + if (_count10.StLocation.ToString()!= p_excel.存储地点.ToString()) + { + ErrorList.Add(string.Format("存储地点{0}填写错误,请注意大小写!", p_excel.存储地点)); + } + } + + if ( + string.IsNullOrEmpty(p_excel.订单创建时间) || + //string.IsNullOrEmpty(p_excel.零件号) || + string.IsNullOrEmpty(p_excel.采购员) || + string.IsNullOrEmpty(p_excel.采购组) || + string.IsNullOrEmpty(p_excel.采购员电话) || + string.IsNullOrEmpty(p_excel.单位) || + string.IsNullOrEmpty(p_excel.组件计量单位) || + string.IsNullOrEmpty(p_excel.组件物料号) || + string.IsNullOrEmpty(p_excel.存储地点)|| + string.IsNullOrEmpty(p_excel.组件数量)) + + { + ErrorList.Add(string.Format("零件名称{0}有填写为空!", p_excel.零件号)); + } + + return ErrorList; + + + } + /// + /// 本特勒订单导入检查 + /// + /// + /// + /// + private static List CheckExcelMode_BTL(ScpEntities db, SCP_PO_EXPORT_IMPORT_MODEL p_excel) + { + List ErrorList = new List(); + var _count = db.TA_Appliance.Count(p => p.PartNumber == p_excel.零件号 && p.VendID == p_excel.供应商编号); + if (_count == 0) + { + ErrorList.Add(string.Format("零件号码{0}与供应商{1}没有对应的基础信息!", p_excel.零件号, p_excel.供应商编号)); + } + BomVersion1.JsonService bomVersionRe = new BomVersion1.JsonService(); + var _ReturnRelust = bomVersionRe.GetBomVersion(p_excel.物料号码, p_excel.组件物料号); + if (p_excel.BOM版本 != _ReturnRelust) + { + ErrorList.Add(string.Format("物料号码{0}的BOM版本号填写错误", p_excel.物料号码)); + } + var price = db.TB_NetPrice.Count(p => p.PartCode == p_excel.物料号码 && p.VendId == p_excel.供应商编号 && p.EndTime > DateTime.Now); + if (price == 0) + { + ErrorList.Add(string.Format("物料号码{0}不存在净价", p_excel.物料号码)); + } + var _count1 = db.TA_PART.Count(p => p.PartCode == p_excel.物料号码); + if (_count1 == 0) + { + ErrorList.Add(string.Format("物料号码{0}不存在!", p_excel.物料号码)); + } + if (_count1 > 0) + { + var _part = db.TA_PART.SingleOrDefault(p => p.PartCode == p_excel.物料号码); + if (_part.PartCode.ToString() != p_excel.物料号码.ToString()) + { + ErrorList.Add(string.Format("物料号码{0}填写不正确请注意大小写和空格!", p_excel.物料号码)); + } + if (_part.Unit.ToString() != p_excel.单位.ToString()) + { + ErrorList.Add(string.Format("物料号码{0}单位填写不正确,请注意大小写!", p_excel.物料号码)); + } + var _zjpart = db.TA_PART.Count(p => p.PartCode == p_excel.组件物料号); + { + if (_zjpart == 0) + { + ErrorList.Add(string.Format("组件物料号码{0}不存在!", p_excel.物料号码)); + } + else + { + var _part5 = db.TA_PART.SingleOrDefault(p => p.PartCode == p_excel.组件物料号); + if (_part5.PartCode.ToString() != p_excel.组件物料号.ToString()) + { + ErrorList.Add(string.Format("组件物料号码{0}填写不正确请注意大小写和空格!", p_excel.组件物料号)); + } + if (_part5.Unit.ToString() != p_excel.组件计量单位.ToString()) + { + ErrorList.Add(string.Format("组件物料号{0}计量单位填写不正确,请注意大小写!", p_excel.组件物料号)); + } + } + } + + var _Unit = db.TA_PART.Count(p => p.PartCode == p_excel.物料号码 && p.Unit == p_excel.单位); + if (_Unit == 0) + { + ErrorList.Add(string.Format("物料号码{0}单位填写不正确!", p_excel.物料号码)); + } + var _Unit1 = db.TA_PART.Count(p => p.PartCode == p_excel.组件物料号 && p.Unit == p_excel.组件计量单位); + if (_Unit1 == 0) + { + ErrorList.Add(string.Format("组件物料号{0}组件计量单位填写不正确!", p_excel.组件物料号)); + } + + + if (decimal.Parse(_part.Remark) <= 0) + { + ErrorList.Add(string.Format("物料号码没有标准价格!", p_excel.物料号码)); + } } - //if (_count == 0) + + + //var _count3 = db.TA_PART.Count(p => p.PartCode == p_excel.组件物料号); + //if (_count3 == 0) //{ - // ErrorList.Add(string.Format("分组【{2}】零件名称【{0}】行号【{1}】不存在!", p_excel.零件号, p_excel.行号, p_excel.订单编号)); + // ErrorList.Add(string.Format("组件物料号{0}不存在!", p_excel.组件物料号)); //} + + var _count2 = db.TA_VENDER.Count(p => p.VendId == p_excel.供应商编号); + if (_count2 == 0) + { + ErrorList.Add(string.Format("供应商{0}不存在!", p_excel.供应商编号)); + } + if (_count2 > 0) + { + var _countvend = db.TA_VENDER.SingleOrDefault(p => p.VendId == p_excel.供应商编号); + if (_countvend.VendId != p_excel.供应商编号) + { + ErrorList.Add(string.Format("供应商编号{0}不正确!", p_excel.供应商编号)); + } + } + + var _count7 = db.TA_PurchasGroup.Count(p => p.PurchasingGroup == p_excel.采购组 && p.ChineseName == p_excel.采购员); + if (_count7 == 0) + { + ErrorList.Add(string.Format("采购组{0}不存在!", p_excel.采购组)); + } + if (_count7 > 0) + { + var _count9 = db.TA_PurchasGroup.SingleOrDefault(p => p.PurchasingGroup == p_excel.采购组 && p.ChineseName == p_excel.采购员 && p.ChineseName == p_excel.采购员); + if (_count9.PurchasingGroup.ToString() != p_excel.采购组.ToString()) + { + ErrorList.Add(string.Format("采购组{0}填写错误,请注意大小写!", p_excel.采购组)); + } + } + + var _count8 = db.TA_StorageLocation.Count(p => p.StLocation == p_excel.存储地点); + if (_count8 == 0) + { + ErrorList.Add(string.Format("存储地点{0}不存在!", p_excel.存储地点)); + } + if (_count8 > 0) + { + var _count10 = db.TA_StorageLocation.SingleOrDefault(p => p.StLocation == p_excel.存储地点); + if (_count10.StLocation.ToString() != p_excel.存储地点.ToString()) + { + ErrorList.Add(string.Format("存储地点{0}填写错误,请注意大小写!", p_excel.存储地点)); + } + } + + if ( + string.IsNullOrEmpty(p_excel.订单创建时间) || + //string.IsNullOrEmpty(p_excel.零件号) || + string.IsNullOrEmpty(p_excel.采购员) || + string.IsNullOrEmpty(p_excel.采购组) || + string.IsNullOrEmpty(p_excel.采购员电话) || + string.IsNullOrEmpty(p_excel.单位) || + string.IsNullOrEmpty(p_excel.组件计量单位) || + string.IsNullOrEmpty(p_excel.组件物料号) || + string.IsNullOrEmpty(p_excel.存储地点) || + string.IsNullOrEmpty(p_excel.组件数量)) + + { + ErrorList.Add(string.Format("零件名称{0}有填写为空!", p_excel.零件号)); + } + return ErrorList; + + + } + /// + /// 富维多组件订单导入效验 + /// + /// + /// + /// + private static List CheckExcelMode_Multicomponent(ScpEntities db, SCP_PO_EXPORT_IMPORT_MODEL p_excel,bool wmsweb) + { + List ErrorList = new List(); + if (wmsweb == false) { + BomList.JsonService bomVersionRe = new BomList.JsonService(); + var _ReturnRelust = bomVersionRe.GetBomsByVer(p_excel.物料号码, p_excel.BOM版本); + if (!_ReturnRelust.Contains("Qty")) + { + ErrorList.Add(string.Format("不存在物料号为{0},版本号为{1}的数据", p_excel.物料号码, p_excel.BOM版本)); + } + } + else + { + BomList1.JsonService bomVersionRe = new BomList1.JsonService(); + var _ReturnRelust = bomVersionRe.GetBomsByVer(p_excel.物料号码, p_excel.BOM版本); + if (!_ReturnRelust.Contains("Qty")) + { + ErrorList.Add(string.Format("不存在物料号为{0},版本号为{1}的数据", p_excel.物料号码, p_excel.BOM版本)); + } + } + + var _count = db.TA_Appliance.Count(p => p.PartNumber == p_excel.零件号 && p.VendID == p_excel.供应商编号); + if (_count == 0) + { + ErrorList.Add(string.Format("零件号码{0}与供应商{1}没有对应的基础信息!", p_excel.零件号, p_excel.供应商编号)); + } + + + //var price = db.TB_NetPrice.Count(p => p.PartCode == p_excel.物料号码 && p.VendId == p_excel.供应商编号 && p.EndTime > DateTime.Now); + //if (price == 0) + //{ + // ErrorList.Add(string.Format("物料号码{0}不存在净价", p_excel.物料号码)); + //} + var _count1 = db.TA_PART.Count(p => p.PartCode == p_excel.物料号码); + if (_count1 == 0) + { + ErrorList.Add(string.Format("物料号码{0}不存在!", p_excel.物料号码)); + } + if (_count1 > 0) + { + var _part = db.TA_PART.SingleOrDefault(p => p.PartCode == p_excel.物料号码); + if (_part.PartCode.ToString() != p_excel.物料号码.ToString()) + { + ErrorList.Add(string.Format("物料号码{0}填写不正确请注意大小写和空格!", p_excel.物料号码)); + } + if (_part.Unit.ToString() != p_excel.单位.ToString()) + { + ErrorList.Add(string.Format("物料号码{0}单位填写不正确,请注意大小写!", p_excel.物料号码)); + } + + var _Unit = db.TA_PART.Count(p => p.PartCode == p_excel.物料号码 && p.Unit == p_excel.单位); + if (_Unit == 0) + { + ErrorList.Add(string.Format("物料号码{0}单位填写不正确!", p_excel.物料号码)); + } + + + if (decimal.Parse(_part.Remark) <= 0) + { + ErrorList.Add(string.Format("物料号码没有标准价格!", p_excel.物料号码)); + } + } + + var _count2 = db.TA_VENDER.Count(p => p.VendId == p_excel.供应商编号); + if (_count2 == 0) + { + ErrorList.Add(string.Format("供应商{0}不存在!", p_excel.供应商编号)); + } + if (_count2 > 0) + { + var _countvend = db.TA_VENDER.SingleOrDefault(p => p.VendId == p_excel.供应商编号); + if (_countvend.VendId != p_excel.供应商编号) + { + ErrorList.Add(string.Format("供应商编号{0}不正确!", p_excel.供应商编号)); + } + } + + var _count7 = db.TA_PurchasGroup.Count(p => p.PurchasingGroup == p_excel.采购组 && p.ChineseName == p_excel.采购员); + if (_count7 == 0) + { + ErrorList.Add(string.Format("采购组{0}不存在!", p_excel.采购组)); + } + if (_count7 > 0) + { + var _count9 = db.TA_PurchasGroup.SingleOrDefault(p => p.PurchasingGroup == p_excel.采购组 && p.ChineseName == p_excel.采购员 && p.ChineseName == p_excel.采购员); + if (_count9.PurchasingGroup.ToString() != p_excel.采购组.ToString()) + { + ErrorList.Add(string.Format("采购组{0}填写错误,请注意大小写!", p_excel.采购组)); + } + } + + var _count8 = db.TA_StorageLocation.Count(p => p.StLocation == p_excel.存储地点); + if (_count8 == 0) + { + ErrorList.Add(string.Format("存储地点{0}不存在!", p_excel.存储地点)); + } + if (_count8 > 0) + { + var _count10 = db.TA_StorageLocation.SingleOrDefault(p => p.StLocation == p_excel.存储地点); + if (_count10.StLocation.ToString() != p_excel.存储地点.ToString()) + { + ErrorList.Add(string.Format("存储地点{0}填写错误,请注意大小写!", p_excel.存储地点)); + } + } + + if ( + string.IsNullOrEmpty(p_excel.订单创建时间) || + string.IsNullOrEmpty(p_excel.零件号) || + string.IsNullOrEmpty(p_excel.采购员) || + string.IsNullOrEmpty(p_excel.采购组) || + string.IsNullOrEmpty(p_excel.采购员电话) || + string.IsNullOrEmpty(p_excel.单位) || + string.IsNullOrEmpty(p_excel.存储地点)) + + { + ErrorList.Add(string.Format("零件名称{0}有填写为空!", p_excel.零件号)); + } + + return ErrorList; + + + } + /// + /// 富维冲压件大订单效验 + /// + /// + /// + /// + private static List CheckExcelMode_MAXPO(ScpEntities db, SCP_MAXPO_EXPORT p_excel) + { + List ErrorList = new List(); + + var _count1 = db.TA_PART.Count(p => p.PartCode == p_excel.零件号); + if (_count1 == 0) + { + ErrorList.Add(string.Format("零件号{0}不存在!", p_excel.零件号)); + } + var _count = db.TA_PART.Count(p => p.PartCode == p_excel.原材物料号); + if (_count == 0) + { + ErrorList.Add(string.Format("原材物料号{0}不存在!", p_excel.原材物料号)); + } + var _count2 = db.TA_VENDER.Count(p => p.VendId == p_excel.供应商编号); + if (_count2 == 0) + { + ErrorList.Add(string.Format("供应商{0}不存在!", p_excel.供应商编号)); + } + if (_count2 > 0) + { + var _countvend = db.TA_VENDER.FirstOrDefault(p => p.VendId == p_excel.供应商编号); + if (_countvend.VendId != p_excel.供应商编号) + { + ErrorList.Add(string.Format("供应商编号{0}不正确!", p_excel.供应商编号)); + } + } + + BomList1.JsonService bomVersionRe = new BomList1.JsonService(); + var _ReturnRelust = bomVersionRe.GetBom(p_excel.零件号, p_excel.原材物料号); + if (_ReturnRelust == "[null]") + { + ErrorList.Add(string.Format("零件号{0}与原材物料号{1}不存在BOM关系!", p_excel.零件号, p_excel.原材物料号)); + } + if ( + string.IsNullOrEmpty(p_excel.零件号) || + string.IsNullOrEmpty(p_excel.原材物料号) || + string.IsNullOrEmpty(p_excel.供应商编号)) + + { + ErrorList.Add(string.Format("零件名称{0}有填写为空!", p_excel.零件号)); + } + + return ErrorList; + + + } + /// + /// 北京安通林 + /// + /// + /// + /// + /// + /// + /// + public static ResultObject EXCEL_PO_TO_ASK_MOD(List p_order_list, string p_creator, string p_buyer, DateTime p_time, BillModType p_modtype, bool IsAutoPublish = false) + { + ResultObject _ret = new ResultObject(); + try + { + using (ScpEntities db = EntitiesFactory.CreateScpInstance()) + { + p_order_list.ForEach(p => + { + if (string.IsNullOrEmpty(p.订单数)) + { + p.订单数 = "0"; + } + }); + + int number = 1; + List lineError = new List(); + List ErrorList = new List(); + var _lst = p_order_list.Where(p => p.订单数 != "0").ToList(); + _lst.ForEach + (p => + { + var _ls = CheckExcelMode(db, p); + if (_ls.Count > 0) + { + lineError.Add(number.ToString()); + ErrorList.Add(string.Join("
", _ls.ToArray())); + } + number++; + }); + if (lineError.Count > 0) + { + _ret.State = ReturnStatus.Failed; + _ret.MessageList.AddRange(ErrorList); + _ret.Result = false; + } + else + { + var VenderList = _lst.Select(p => p.供应商编码).Distinct(); + var PartCodeList = _lst.Select(p => p.零件编码).Distinct(); + var OrderList = _lst.GroupBy(p => p.订单编号).ToList(); + OrderList.ForEach((p) => + { + var list = p.ToList(); + if (list.Count > 0) + { + var _entity = list.FirstOrDefault(); + TB_ASK _ask = new TB_ASK(); + _ask.AskBillNum = SCP_BILLCODE_CONTROLLER.MakeASKCode(); + _ask.VendId = _entity.供应商编码; + _ask.State = (int)AskState.New; + _ask.PoBillNum = _entity.订单编号; + _ask.ModType = (int)BillModType.Contract; + _ask.Site = _entity.域名; + _ask.Remark = _entity.站点; + if (IsAutoPublish) + { + _ask.State = (int)AskState.Release; + } + else + { + _ask.State = (int)AskState.New; + } + _ask.BeginTime = DateTime.Parse(_entity.订货日期); + _ask.Buyer = p_buyer; + _ask.BuyerPhone = _entity.计划员电话; + _ask.ErpBillNum = _entity.项目编号; + _ask.EndTime = DateTime.Parse(_entity.到货日期); + _ask.CreateTime = DateTime.Now; + _ask.CreateUser = p_creator; + _ask.VendId = _entity.供应商编码; + _ask.GUID = Guid.NewGuid(); + _ask.ReceivedPort = _entity.收货口; + _ask.IsDeleted = false; + db.TB_ASK.Add(_ask); + #region 供应商新任务代办接口 + TB_PENING_ITEMS _item = new TB_PENING_ITEMS(); + _item.ROLE_NAME = "供应商"; + _item.ITEM_NO = _ask.AskBillNum; + _item.ITEM_CONTENT = "要货看盘有信息"; + _item.ITEM_TYPE = (int)PENDING_MESSAGE_TYPE.NEW_ASK; + _item.VEND_ID = _ask.VendId; + _item.ITEM_STATE = (int)PENDING_STATE.WAITING; + _item.SENDER = p_buyer; + _item.SENDING_TIME = DateTime.Now; + db.TB_PENING_ITEMS.Add(_item); + #endregion + // int _number = 1; + List _ls = new List(); + list.ForEach((itm) => + { + var _number = _ls.Count(p1 => p1.PoBillNum == _ask.PoBillNum + && p1.PoLine == Int32.Parse(itm.行号) && p1.PartCode == itm.零件编码 && itm.域名 == p1.Remark); + if (_number > 0) + { + _ret.MessageList.Add(string.Format("已经存在订单为{0}行号为{1}零件编码为{2}", itm.订单编号, itm.行号, itm.零件编码)); + } + + TB_ASK_DETAIL _t_ASK_Detail = new TB_ASK_DETAIL(); + + _t_ASK_Detail.PoLine = Int32.Parse(itm.行号); + _t_ASK_Detail.Currency = itm.币种; + _t_ASK_Detail.AskBillNum = _ask.AskBillNum; + _t_ASK_Detail.PoBillNum = _ask.PoBillNum; + _t_ASK_Detail.PoUnit = itm.单位; + _t_ASK_Detail.CreateTime = DateTime.Now; + _t_ASK_Detail.CreateUser = _ask.CreateUser; + _t_ASK_Detail.PartCode = itm.零件编码; + _t_ASK_Detail.BeginTime = DateTime.Parse(itm.订货日期); + _t_ASK_Detail.EndTime = DateTime.Parse(itm.到货日期); + _t_ASK_Detail.TempQty = decimal.Parse(itm.订单数); + _t_ASK_Detail.AskQty = decimal.Parse(itm.订单数); + _t_ASK_Detail.IsDeleted = false; + _t_ASK_Detail.LocUnit = itm.单位; + _t_ASK_Detail.UnConv = 1; + _t_ASK_Detail.DockCode = itm.收货口; + _t_ASK_Detail.State = _ask.State; + _t_ASK_Detail.Price = string.IsNullOrEmpty(itm.价格) ? 0 : decimal.Parse(itm.价格); + _t_ASK_Detail.GUID = Guid.NewGuid(); + _t_ASK_Detail.Remark = _ask.Site; + _t_ASK_Detail.UpdateInfo = itm.备注; + db.TB_ASK_DETAIL.Add(_t_ASK_Detail); + _ls.Add(_t_ASK_Detail); + // _number++; + }); + } + else + { + _ret.MessageList.Add("ERP订单编号已存在,请重新导入!"); + + } + if (_ret.MessageList.Count == 0) + { + int state = db.SaveChanges(); + if (state != -1) + { + _ret.State = ReturnStatus.Succeed; + _ret.Result = true; + } + else + { + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + } + } + else + { + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + } + } + ); + } + } + } + catch (System.Data.Entity.Validation.DbEntityValidationException dbEx)//捕获实体验证异常 + { + var sb = new StringBuilder(); + + foreach (var error in dbEx.EntityValidationErrors.ToList()) + { + + error.ValidationErrors.ToList().ForEach(i => + { + sb.AppendFormat("表:{0},字段:{1},信息:{2}\r\n", error.Entry.Entity.GetType().Name, i.PropertyName, i.ErrorMessage); + }); + } + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + _ret.ErrorList.Add(dbEx); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "EXCEL_PO_TO_ASK", sb.ToString()); + throw new ScpException(ResultCode.DbEntityValidationException, sb.ToString(), "字段验证失败" + sb.ToString()); + } + catch (OptimisticConcurrencyException ex)//并发冲突异常 + { + + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + _ret.ErrorList.Add(ex); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "EXCEL_PO_TO_ASK", ex.ToString()); + throw new ScpException(ResultCode.Exception, "9999", ex.ToString()); + } + catch (ScpException ex) + { + + + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + _ret.ErrorList.Add(ex); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "EXCEL_PO_TO_ASK", ex.ToString()); + + if (ex.InnerException != null && ex.InnerException.GetType() == typeof(UpdateException)) + { + var inner = (UpdateException)ex.InnerException; + + + throw new ScpException(ResultCode.Exception, "0000", ex.ToString()); + } + else + { + if (ex.InnerException != null) throw ex.InnerException; + } + } + catch (Exception e) + { + _ret.State = ReturnStatus.Failed; + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "EXCEL_PO_TO_ASK", e.Message); + _ret.Result = false; + _ret.ErrorList.Add(e); + throw e; + } + return _ret; + + } + /// + /// 供应商零件导入 + /// + /// + /// + /// + /// + public static ResultObject EXCEL_VENDER_PART_MOD(List p_order_list, string site, string p_creator) + { + ResultObject _ret = new ResultObject(); + try + { + using (ScpEntities db = EntitiesFactory.CreateScpInstance()) + { + int number = 1; + List lineError = new List(); + List ErrorList = new List(); + var _lst = p_order_list; + _lst.ForEach(p => + { + var _count = _lst.Count(itm => itm.供应商代码 == p.供应商代码 && itm.零件号 == p.零件号); + if (_count > 1) + { + lineError.Add(string.Format("导入的供应商{0}零件编号{1}有重复", p.供应商代码, p.零件号)); + ErrorList = lineError; + } + }); + _lst.ForEach(p => + { + var _ls = CheckExcelMode_VenderPart(db, p, site); + if (_ls.Count > 0) + { + lineError.Add(number.ToString()); + ErrorList.Add(string.Join("
", _ls.ToArray())); + } + number++; + }); + if (lineError.Count > 0) + { + _ret.State = ReturnStatus.Failed; + _ret.MessageList.AddRange(ErrorList); + _ret.Result = false; + } + else + { + _lst.ForEach(p => + { + var _venderpart = db.TA_VEND_PART.SingleOrDefault(t => t.VendId == p.供应商代码.ToUpper() && t.PartCode == p.零件号.ToUpper()) ?? + new TA_VEND_PART + { + VendId = p.供应商代码.ToUpper(), + PartCode = p.零件号.ToUpper(), + State = 1, + CreateTime = DateTime.Now, + CreateUser = p_creator, + IsDeleted = false, + GUID = System.Guid.NewGuid(), + }; + _venderpart.VendPartCode = p.供应商零件号.ToUpper(); + _venderpart.VendPackQty = decimal.Parse(p.标包数); + _venderpart.MinPackQty = decimal.Parse(p.小包装数); + _venderpart.PalletPackQty = decimal.Parse(p.托盘包装数); + _venderpart.PoUnit = p.单位; + _venderpart.Remark = ""; + _venderpart.UpdateTime = DateTime.Now; + _venderpart.UpdateUser = p_creator; + _venderpart.Site = site; + db.TA_VEND_PART.AddOrUpdate(_venderpart); + }); + if (_ret.MessageList.Count == 0) + { + int state = db.SaveChanges(); + if (state != -1) + { + _ret.State = ReturnStatus.Succeed; + _ret.Result = true; + } + else + { + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + } + } + else + { + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + } + } + } + + } + catch (System.Data.Entity.Validation.DbEntityValidationException dbEx)//捕获实体验证异常 + { + var sb = new StringBuilder(); + + foreach (var error in dbEx.EntityValidationErrors.ToList()) + { + + error.ValidationErrors.ToList().ForEach(i => + { + sb.AppendFormat("表:{0},字段:{1},信息:{2}\r\n", error.Entry.Entity.GetType().Name, i.PropertyName, i.ErrorMessage); + }); + } + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + _ret.ErrorList.Add(dbEx); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "EXCEL_VENDER_PART_MOD", sb.ToString()); + throw new ScpException(ResultCode.DbEntityValidationException, sb.ToString(), "字段验证失败" + sb.ToString()); + } + catch (OptimisticConcurrencyException ex)//并发冲突异常 + { + + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + _ret.ErrorList.Add(ex); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "EXCEL_VENDER_PART_MOD", ex.ToString()); + throw new ScpException(ResultCode.Exception, "9999", ex.ToString()); + } + catch (ScpException ex) + { + + + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + _ret.ErrorList.Add(ex); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "EXCEL_VENDER_PART_MOD", ex.ToString()); + + if (ex.InnerException != null && ex.InnerException.GetType() == typeof(UpdateException)) + { + var inner = (UpdateException)ex.InnerException; + + + throw new ScpException(ResultCode.Exception, "0000", ex.ToString()); + } + else + { + if (ex.InnerException != null) throw ex.InnerException; + } + } + catch (Exception e) + { + _ret.State = ReturnStatus.Failed; + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "EXCEL_VENDER_PART_MOD", e.Message); + _ret.Result = false; + _ret.ErrorList.Add(e); + throw e; + } + return _ret; + } + /// + /// 零件器具导入 + /// + /// + /// + /// + /// + public static ResultObject EXCEL_VENDER_PART_MOD1(List p_order_list, string site, string p_creator) + { + ResultObject _ret = new ResultObject(); + try + { + using (ScpEntities db = EntitiesFactory.CreateScpInstance()) + { + int number = 1; + List lineError = new List(); + List ErrorList = new List(); + var _lst = p_order_list; + _lst.ForEach(p => + { + var _count = _lst.Count(itm => itm.零件号码 == p.零件号码 && itm.供应商代码==p.供应商代码); + if (_count > 1) + { + lineError.Add(string.Format("零件号码有重复", p.零件号码)); + ErrorList = lineError; + } + }); + _lst.ForEach(p => + { + var _ls = CheckExcelMode_VenderPart1(db, p, site); + if (_ls.Count > 0) + { + lineError.Add(number.ToString()); + ErrorList.Add(string.Join("
", _ls.ToArray())); + } + number++; + }); + if (lineError.Count > 0) + { + _ret.State = ReturnStatus.Failed; + _ret.MessageList.AddRange(ErrorList); + _ret.Result = false; + } + else + { + _lst.ForEach(p => + { + + var _partdes = db.TA_Appliance.Count(t => t.PartNumber == p.零件号码 && t.VendID == p.供应商代码); + if (_partdes == 0) + { + TA_Appliance _entity = new TA_Appliance(); + _entity.PartNumber = p.零件号码; + _entity.PackNumber = decimal.Parse(p.标包数); + _entity.PartDesc1 = p.零件描述; + _entity.ReciteNumber = p.背番号; + _entity.SufanLand = p.所番地; + _entity.BoxType = p.箱种; + _entity.PostEngineering = p.后工程; + _entity.PartNumber = p.零件号码; + + _entity.Texture = p.材质; + _entity.Model = p.车型; + _entity.ReceivingPort = p.收货口; + _entity.VendID = p.供应商代码; + db.TA_Appliance.Add(_entity); + + } + else + { + var _partde = db.TA_Appliance.SingleOrDefault(t => t.PartNumber == p.零件号码 && t.VendID == p.供应商代码); + + _partde.PackNumber = decimal.Parse(p.标包数); + _partde.PartDesc1 = p.零件描述; + _partde.Model = p.车型; + _partde.ReciteNumber = p.背番号; + _partde.SufanLand = p.所番地; + _partde.BoxType = p.箱种; + _partde.PostEngineering = p.后工程; + _partde.PartNumber = p.零件号码; + + _partde.Texture = p.材质; + _partde.ReceivingPort = p.收货口; + + db.TA_Appliance.AddOrUpdate(_partde); + } + + + }); + if (_ret.MessageList.Count == 0) + { + int state = db.SaveChanges(); + if (state != -1) + { + _ret.State = ReturnStatus.Succeed; + _ret.Result = true; + } + else + { + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + } + } + else + { + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + } + } + } + + } + catch (System.Data.Entity.Validation.DbEntityValidationException dbEx)//捕获实体验证异常 + { + var sb = new StringBuilder(); + + foreach (var error in dbEx.EntityValidationErrors.ToList()) + { + + error.ValidationErrors.ToList().ForEach(i => + { + sb.AppendFormat("表:{0},字段:{1},信息:{2}\r\n", error.Entry.Entity.GetType().Name, i.PropertyName, i.ErrorMessage); + }); + } + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + _ret.ErrorList.Add(dbEx); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "EXCEL_VENDER_PART_MOD", sb.ToString()); + throw new ScpException(ResultCode.DbEntityValidationException, sb.ToString(), "字段验证失败" + sb.ToString()); + } + catch (OptimisticConcurrencyException ex)//并发冲突异常 + { + + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + _ret.ErrorList.Add(ex); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "EXCEL_VENDER_PART_MOD", ex.ToString()); + throw new ScpException(ResultCode.Exception, "9999", ex.ToString()); + } + catch (ScpException ex) + { + + + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + _ret.ErrorList.Add(ex); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "EXCEL_VENDER_PART_MOD", ex.ToString()); + + if (ex.InnerException != null && ex.InnerException.GetType() == typeof(UpdateException)) + { + var inner = (UpdateException)ex.InnerException; + + + throw new ScpException(ResultCode.Exception, "0000", ex.ToString()); + } + else + { + if (ex.InnerException != null) throw ex.InnerException; + } + } + catch (Exception e) + { + _ret.State = ReturnStatus.Failed; + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "EXCEL_VENDER_PART_MOD", e.Message); + _ret.Result = false; + _ret.ErrorList.Add(e); + throw e; + } + return _ret; + } + + /// + /// 本特勒收货信息导入 + /// + /// + /// + /// + /// + public static ResultObject EXCEL_TA_RECEIVING(List p_order_list, string site, string p_creator) + { + ResultObject _ret = new ResultObject(); + try + { + using (ScpEntities db = EntitiesFactory.CreateScpInstance()) + { + int number = 1; + List lineError = new List(); + List ErrorList = new List(); + var _lst = p_order_list; + + _lst.ForEach(p => + { + var _ls = CheckExcelMode_Receiving(db, p, site); + if (_ls.Count > 0) + { + lineError.Add(number.ToString()); + ErrorList.Add(string.Join("
", _ls.ToArray())); + } + number++; + }); + if (lineError.Count > 0) + { + _ret.State = ReturnStatus.Failed; + _ret.MessageList.AddRange(ErrorList); + _ret.Result = false; + } + else + { + _lst.ForEach(p => + { + + var _partdes = db.TA_Receiving_Information.Count(t => t.Shift == p.班次); + if (_partdes == 0) + { + TA_Receiving_Information _entity = new TA_Receiving_Information(); + + _entity.Shift = p.班次; + _entity.Name = p.收货人; + _entity.Phone = p.收货人电话; + db.TA_Receiving_Information.Add(_entity); + + } + else + { + var _partde = db.TA_Receiving_Information.FirstOrDefault(t => t.Shift == p.班次); + + + _partde.Name = p.收货人; + _partde.Phone = p.收货人电话; + db.TA_Receiving_Information.AddOrUpdate(_partde); + } + + + }); + if (_ret.MessageList.Count == 0) + { + int state = db.SaveChanges(); + if (state != -1) + { + _ret.State = ReturnStatus.Succeed; + _ret.Result = true; + } + else + { + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + } + } + else + { + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + } + } + } + + } + catch (System.Data.Entity.Validation.DbEntityValidationException dbEx)//捕获实体验证异常 + { + var sb = new StringBuilder(); + + foreach (var error in dbEx.EntityValidationErrors.ToList()) + { + + error.ValidationErrors.ToList().ForEach(i => + { + sb.AppendFormat("表:{0},字段:{1},信息:{2}\r\n", error.Entry.Entity.GetType().Name, i.PropertyName, i.ErrorMessage); + }); + } + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + _ret.ErrorList.Add(dbEx); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "EXCEL_VENDER_PART_MOD", sb.ToString()); + throw new ScpException(ResultCode.DbEntityValidationException, sb.ToString(), "字段验证失败" + sb.ToString()); + } + catch (OptimisticConcurrencyException ex)//并发冲突异常 + { + + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + _ret.ErrorList.Add(ex); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "EXCEL_VENDER_PART_MOD", ex.ToString()); + throw new ScpException(ResultCode.Exception, "9999", ex.ToString()); + } + catch (ScpException ex) + { + + + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + _ret.ErrorList.Add(ex); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "EXCEL_VENDER_PART_MOD", ex.ToString()); + + if (ex.InnerException != null && ex.InnerException.GetType() == typeof(UpdateException)) + { + var inner = (UpdateException)ex.InnerException; + + + throw new ScpException(ResultCode.Exception, "0000", ex.ToString()); + } + else + { + if (ex.InnerException != null) throw ex.InnerException; + } + } + catch (Exception e) + { + _ret.State = ReturnStatus.Failed; + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "EXCEL_VENDER_PART_MOD", e.Message); + _ret.Result = false; + _ret.ErrorList.Add(e); + throw e; + } + return _ret; + } + /// + /// 子零件导入 + /// + /// + /// + /// + /// + public static ResultObject EXCEL_VENDER_PART_MOD2(List p_order_list, string site, string p_creator) + { + ResultObject _ret = new ResultObject(); + try + { + using (ScpEntities db = EntitiesFactory.CreateScpInstance()) + { + + + int number = 1; + List lineError = new List(); + List ErrorList = new List(); + var _lst = p_order_list; + _lst.ForEach(p => + { + var _count = _lst.Count(itm => itm.零件号 == p.零件号); + if (_count > 1) + { + lineError.Add(string.Format("零件号有重复", p.零件号)); + ErrorList = lineError; + } + }); + _lst.ForEach(p => + { + var _ls = CheckExcelMode_CousmterPart1(db, p, site); + if (_ls.Count > 0) + { + lineError.Add(number.ToString()); + ErrorList.Add(string.Join("
", _ls.ToArray())); + } + number++; + }); + if (lineError.Count > 0) + { + _ret.State = ReturnStatus.Failed; + _ret.MessageList.AddRange(ErrorList); + _ret.Result = false; + } + else + { + _lst.ForEach(p => + { + + var _coustomerpart = db.TA_SubPart.Count(t => t.PartCode == p.零件号.ToUpper()); + if (_coustomerpart == 0) + { + TA_SubPart subpa = new TA_SubPart(); + subpa.SubPart = p.客户零件号; + subpa.PartCode = p.零件号; + db.TA_SubPart.AddOrUpdate(subpa); + } + else + { + var subpa = db.TA_SubPart.FirstOrDefault(t => t.PartCode == p.零件号.ToUpper()); + subpa.SubPart = p.客户零件号; + db.TA_SubPart.AddOrUpdate(subpa); + } + + }); + if (_ret.MessageList.Count == 0) + { + int state = db.SaveChanges(); + if (state != -1) + { + _ret.State = ReturnStatus.Succeed; + _ret.Result = true; + } + else + { + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + } + } + else + { + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + } + } + } + + } + catch (System.Data.Entity.Validation.DbEntityValidationException dbEx)//捕获实体验证异常 + { + var sb = new StringBuilder(); + + foreach (var error in dbEx.EntityValidationErrors.ToList()) + { + + error.ValidationErrors.ToList().ForEach(i => + { + sb.AppendFormat("表:{0},字段:{1},信息:{2}\r\n", error.Entry.Entity.GetType().Name, i.PropertyName, i.ErrorMessage); + }); + } + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + _ret.ErrorList.Add(dbEx); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "EXCEL_VENDER_PART_MOD", sb.ToString()); + throw new ScpException(ResultCode.DbEntityValidationException, sb.ToString(), "字段验证失败" + sb.ToString()); + } + catch (OptimisticConcurrencyException ex)//并发冲突异常 + { + + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + _ret.ErrorList.Add(ex); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "EXCEL_VENDER_PART_MOD", ex.ToString()); + throw new ScpException(ResultCode.Exception, "9999", ex.ToString()); + } + catch (ScpException ex) + { + + + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + _ret.ErrorList.Add(ex); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "EXCEL_VENDER_PART_MOD", ex.ToString()); + + if (ex.InnerException != null && ex.InnerException.GetType() == typeof(UpdateException)) + { + var inner = (UpdateException)ex.InnerException; + + + throw new ScpException(ResultCode.Exception, "0000", ex.ToString()); + } + else + { + if (ex.InnerException != null) throw ex.InnerException; + } + } + catch (Exception e) + { + _ret.State = ReturnStatus.Failed; + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "EXCEL_VENDER_PART_MOD", e.Message); + _ret.Result = false; + _ret.ErrorList.Add(e); + throw e; + } + return _ret; + } + /// + /// 采购组导入 + /// + /// + /// + /// + /// + public static ResultObject EXCEL_VENDER_PART_MOD4(List p_order_list, string site, string p_creator) + { + ResultObject _ret = new ResultObject(); + try + { + using (ScpEntities db = EntitiesFactory.CreateScpInstance()) + { + int number = 1; + List lineError = new List(); + List ErrorList = new List(); + var _lst = p_order_list; + + _lst.ForEach(p => + { + var _ls = CheckExcelMode_PurchasingGroup(db, p, site); + if (_ls.Count > 0) + { + lineError.Add(number.ToString()); + ErrorList.Add(string.Join("
", _ls.ToArray())); + } + number++; + }); + if (lineError.Count > 0) + { + _ret.State = ReturnStatus.Failed; + _ret.MessageList.AddRange(ErrorList); + _ret.Result = false; + } + else + { + _lst.ForEach(p => + { + + var _venderpart = db.TA_PurchasGroup.SingleOrDefault(t => t.PurchasingGroup == p.采购组.ToUpper() && t.ChineseName == p.中文名称.ToUpper()) ?? + new TA_PurchasGroup + { + PurchasingGroup = p.采购组.ToUpper(), + ChineseName = p.中文名称.ToUpper(), + Describe=p.描述.ToUpper(), + }; + //_venderpart.Model = p.车型.ToUpper(); + db.TA_PurchasGroup.AddOrUpdate(_venderpart); + }); + if (_ret.MessageList.Count == 0) + { + int state = db.SaveChanges(); + if (state != -1) + { + _ret.State = ReturnStatus.Succeed; + _ret.Result = true; + } + else + { + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + } + } + else + { + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + } + } + } + + } + catch (System.Data.Entity.Validation.DbEntityValidationException dbEx)//捕获实体验证异常 + { + var sb = new StringBuilder(); + + foreach (var error in dbEx.EntityValidationErrors.ToList()) + { + + error.ValidationErrors.ToList().ForEach(i => + { + sb.AppendFormat("表:{0},字段:{1},信息:{2}\r\n", error.Entry.Entity.GetType().Name, i.PropertyName, i.ErrorMessage); + }); + } + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + _ret.ErrorList.Add(dbEx); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "EXCEL_VENDER_PART_MOD", sb.ToString()); + throw new ScpException(ResultCode.DbEntityValidationException, sb.ToString(), "字段验证失败" + sb.ToString()); + } + catch (OptimisticConcurrencyException ex)//并发冲突异常 + { + + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + _ret.ErrorList.Add(ex); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "EXCEL_VENDER_PART_MOD", ex.ToString()); + throw new ScpException(ResultCode.Exception, "9999", ex.ToString()); + } + catch (ScpException ex) + { + + + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + _ret.ErrorList.Add(ex); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "EXCEL_VENDER_PART_MOD", ex.ToString()); + + if (ex.InnerException != null && ex.InnerException.GetType() == typeof(UpdateException)) + { + var inner = (UpdateException)ex.InnerException; + + + throw new ScpException(ResultCode.Exception, "0000", ex.ToString()); + } + else + { + if (ex.InnerException != null) throw ex.InnerException; + } + } + catch (Exception e) + { + _ret.State = ReturnStatus.Failed; + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "EXCEL_VENDER_PART_MOD", e.Message); + _ret.Result = false; + _ret.ErrorList.Add(e); + throw e; + } + return _ret; + } + /// + /// 存储地点导入 + /// + /// + /// + /// + /// + public static ResultObject EXCEL_VENDER_PART_MOD5(List p_order_list, string site, string p_creator) + { + ResultObject _ret = new ResultObject(); + try + { + using (ScpEntities db = EntitiesFactory.CreateScpInstance()) + { + int number = 1; + List lineError = new List(); + List ErrorList = new List(); + var _lst = p_order_list; + + //_lst.ForEach(p => + //{ + // var _ls = CheckExcelMode_Sort(db, p, site); + // if (_ls.Count > 0) + // { + // lineError.Add(number.ToString()); + // ErrorList.Add(string.Join("
", _ls.ToArray())); + // } + // number++; + //}); + if (lineError.Count > 0) + { + _ret.State = ReturnStatus.Failed; + _ret.MessageList.AddRange(ErrorList); + _ret.Result = false; + } + else + { + _lst.ForEach(p => + { + + var _venderpart = db.TA_StorageLocation.SingleOrDefault(t => t.StLocation == p.存储地点.ToUpper() && t.Arrangement == p.层次.ToUpper()) ?? + new TA_StorageLocation + { + StLocation = p.存储地点.ToUpper(), + Arrangement = p.层次.ToUpper(), + Leveldescription = p.层次描述.ToUpper(), + Describe = p.描述.ToUpper(), + Inventoryation = p.存货标识.ToUpper(), + }; + //_venderpart.Model = p.车型.ToUpper(); + db.TA_StorageLocation.AddOrUpdate(_venderpart); + }); + if (_ret.MessageList.Count == 0) + { + int state = db.SaveChanges(); + if (state != -1) + { + _ret.State = ReturnStatus.Succeed; + _ret.Result = true; + } + else + { + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + } + } + else + { + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + } + } + } + + } + catch (System.Data.Entity.Validation.DbEntityValidationException dbEx)//捕获实体验证异常 + { + var sb = new StringBuilder(); + + foreach (var error in dbEx.EntityValidationErrors.ToList()) + { + + error.ValidationErrors.ToList().ForEach(i => + { + sb.AppendFormat("表:{0},字段:{1},信息:{2}\r\n", error.Entry.Entity.GetType().Name, i.PropertyName, i.ErrorMessage); + }); + } + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + _ret.ErrorList.Add(dbEx); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "EXCEL_VENDER_PART_MOD", sb.ToString()); + throw new ScpException(ResultCode.DbEntityValidationException, sb.ToString(), "字段验证失败" + sb.ToString()); + } + catch (OptimisticConcurrencyException ex)//并发冲突异常 + { + + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + _ret.ErrorList.Add(ex); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "EXCEL_VENDER_PART_MOD", ex.ToString()); + throw new ScpException(ResultCode.Exception, "9999", ex.ToString()); + } + catch (ScpException ex) + { + + + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + _ret.ErrorList.Add(ex); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "EXCEL_VENDER_PART_MOD", ex.ToString()); + + if (ex.InnerException != null && ex.InnerException.GetType() == typeof(UpdateException)) + { + var inner = (UpdateException)ex.InnerException; + + + throw new ScpException(ResultCode.Exception, "0000", ex.ToString()); + } + else + { + if (ex.InnerException != null) throw ex.InnerException; + } + } + catch (Exception e) + { + _ret.State = ReturnStatus.Failed; + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "EXCEL_VENDER_PART_MOD", e.Message); + _ret.Result = false; + _ret.ErrorList.Add(e); + throw e; + } + return _ret; + } + /// + /// 品番导入 + /// + /// + /// + /// + /// + public static ResultObject EXCEL_VENDER_PART_MOD6(List p_order_list, string site, string p_creator) + { + ResultObject _ret = new ResultObject(); + try + { + using (ScpEntities db = EntitiesFactory.CreateScpInstance()) + { + int number = 1; + List lineError = new List(); + List ErrorList = new List(); + var _lst = p_order_list; + + _lst.ForEach(p => + { + var _ls = CheckExcelMode_Sort(db, p, site); + if (_ls.Count > 0) + { + lineError.Add(number.ToString()); + ErrorList.Add(string.Join("
", _ls.ToArray())); + } + number++; + }); + if (lineError.Count > 0) + { + _ret.State = ReturnStatus.Failed; + _ret.MessageList.AddRange(ErrorList); + _ret.Result = false; + } + else + { + _lst.ForEach(p => + { + + var _venderpart = db.TA_PinFan.SingleOrDefault(t => t.PartCode == p.品番.ToUpper() ) ?? + new TA_PinFan + { + PartCode = p.品番.ToUpper(), + Barcodnt = p.条码内容.ToUpper(), + Identification = p.Code39条码.ToUpper(), + }; + //_venderpart.Model = p.车型.ToUpper(); + db.TA_PinFan.AddOrUpdate(_venderpart); + }); + if (_ret.MessageList.Count == 0) + { + int state = db.SaveChanges(); + if (state != -1) + { + _ret.State = ReturnStatus.Succeed; + _ret.Result = true; + } + else + { + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + } + } + else + { + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + } + } + } + + } + catch (System.Data.Entity.Validation.DbEntityValidationException dbEx)//捕获实体验证异常 + { + var sb = new StringBuilder(); + + foreach (var error in dbEx.EntityValidationErrors.ToList()) + { + + error.ValidationErrors.ToList().ForEach(i => + { + sb.AppendFormat("表:{0},字段:{1},信息:{2}\r\n", error.Entry.Entity.GetType().Name, i.PropertyName, i.ErrorMessage); + }); + } + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + _ret.ErrorList.Add(dbEx); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "EXCEL_VENDER_PART_MOD", sb.ToString()); + throw new ScpException(ResultCode.DbEntityValidationException, sb.ToString(), "字段验证失败" + sb.ToString()); + } + catch (OptimisticConcurrencyException ex)//并发冲突异常 + { + + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + _ret.ErrorList.Add(ex); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "EXCEL_VENDER_PART_MOD", ex.ToString()); + throw new ScpException(ResultCode.Exception, "9999", ex.ToString()); + } + catch (ScpException ex) + { + + + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + _ret.ErrorList.Add(ex); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "EXCEL_VENDER_PART_MOD", ex.ToString()); + + if (ex.InnerException != null && ex.InnerException.GetType() == typeof(UpdateException)) + { + var inner = (UpdateException)ex.InnerException; + + + throw new ScpException(ResultCode.Exception, "0000", ex.ToString()); + } + else + { + if (ex.InnerException != null) throw ex.InnerException; + } + } + catch (Exception e) + { + _ret.State = ReturnStatus.Failed; + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "EXCEL_VENDER_PART_MOD", e.Message); + _ret.Result = false; + _ret.ErrorList.Add(e); + throw e; + } + return _ret; + } + /// + /// 箱种导入 + /// + /// + /// + /// + /// + public static ResultObject EXCEL_Box_Type(List p_order_list, string site, string p_creator) + { + ResultObject _ret = new ResultObject(); + try + { + using (ScpEntities db = EntitiesFactory.CreateScpInstance()) + { + int number = 1; + List lineError = new List(); + List ErrorList = new List(); + var _lst = p_order_list; + + _lst.ForEach(p => + { + var _ls = CheckExcelMode_Box(db, p, site); + if (_ls.Count > 0) + { + lineError.Add(number.ToString()); + ErrorList.Add(string.Join("
", _ls.ToArray())); + } + var _count = _lst.Count(itm => itm.箱种 == p.箱种); + if (_count > 1) + { + lineError.Add(string.Format("箱种有重复", p.箱种)); + ErrorList = lineError; + } + number++; + }); + if (lineError.Count > 0) + { + _ret.State = ReturnStatus.Failed; + _ret.MessageList.AddRange(ErrorList); + _ret.Result = false; + } + else + { + _lst.ForEach(p => + { + + var _boxtype = db.TA_BOXTYPE.SingleOrDefault(t => t.BoxType == p.箱种.ToUpper()) ?? + new TA_BOXTYPE + { + BoxType = p.箱种 + + }; + _boxtype.CreateTime = DateTime.Now; + _boxtype.CreateUser = p_creator; + _boxtype.Enabled = p.打印托盘码 == "是" ? true : false; + db.TA_BOXTYPE.AddOrUpdate(_boxtype); + }); + if (_ret.MessageList.Count == 0) + { + int state = db.SaveChanges(); + if (state != -1) + { + _ret.State = ReturnStatus.Succeed; + _ret.Result = true; + } + else + { + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + } + } + else + { + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + } + } + } + + } + catch (System.Data.Entity.Validation.DbEntityValidationException dbEx)//捕获实体验证异常 + { + var sb = new StringBuilder(); + + foreach (var error in dbEx.EntityValidationErrors.ToList()) + { + + error.ValidationErrors.ToList().ForEach(i => + { + sb.AppendFormat("表:{0},字段:{1},信息:{2}\r\n", error.Entry.Entity.GetType().Name, i.PropertyName, i.ErrorMessage); + }); + } + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + _ret.ErrorList.Add(dbEx); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "EXCEL_VENDER_PART_MOD", sb.ToString()); + throw new ScpException(ResultCode.DbEntityValidationException, sb.ToString(), "字段验证失败" + sb.ToString()); + } + catch (OptimisticConcurrencyException ex)//并发冲突异常 + { + + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + _ret.ErrorList.Add(ex); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "EXCEL_VENDER_PART_MOD", ex.ToString()); + throw new ScpException(ResultCode.Exception, "9999", ex.ToString()); + } + catch (ScpException ex) + { + + + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + _ret.ErrorList.Add(ex); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "EXCEL_VENDER_PART_MOD", ex.ToString()); + + if (ex.InnerException != null && ex.InnerException.GetType() == typeof(UpdateException)) + { + var inner = (UpdateException)ex.InnerException; + + + throw new ScpException(ResultCode.Exception, "0000", ex.ToString()); + } + else + { + if (ex.InnerException != null) throw ex.InnerException; + } + } + catch (Exception e) + { + _ret.State = ReturnStatus.Failed; + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "EXCEL_VENDER_PART_MOD", e.Message); + _ret.Result = false; + _ret.ErrorList.Add(e); + throw e; + } + return _ret; + } + /// + /// 本特勒车型导入 + /// + /// + /// + /// + /// + public static ResultObject EXCEL_Car_Model(List p_order_list, string site, string p_creator) + { + ResultObject _ret = new ResultObject(); + try + { + using (ScpEntities db = EntitiesFactory.CreateScpInstance()) + { + int number = 1; + List lineError = new List(); + List ErrorList = new List(); + var _lst = p_order_list; + + _lst.ForEach(p => + { + var _ls = CheckExcel_Model(db, p, site); + if (_ls.Count > 0) + { + lineError.Add(number.ToString()); + ErrorList.Add(string.Join("
", _ls.ToArray())); + } + number++; + + }); + _lst.ForEach(p => + { + var _count = _lst.Count(itm => itm.车型 == p.车型); + if (_count > 1) + { + lineError.Add(string.Format("车型【{0}】有重复", p.车型)); + ErrorList = lineError; + } + }); + if (lineError.Count > 0) + { + _ret.State = ReturnStatus.Failed; + _ret.MessageList.AddRange(ErrorList); + _ret.Result = false; + } + else + { + _lst.ForEach(p => + { + TA_CarModel Car = new TA_CarModel(); + Car.Model = p.车型; + + db.TA_CarModel.AddOrUpdate(Car); + }); + if (_ret.MessageList.Count == 0) + { + int state = db.SaveChanges(); + if (state != -1) + { + _ret.State = ReturnStatus.Succeed; + _ret.Result = true; + } + else + { + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + } + } + else + { + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + } + } + } + + } + catch (System.Data.Entity.Validation.DbEntityValidationException dbEx)//捕获实体验证异常 + { + var sb = new StringBuilder(); + + foreach (var error in dbEx.EntityValidationErrors.ToList()) + { + + error.ValidationErrors.ToList().ForEach(i => + { + sb.AppendFormat("表:{0},字段:{1},信息:{2}\r\n", error.Entry.Entity.GetType().Name, i.PropertyName, i.ErrorMessage); + }); + } + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + _ret.ErrorList.Add(dbEx); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "EXCEL_VENDER_PART_MOD", sb.ToString()); + throw new ScpException(ResultCode.DbEntityValidationException, sb.ToString(), "字段验证失败" + sb.ToString()); + } + catch (OptimisticConcurrencyException ex)//并发冲突异常 + { + + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + _ret.ErrorList.Add(ex); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "EXCEL_VENDER_PART_MOD", ex.ToString()); + throw new ScpException(ResultCode.Exception, "9999", ex.ToString()); + } + catch (ScpException ex) + { + + + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + _ret.ErrorList.Add(ex); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "EXCEL_VENDER_PART_MOD", ex.ToString()); + + if (ex.InnerException != null && ex.InnerException.GetType() == typeof(UpdateException)) + { + var inner = (UpdateException)ex.InnerException; + + + throw new ScpException(ResultCode.Exception, "0000", ex.ToString()); + } + else + { + if (ex.InnerException != null) throw ex.InnerException; + } + } + catch (Exception e) + { + _ret.State = ReturnStatus.Failed; + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "EXCEL_VENDER_PART_MOD", e.Message); + _ret.Result = false; + _ret.ErrorList.Add(e); + throw e; + } + return _ret; + } + public static ResultObject EXCEL_VENDER_PART_MOD3(List p_order_list, string site, string p_creator) + { + ResultObject _ret = new ResultObject(); + try + { + using (ScpEntities db = EntitiesFactory.CreateScpInstance()) + { + int number = 1; + List lineError = new List(); + List ErrorList = new List(); + var _lst = p_order_list; + //_lst.ForEach(p => + //{ + // var _count = _lst.Count(itm => itm.零件号 == p.零件号); + // if (_count > 1) + // { + // lineError.Add(string.Format("零件编号有重复", p.零件号)); + // ErrorList = lineError; + // } + //}); + _lst.ForEach(p => + { + var _ls = CheckExcelMode_VenderPart1(db, p, site); + if (_ls.Count > 0) + { + lineError.Add(number.ToString()); + ErrorList.Add(string.Join("
", _ls.ToArray())); + } + number++; + }); + if (lineError.Count > 0) + { + _ret.State = ReturnStatus.Failed; + _ret.MessageList.AddRange(ErrorList); + _ret.Result = false; + } + else + { + _lst.ForEach(p => + { + + var _venderpart = db.TA_ProductionLine.SingleOrDefault(t => t.ProductionLine == p.产线.ToUpper() && t.PartCode == p.零件号.ToUpper()) ?? + new TA_ProductionLine + { + ProductionLine = p.产线.ToUpper(), + PartCode = p.零件号.ToUpper(), + + }; + //_venderpart.Model = p.车型.ToUpper(); + db.TA_ProductionLine.AddOrUpdate(_venderpart); + }); + if (_ret.MessageList.Count == 0) + { + int state = db.SaveChanges(); + if (state != -1) + { + _ret.State = ReturnStatus.Succeed; + _ret.Result = true; + } + else + { + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + } + } + else + { + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + } + } + } + + } + catch (System.Data.Entity.Validation.DbEntityValidationException dbEx)//捕获实体验证异常 + { + var sb = new StringBuilder(); + + foreach (var error in dbEx.EntityValidationErrors.ToList()) + { + + error.ValidationErrors.ToList().ForEach(i => + { + sb.AppendFormat("表:{0},字段:{1},信息:{2}\r\n", error.Entry.Entity.GetType().Name, i.PropertyName, i.ErrorMessage); + }); + } + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + _ret.ErrorList.Add(dbEx); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "EXCEL_VENDER_PART_MOD", sb.ToString()); + throw new ScpException(ResultCode.DbEntityValidationException, sb.ToString(), "字段验证失败" + sb.ToString()); + } + catch (OptimisticConcurrencyException ex)//并发冲突异常 + { + + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + _ret.ErrorList.Add(ex); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "EXCEL_VENDER_PART_MOD", ex.ToString()); + throw new ScpException(ResultCode.Exception, "9999", ex.ToString()); + } + catch (ScpException ex) + { + + + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + _ret.ErrorList.Add(ex); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "EXCEL_VENDER_PART_MOD", ex.ToString()); + + if (ex.InnerException != null && ex.InnerException.GetType() == typeof(UpdateException)) + { + var inner = (UpdateException)ex.InnerException; + + + throw new ScpException(ResultCode.Exception, "0000", ex.ToString()); + } + else + { + if (ex.InnerException != null) throw ex.InnerException; + } + } + catch (Exception e) + { + _ret.State = ReturnStatus.Failed; + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "EXCEL_VENDER_PART_MOD", e.Message); + _ret.Result = false; + _ret.ErrorList.Add(e); + throw e; + } + return _ret; + } + /// + /// 供应商导入 + /// + /// + /// + /// + /// + public static ResultObject EXCEL_VENDER_MOD(List p_order_list, string site, string p_creator) + { + ResultObject _ret = new ResultObject(); + try + { + using (ScpEntities db = EntitiesFactory.CreateScpInstance()) + { + int number = 1; + List lineError = new List(); + List ErrorList = new List(); + var _lst = p_order_list; + _lst.ForEach(p => + { + var _count = _lst.Count(itm => itm.供应商编号 == p.供应商编号); + if (_count > 1) + { + lineError.Add(string.Format("导入零件编号{0}有重复", p.供应商编号)); + ErrorList = lineError; + } + }); + _lst.ForEach(p => + { + var _ls = CheckExcelMode_Vender(db, p, site); + if (_ls.Count > 0) + { + lineError.Add(number.ToString()); + ErrorList.Add(string.Join("
", _ls.ToArray())); + } + number++; + }); + if (lineError.Count > 0) + { + _ret.State = ReturnStatus.Failed; + _ret.MessageList.AddRange(ErrorList); + _ret.Result = false; + } + else + { + _lst.ForEach(p => + { + var _vender = db.TA_VENDER.SingleOrDefault(t => t.VendId == p.供应商编号.ToUpper()) ?? + new TA_VENDER { VendId = p.供应商编号.ToUpper(), State = 1 }; + _vender.VendName = p.供应商名称; + _vender.VendAbbCode = string.IsNullOrEmpty(p.供应商缩写) ? "0" : p.供应商缩写; + _vender.VendType = p.供应商类型; + _vender.Country = p.国家; + _vender.City = p.城市; + _vender.Currency = p.币种; + _vender.Address = p.地址; + _vender.ZipCode = p.邮编; + _vender.Contacter = p.联系人; + _vender.Phone = p.电话; + _vender.Fax = p.传真; + _vender.Remark = p.备注; + _vender.Tax = Convert.ToDecimal(p.税率); + _vender.Site = site; + db.TA_VENDER.AddOrUpdate(_vender); + }); + if (_ret.MessageList.Count == 0) + { + int state = db.SaveChanges(); + if (state != -1) + { + _ret.State = ReturnStatus.Succeed; + _ret.Result = true; + } + else + { + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + } + } + else + { + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + } + } + } + + } + catch (System.Data.Entity.Validation.DbEntityValidationException dbEx)//捕获实体验证异常 + { + var sb = new StringBuilder(); + + foreach (var error in dbEx.EntityValidationErrors.ToList()) + { + + error.ValidationErrors.ToList().ForEach(i => + { + sb.AppendFormat("表:{0},字段:{1},信息:{2}\r\n", error.Entry.Entity.GetType().Name, i.PropertyName, i.ErrorMessage); + }); + } + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + _ret.ErrorList.Add(dbEx); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "EXCEL_VENDER_MOD", sb.ToString()); + throw new ScpException(ResultCode.DbEntityValidationException, sb.ToString(), "字段验证失败" + sb.ToString()); + } + catch (OptimisticConcurrencyException ex)//并发冲突异常 + { + + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + _ret.ErrorList.Add(ex); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "EXCEL_VENDER_MOD", ex.ToString()); + throw new ScpException(ResultCode.Exception, "9999", ex.ToString()); + } + catch (ScpException ex) + { + + + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + _ret.ErrorList.Add(ex); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "EXCEL_VENDER_MOD", ex.ToString()); + + if (ex.InnerException != null && ex.InnerException.GetType() == typeof(UpdateException)) + { + var inner = (UpdateException)ex.InnerException; + + + throw new ScpException(ResultCode.Exception, "0000", ex.ToString()); + } + else + { + if (ex.InnerException != null) throw ex.InnerException; + } + } + catch (Exception e) + { + _ret.State = ReturnStatus.Failed; + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "EXCEL_VENDER_MOD", e.Message); + _ret.Result = false; + _ret.ErrorList.Add(e); + throw e; + } + return _ret; + } + /// + /// 价格导入 + /// + /// + /// + /// + /// + public static ResultObject EXCEL_PRICE_MOD(List p_order_list, string site, string p_creator) + { + ResultObject _ret = new ResultObject(); + try + { + using (ScpEntities db = EntitiesFactory.CreateScpInstance()) + { + int number = 1; + List lineError = new List(); + List ErrorList = new List(); + var _lst = p_order_list; + _lst.ForEach + (p => + { + var _ls = CheckExcelMode_Price(db, p, site); + if (_ls.Count > 0) + { + lineError.Add(number.ToString()); + ErrorList.Add(string.Join("
", _ls.ToArray())); + } + number++; + }); + if (lineError.Count > 0) + { + _ret.State = ReturnStatus.Failed; + _ret.MessageList.AddRange(ErrorList); + _ret.Result = false; + } + else + { + + + + + + _lst.ForEach(p => + { + var _price = new TB_PRICE(); + _price.VendId = p.供应商编号.Trim(); + _price.PartCode = p.零件编码.Trim(); + _price.StartTime = DateTime.Parse(p.开始时间); + _price.EndTime = DateTime.Parse(p.结束时间); + _price.Curr = p.币种; + _price.Unit = p.单位; + _price.Amt = decimal.Parse(p.价格); + _price.Site = site.Trim(); + _price.Remarks = p.备注; + db.TB_PRICE.Add(_price); + }); + if (_ret.MessageList.Count == 0) + { + int state = db.SaveChanges(); + if (state != -1) + { + _ret.State = ReturnStatus.Succeed; + _ret.Result = true; + } + else + { + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + } + } + else + { + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + } + } + } + } + catch (System.Data.Entity.Validation.DbEntityValidationException dbEx)//捕获实体验证异常 + { + var sb = new StringBuilder(); + + foreach (var error in dbEx.EntityValidationErrors.ToList()) + { + + error.ValidationErrors.ToList().ForEach(i => + { + sb.AppendFormat("表:{0},字段:{1},信息:{2}\r\n", error.Entry.Entity.GetType().Name, i.PropertyName, i.ErrorMessage); + }); + } + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + _ret.ErrorList.Add(dbEx); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "EXCEL_PRICE_MOD", sb.ToString()); + throw new ScpException(ResultCode.DbEntityValidationException, sb.ToString(), "字段验证失败" + sb.ToString()); + } + catch (OptimisticConcurrencyException ex)//并发冲突异常 + { + + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + _ret.ErrorList.Add(ex); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "EXCEL_PRICE_MOD", ex.ToString()); + throw new ScpException(ResultCode.Exception, "9999", ex.ToString()); + } + catch (ScpException ex) + { + + + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + _ret.ErrorList.Add(ex); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "EXCEL_PRICE_MOD", ex.ToString()); + + if (ex.InnerException != null && ex.InnerException.GetType() == typeof(UpdateException)) + { + var inner = (UpdateException)ex.InnerException; + + + throw new ScpException(ResultCode.Exception, "0000", ex.ToString()); + } + else + { + if (ex.InnerException != null) throw ex.InnerException; + } + } + catch (Exception e) + { + _ret.State = ReturnStatus.Failed; + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "EXCEL_PRICE_MOD", e.Message); + _ret.Result = false; + _ret.ErrorList.Add(e); + throw e; + } + return _ret; + } + /// + /// 零件导入 + /// + /// + /// + /// + /// + public static ResultObject EXCEL_PART_MOD(List p_order_list, string site, string p_creator) + { + ResultObject _ret = new ResultObject(); + try + { + using (ScpEntities db = EntitiesFactory.CreateScpInstance()) + { + int number = 1; + List lineError = new List(); + List ErrorList = new List(); + var _lst = p_order_list; + _lst.ForEach(p => + { + var _count = _lst.Count(itm => itm.零件编号 == p.零件编号); + if (_count > 1) + { + lineError.Add(string.Format("导入零件编号{0}有重复", p.零件编号)); + ErrorList = lineError; + } + }); + _lst.ForEach + (p => + { + var _ls = CheckExcelMode_Part(db, p, site); + if (_ls.Count > 0) + { + lineError.Add(number.ToString()); + ErrorList.Add(string.Join("
", _ls.ToArray())); + } + number++; + }); + if (lineError.Count > 0) + { + _ret.State = ReturnStatus.Failed; + _ret.MessageList.AddRange(ErrorList); + _ret.Result = false; + } + else + { + _lst.ForEach(p => + { + var _part = db.TA_PART.SingleOrDefault(t => t.PartCode == p.零件编号.ToUpper()) ?? + new TA_PART { PartCode = p.零件编号.ToUpper() }; + _part.PartCode = p.零件编号; + _part.ErpPartCode = p.零件编号; + _part.PartDesc1 = p.零件名称; + _part.PartDesc2 = ""; + _part.ProjectId = p.项目编号; + _part.Unit = p.单位; + _part.PartGroup = p.项目编号; + _part.State = p.状态; + _part.Site = site; + db.TA_PART.AddOrUpdate(_part); + }); + if (_ret.MessageList.Count == 0) + { + int state = db.SaveChanges(); + if (state != -1) + { + _ret.State = ReturnStatus.Succeed; + _ret.Result = true; + } + else + { + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + } + } + else + { + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + } + } + } + } + catch (System.Data.Entity.Validation.DbEntityValidationException dbEx)//捕获实体验证异常 + { + var sb = new StringBuilder(); + + foreach (var error in dbEx.EntityValidationErrors.ToList()) + { + + error.ValidationErrors.ToList().ForEach(i => + { + sb.AppendFormat("表:{0},字段:{1},信息:{2}\r\n", error.Entry.Entity.GetType().Name, i.PropertyName, i.ErrorMessage); + }); + } + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + _ret.ErrorList.Add(dbEx); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "EXCEL_PART_MOD", sb.ToString()); + throw new ScpException(ResultCode.DbEntityValidationException, sb.ToString(), "字段验证失败" + sb.ToString()); + } + catch (OptimisticConcurrencyException ex)//并发冲突异常 + { + + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + _ret.ErrorList.Add(ex); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "EXCEL_PART_MOD", ex.ToString()); + throw new ScpException(ResultCode.Exception, "9999", ex.ToString()); + } + catch (ScpException ex) + { + + + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + _ret.ErrorList.Add(ex); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "EXCEL_PART_MOD", ex.ToString()); + + if (ex.InnerException != null && ex.InnerException.GetType() == typeof(UpdateException)) + { + var inner = (UpdateException)ex.InnerException; + + + throw new ScpException(ResultCode.Exception, "0000", ex.ToString()); + } + else + { + if (ex.InnerException != null) throw ex.InnerException; + } + } + catch (Exception e) + { + _ret.State = ReturnStatus.Failed; + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "EXCEL_PART_MOD", e.Message); + _ret.Result = false; + _ret.ErrorList.Add(e); + throw e; + } + return _ret; + } + /// + /// 订单导入 + /// + /// + /// + /// + /// + /// + /// + public static ResultObject EXCEL_PO_MOD(List p_order_list, string site, string p_creator, DateTime p_time, PoState p_modtype) + { + ResultObject _ret = new ResultObject(); + try + { + using (ScpEntities db = EntitiesFactory.CreateScpInstance()) + { + int number = 1; + List lineError = new List(); + List ErrorList = new List(); + var _lst = p_order_list; + DataTable ds = new DataTable(); + _lst.ForEach + (p => + { + var _ls = CheckExcelMode_Po(db, p); + if (_ls.Count > 0) + { + lineError.Add(number.ToString()); + ErrorList.Add(string.Join("
", _ls.ToArray())); + } + number++; + }); + if (lineError.Count > 0) + { + _ret.State = ReturnStatus.Failed; + _ret.MessageList.AddRange(ErrorList); + _ret.Result = false; + } + else + { + List poList = new List(); + List po_Detail = new List(); + List askList = new List(); + List askDetailList = new List(); + List uniList = new List(); + //先循环找到一个日期的订单 + foreach (DataColumn column in ds.Columns) + { + DateTime date = DateTime.MaxValue; + DateTime.TryParse(column.ColumnName, out date); + + if (date != DateTime.MaxValue) + { + //找到所有日期下订单 + foreach (DataRow dataRow in ds.Rows)//订单分组表 + { + decimal _Qty = 0; + decimal.TryParse(dataRow[column.ColumnName].ToString(), out _Qty); + if (_Qty > 0) + { + //创建主单据及看板 + var _Po = CreatePo1(poList, dataRow, date, p_creator,site); + //创建主单据及看板 + var _PoAsk = CreateAsk1(poList, askList, dataRow, date, p_creator,db,site); + //创建明细 + var _PoDetail = CreatePoDetail1(dataRow, _Qty, db, date, _Po, _PoAsk, p_creator,site); + po_Detail.Add(_PoDetail); + var _Askdetail = CreateAskDetail1(db, dataRow, _Po, _PoAsk, _PoDetail, p_creator,site); + askDetailList.Add(_Askdetail); + var Tsuniapi = CreateTsuniapi1(_Po, _PoAsk, _PoDetail, dataRow, _Askdetail,site); + uniList.Add(Tsuniapi); + } + } + } + } + + var billGroups= poList.GroupBy(p=>new { p.VendId,p.EndTime}); + foreach (var item in billGroups) ; + db.TB_PO.AddRange(poList); + db.TB_ASK.AddRange(askList); + db.TB_PO_DETAIL.AddRange(po_Detail); + db.TB_ASK_DETAIL.AddRange(askDetailList); + db.TS_UNI_API.AddRange(uniList); + if (_ret.MessageList.Count == 0) + { + int state = db.SaveChanges(); + if (state != -1) + { + _ret.State = ReturnStatus.Succeed; + _ret.Result = true; + } + else + { + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + } + } + else + { + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + } + } + + } + //} + } + + catch (System.Data.Entity.Validation.DbEntityValidationException dbEx)//捕获实体验证异常 + { + var sb = new StringBuilder(); + + foreach (var error in dbEx.EntityValidationErrors.ToList()) + { + + error.ValidationErrors.ToList().ForEach(i => + { + sb.AppendFormat("表:{0},字段:{1},信息:{2}\r\n", error.Entry.Entity.GetType().Name, i.PropertyName, i.ErrorMessage); + }); + } + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + _ret.ErrorList.Add(dbEx); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "EXCEL_PO_MOD", sb.ToString()); + throw new ScpException(ResultCode.DbEntityValidationException, sb.ToString(), "字段验证失败" + sb.ToString()); + } + catch (OptimisticConcurrencyException ex)//并发冲突异常 + { + + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + _ret.ErrorList.Add(ex); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "EXCEL_PO_MOD", ex.ToString()); + throw new ScpException(ResultCode.Exception, "9999", ex.ToString()); + } + catch (ScpException ex) + { + + + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + _ret.ErrorList.Add(ex); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "EXCEL_PO_MOD", ex.ToString()); + + if (ex.InnerException != null && ex.InnerException.GetType() == typeof(UpdateException)) + { + var inner = (UpdateException)ex.InnerException; + + + throw new ScpException(ResultCode.Exception, "0000", ex.ToString()); + } + else + { + if (ex.InnerException != null) throw ex.InnerException; + } + } + catch (Exception e) + { + _ret.State = ReturnStatus.Failed; + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "EXCEL_PO_MOD", e.Message); + _ret.Result = false; + _ret.ErrorList.Add(e); + throw e; + } + return _ret; + } + /// + /// 富维普通订单导入 + /// + /// + /// + /// + /// + /// + /// + public static ResultObject EXCEL_PO_MOD2(DataTable p_order_list1, List p_order_list, string site, string p_creator, DateTime p_time, PoState p_modtype) + { + ResultObject _ret = new ResultObject(); + try + { + using (ScpEntities db = EntitiesFactory.CreateScpInstance()) + { + int number = 1; + List lineError = new List(); + List ErrorList = new List(); + var _lst = p_order_list; + + _lst.ForEach + (p => + { + var _count = _lst.Count(itm => itm.物料号码 == p.物料号码 && itm.供应商编号 == p.供应商编号); + if (_count > 1) + { + lineError.Add(string.Format("导入的物料号码{0}有重复", p.物料号码)); + ErrorList = lineError; + } + var _ls = CheckExcelMode_Po(db, p); + if (_ls.Count > 0) + { + lineError.Add(number.ToString()); + ErrorList.Add(string.Join("
", _ls.ToArray())); + } + number++; + }); + if (lineError.Count > 0) + { + _ret.State = ReturnStatus.Failed; + _ret.MessageList.AddRange(ErrorList); + _ret.Result = false; + } + else + { + + List poList = new List(); + List po_DetailList = new List(); + List askList = new List(); + List askDetailList = new List(); + List uniList = new List(); + //先循环找到一个日期的订单 + foreach (DataColumn column in p_order_list1.Columns) + { + DateTime date = DateTime.MaxValue; + DateTime.TryParse(column.ColumnName, out date); + + if (date != DateTime.MaxValue && date.Year > 2000) + { + //找到所有日期下订单 + foreach (DataRow dataRow in p_order_list1.Rows)//订单分组表 + { + decimal _Qty = 0; + decimal.TryParse(dataRow[column.ColumnName].ToString(), out _Qty); + if (_Qty > 0) + { + // 创建主单据及看板 + var _Po = CreatePo1( poList, dataRow, date, p_creator, site); + // 创建主单据及看板 + var _PoAsk = CreateAsk1(poList, askList, dataRow, date, p_creator,db,site); + //创建明细 + var _PoDetail = CreatePoDetail1(dataRow, _Qty, db, date, _Po, _PoAsk, p_creator,site); + po_DetailList.Add(_PoDetail); + var _Askdetail = CreateAskDetail1(db, dataRow, _Po, _PoAsk, _PoDetail, p_creator,site); + askDetailList.Add(_Askdetail); + var Tsuniapi = CreateTsuniapi1(_Po, _PoAsk, _PoDetail,dataRow, _Askdetail,site); + uniList.Add(Tsuniapi); + } + } + } + } + int cnt = 1; + foreach (var item in poList) + { + + var oldGuid = item.PoBillNum; + + var newBillId = SCP_BILLCODE_CONTROLLER.MakePOCode2();//订单号 + if (item.Site != "W21") + { + newBillId=SCP_BILLCODE_CONTROLLER.MakePOCode4();//订单号 + } + + var newAskNum = SCP_BILLCODE_CONTROLLER.MakeASKCodeByNum(cnt); + + var add_Po = item.Clone(newBillId, item.Site); + db.TB_PO.Add(add_Po); + + var Add_Po_DETAIL = po_DetailList.Where(p => p.PoBillNum == oldGuid).ToList(); + int cntPo_detail = 1; + Add_Po_DETAIL.ForEach(p => p.PoBillNum = newBillId); + Add_Po_DETAIL.ForEach(p => + { + p.PoLine = cntPo_detail; + cntPo_detail++; + }); + db.TB_PO_DETAIL.AddRange(Add_Po_DETAIL); + + var Add_AskList = askList.Where(p => p.PoBillNum == oldGuid).ToList(); + Add_AskList.ForEach(p => p.PoBillNum = newBillId); + Add_AskList.ForEach(p => p.AskBillNum = newAskNum); + Add_AskList.ForEach(p => p.ErpBillNum = newBillId); + db.TB_ASK.AddRange(Add_AskList); + + var Add_ASK_DETAIL = askDetailList.Where(p => p.PoBillNum == oldGuid).ToList(); + Add_ASK_DETAIL.ForEach(p => p.PoBillNum = newBillId); + int cntAsk_detail = 1; + Add_ASK_DETAIL.ForEach(p => p.AskBillNum = newAskNum); + Add_ASK_DETAIL.ForEach(p => + { + p.PoLine = cntAsk_detail; + cntAsk_detail++; + }); + db.TB_ASK_DETAIL.AddRange(Add_ASK_DETAIL); + + var Add_UniList = uniList.Where(p => p.BillNum == oldGuid).ToList(); + int cntTS_detail = 1; + Add_UniList.ForEach(p => + { + p.ErpLineNum = cntTS_detail; + cntTS_detail++; + }); + Add_UniList.ForEach(p => p.BillNum = newBillId); + + db.TS_UNI_API.AddRange(Add_UniList); + if (_ret.MessageList.Count == 0) + { + int state = db.SaveChanges(); + if (state != -1) + { + _ret.State = ReturnStatus.Succeed; + _ret.Result = true; + } + else + { + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + } + } + else + { + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + } + } + + } + //} + } + } + catch (System.Data.Entity.Validation.DbEntityValidationException dbEx)//捕获实体验证异常 + { + var sb = new StringBuilder(); + + foreach (var error in dbEx.EntityValidationErrors.ToList()) + { + + error.ValidationErrors.ToList().ForEach(i => + { + sb.AppendFormat("表:{0},字段:{1},信息:{2}\r\n", error.Entry.Entity.GetType().Name, i.PropertyName, i.ErrorMessage); + }); + } + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + _ret.ErrorList.Add(dbEx); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "EXCEL_PO_MOD", sb.ToString()); + throw new ScpException(ResultCode.DbEntityValidationException, sb.ToString(), "字段验证失败" + sb.ToString()); + } + catch (OptimisticConcurrencyException ex)//并发冲突异常 + { + + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + _ret.ErrorList.Add(ex); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "EXCEL_PO_MOD", ex.ToString()); + throw new ScpException(ResultCode.Exception, "9999", ex.ToString()); + } + catch (ScpException ex) + { + + + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + _ret.ErrorList.Add(ex); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "EXCEL_PO_MOD", ex.ToString()); + + if (ex.InnerException != null && ex.InnerException.GetType() == typeof(UpdateException)) + { + var inner = (UpdateException)ex.InnerException; + + + throw new ScpException(ResultCode.Exception, "0000", ex.ToString()); + } + else + { + if (ex.InnerException != null) throw ex.InnerException; + } + } + catch (Exception e) + { + _ret.State = ReturnStatus.Failed; + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "EXCEL_PO_MOD", e.Message); + _ret.Result = false; + _ret.ErrorList.Add(e); + throw e; + } + return _ret; + } + /// + /// 富维期货订单导入 + /// + /// + /// + /// + /// + /// + /// + public static ResultObject EXCEL_PO_QH_MOD(DataTable p_order_list1, List p_order_list, string site, string p_creator, DateTime p_time, PoState p_modtype) + { + ResultObject _ret = new ResultObject(); + try + { + using (ScpEntities db = EntitiesFactory.CreateScpInstance()) + { + int number = 1; + List lineError = new List(); + List ErrorList = new List(); + var _lst = p_order_list; + + _lst.ForEach + (p => + { + var _count = _lst.Count(itm => itm.物料号码 == p.物料号码 && itm.供应商编号 == p.供应商编号); + if (_count > 1) + { + lineError.Add(string.Format("导入的物料号码{0}有重复", p.物料号码)); + ErrorList = lineError; + } + var _ls = CheckExcelMode_QH_Po(db, p); + if (_ls.Count > 0) + { + lineError.Add(number.ToString()); + ErrorList.Add(string.Join("
", _ls.ToArray())); + } + number++; + }); + if (lineError.Count > 0) + { + _ret.State = ReturnStatus.Failed; + _ret.MessageList.AddRange(ErrorList); + _ret.Result = false; + } + else + { + + List poList = new List(); + List po_DetailList = new List(); + List askList = new List(); + List askDetailList = new List(); + List uniList = new List(); + List consum = new List(); + //先循环找到一个日期的订单 + foreach (DataColumn column in p_order_list1.Columns) + { + DateTime date = DateTime.MaxValue; + DateTime.TryParse(column.ColumnName, out date); + + if (date != DateTime.MaxValue && date.Year > 2000) + { + //找到所有日期下订单 + foreach (DataRow dataRow in p_order_list1.Rows)//订单分组表 + { + decimal _Qty = 0; + decimal.TryParse(dataRow[column.ColumnName].ToString(), out _Qty); + if (_Qty > 0) + { + // 创建主单据及看板 + var _Po = CreatePoQh(poList, dataRow, date, p_creator, site); + // 创建主单据及看板 + var _PoAsk = CreateAsk1(poList, askList, dataRow, date, p_creator, db, site); + //创建明细 + var _PoDetail = CreatePoDetail1Qh(dataRow, _Qty, db, date, _Po, _PoAsk, p_creator, site); + po_DetailList.Add(_PoDetail); + var _Askdetail = CreateAskDetail1(db, dataRow, _Po, _PoAsk, _PoDetail, p_creator, site); + askDetailList.Add(_Askdetail); + var Tsuniapi = CreateTsuniapiQh(_Po, _PoAsk, _PoDetail, dataRow, _Askdetail, site); + uniList.Add(Tsuniapi); + } + } + } + } + var POdetailCount = po_DetailList.GroupBy(t => new { t.PartCode, t.UpdateInfo,t.EndTime }).ToList(); + POdetailCount.ForEach((p) => + { + var _list = p.ToList(); + decimal _PlanQTY = _list.Sum(t => t.PlanQty); + var _ls = _list.First(); + var MaxP = db.TB_MAXPO_DETAIL.Where(t => t.PartCode == _ls.PartCode && t.VendId == _ls.UpdateInfo).Sum(t => t.SurplusQty); + if (_PlanQTY > MaxP) + { + _ret.MessageList.Add(string.Format("物料号{0}大订单总剩余数{1}小于本次要货数{2}", _ls.PartCode, MaxP, _PlanQTY)); + } + else + { + var _MaxpoList = db.TB_MAXPO_DETAIL.Where(t => t.PartCode == _ls.PartCode && t.SurplusQty > 0 && t.VendId == _ls.UpdateInfo).OrderBy(t => t.ContractMonth).ToList(); + foreach (var _maxpo in _MaxpoList) + { + if (_maxpo.SurplusQty > _PlanQTY) + { + _maxpo.SurplusQty = _maxpo.SurplusQty - _PlanQTY; + + db.TB_MAXPO_DETAIL.AddOrUpdate(_maxpo); + TB_MAXPO_CONSUME CONSUME = new TB_MAXPO_CONSUME(); + CONSUME.PoBillNum = _maxpo.PoBillNum; + CONSUME.BillNum = _ls.PoBillNum; + CONSUME.PartCode = _ls.PartCode; + CONSUME.VendId = _maxpo.VendId; + CONSUME.PoQty = _PlanQTY; + CONSUME.ShipTime = DateTime.Now; + consum.Add(CONSUME); + break; + } + else if (_maxpo.SurplusQty == _PlanQTY) + { + _maxpo.SurplusQty = 0; + db.TB_MAXPO_DETAIL.AddOrUpdate(_maxpo); + TB_MAXPO_CONSUME CONSUME = new TB_MAXPO_CONSUME(); + CONSUME.PoBillNum = _maxpo.PoBillNum; + CONSUME.BillNum = _ls.PoBillNum; + CONSUME.PartCode = _ls.PartCode; + CONSUME.VendId = _maxpo.VendId; + CONSUME.PoQty = _PlanQTY; + CONSUME.ShipTime = DateTime.Now; + consum.Add(CONSUME); + break; + } + else if (_maxpo.SurplusQty < _PlanQTY) + { + TB_MAXPO_CONSUME CONSUME = new TB_MAXPO_CONSUME(); + CONSUME.BillNum = _ls.PoBillNum; + CONSUME.PoBillNum = _maxpo.PoBillNum; + CONSUME.PartCode = _ls.PartCode; + CONSUME.VendId = _maxpo.VendId; + CONSUME.PoQty = _maxpo.SurplusQty; + CONSUME.ShipTime = DateTime.Now; + consum.Add(CONSUME); + _PlanQTY = _PlanQTY - _maxpo.SurplusQty; + _maxpo.SurplusQty = 0; + db.TB_MAXPO_DETAIL.AddOrUpdate(_maxpo); + + } + + } + + } + }); + + int cnt = 1; + foreach (var item in poList) + { + + var oldGuid = item.PoBillNum; + + var newBillId = SCP_BILLCODE_CONTROLLER.MakePOCode2();//冲压件订单号生成逻辑 + if (item.Site != "W21") + { + newBillId = SCP_BILLCODE_CONTROLLER.MakePOCode4();//本特勒订单号生成逻辑 + } + + var newAskNum = SCP_BILLCODE_CONTROLLER.MakeASKCodeByNum(cnt); + + var add_Po = item.Clone(newBillId, item.Site); + db.TB_PO.Add(add_Po); + + var Add_Po_DETAIL = po_DetailList.Where(p => p.PoBillNum == oldGuid).ToList(); + int cntPo_detail = 1; + Add_Po_DETAIL.ForEach(p => p.PoBillNum = newBillId); + Add_Po_DETAIL.ForEach(p => + { + p.PoLine = cntPo_detail; + cntPo_detail++; + }); + + db.TB_PO_DETAIL.AddRange(Add_Po_DETAIL); + + var Add_AskList = askList.Where(p => p.PoBillNum == oldGuid).ToList(); + Add_AskList.ForEach(p => p.PoBillNum = newBillId); + Add_AskList.ForEach(p => p.AskBillNum = newAskNum); + Add_AskList.ForEach(p => p.ErpBillNum = newBillId); + db.TB_ASK.AddRange(Add_AskList); + var Add_ASK_DETAIL = askDetailList.Where(p => p.PoBillNum == oldGuid).ToList(); + Add_ASK_DETAIL.ForEach(p => p.PoBillNum = newBillId); + int cntAsk_detail = 1; + Add_ASK_DETAIL.ForEach(p => p.AskBillNum = newAskNum); + Add_ASK_DETAIL.ForEach(p => + { + p.PoLine = cntAsk_detail; + cntAsk_detail++; + }); + db.TB_ASK_DETAIL.AddRange(Add_ASK_DETAIL); + var ConsumList = consum.Where(p => p.BillNum == oldGuid).ToList(); + ConsumList.ForEach(p => p.BillNum = newBillId); + db.TB_MAXPO_CONSUME.AddRange(ConsumList); + var Add_UniList = uniList.Where(p => p.BillNum == oldGuid).ToList(); + int cntTS_detail = 1; + Add_UniList.ForEach(p => + { + p.ErpLineNum = cntTS_detail; + cntTS_detail++; + }); + Add_UniList.ForEach(p => p.BillNum = newBillId); + + db.TS_UNI_API.AddRange(Add_UniList); + if (_ret.MessageList.Count == 0) + { + int state = db.SaveChanges(); + if (state != -1) + { + _ret.State = ReturnStatus.Succeed; + _ret.Result = true; + } + else + { + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + } + } + else + { + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + } + } + + } + //} + } + } + catch (System.Data.Entity.Validation.DbEntityValidationException dbEx)//捕获实体验证异常 + { + var sb = new StringBuilder(); + + foreach (var error in dbEx.EntityValidationErrors.ToList()) + { + + error.ValidationErrors.ToList().ForEach(i => + { + sb.AppendFormat("表:{0},字段:{1},信息:{2}\r\n", error.Entry.Entity.GetType().Name, i.PropertyName, i.ErrorMessage); + }); + } + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + _ret.ErrorList.Add(dbEx); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "EXCEL_PO_MOD", sb.ToString()); + throw new ScpException(ResultCode.DbEntityValidationException, sb.ToString(), "字段验证失败" + sb.ToString()); + } + catch (OptimisticConcurrencyException ex)//并发冲突异常 + { + + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + _ret.ErrorList.Add(ex); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "EXCEL_PO_MOD", ex.ToString()); + throw new ScpException(ResultCode.Exception, "9999", ex.ToString()); + } + catch (ScpException ex) + { + + + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + _ret.ErrorList.Add(ex); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "EXCEL_PO_MOD", ex.ToString()); + + if (ex.InnerException != null && ex.InnerException.GetType() == typeof(UpdateException)) + { + var inner = (UpdateException)ex.InnerException; + + + throw new ScpException(ResultCode.Exception, "0000", ex.ToString()); + } + else + { + if (ex.InnerException != null) throw ex.InnerException; + } + } + catch (Exception e) + { + _ret.State = ReturnStatus.Failed; + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "EXCEL_PO_MOD", e.Message); + _ret.Result = false; + _ret.ErrorList.Add(e); + throw e; + } + return _ret; + } + + public static void GroupDataRows(IEnumerable source, List destination, string[] groupByFields, int fieldIndex, DataTable schema) + { + if (fieldIndex >= groupByFields.Length || fieldIndex < 0) + { + DataTable dt = schema.Clone(); + foreach (DataRow row in source) + { + DataRow dr = dt.NewRow(); + dr.ItemArray = row.ItemArray; + dt.Rows.Add(dr); + } + destination.Add(dt); + return; + } + + var results = source.GroupBy(o => o[groupByFields[fieldIndex]]); + foreach (var rows in results) + { + GroupDataRows(rows, destination, groupByFields, fieldIndex + 1, schema); + } + + fieldIndex++; + } + /// + /// 富维订单导入 + /// + /// + /// + /// + /// + /// + /// + public static ResultObject EXCEL_PO_MOD1(DataTable p_order_list1, List p_order_list, string site, string p_creator, DateTime p_time, PoState p_modtype, string SubSite, string p_chineseName, string p_buyerPhone) + { + ResultObject _ret = new ResultObject(); + try + { + using (ScpEntities db = EntitiesFactory.CreateScpInstance()) + { + int number = 1; + List lineError = new List(); + List ErrorList = new List(); + var _lst = p_order_list; + _lst.ForEach + (p => + { + var _count = _lst.Count(itm => itm.物料号码 == p.物料号码 && itm.供应商编号 == p.供应商编号); + if (_count > 1) + { + lineError.Add(string.Format("导入的物料号码{0}有重复", p.物料号码)); + ErrorList = lineError; + } + var _ls = CheckExcelMode_Po1(db, p); + if (_ls.Count > 0) + { + lineError.Add(number.ToString()); + ErrorList.Add(string.Join("
", _ls.ToArray())); + } + number++; + }); + if (lineError.Count > 0) + { + _ret.State = ReturnStatus.Failed; + _ret.MessageList.AddRange(ErrorList); + _ret.Result = false; + } + else + { + + + List poList = new List(); + List po_DetailList = new List(); + List askList = new List(); + List askDetailList = new List(); + List uniList = new List(); + //先循环找到一个日期的订单 + foreach (DataColumn column in p_order_list1.Columns) + { + DateTime date = DateTime.MaxValue; + DateTime.TryParse(column.ColumnName, out date); + + if (date != DateTime.MaxValue && date.Year > 2000) + { + //找到所有日期下订单 + foreach (DataRow dataRow in p_order_list1.Rows)//订单分组表 + { + decimal _Qty = 0; + decimal.TryParse(dataRow[column.ColumnName].ToString(), out _Qty); + if (_Qty > 0) + { + // 创建主单据及看板 + var _Po = CreatePo(db, poList, dataRow, date, p_creator, site); + // 创建主单据及看板 + var _PoAsk = CreateAsk(poList, askList, dataRow, date, p_creator, db, site); + //创建明细 + var _PoDetail = CreatePoDetail(dataRow, _Qty, db, date, _Po, _PoAsk, p_creator, po_DetailList, site); + po_DetailList.Add(_PoDetail); + var _Askdetail = CreateAskDetail(db, dataRow, _Po, _PoAsk, _PoDetail, p_creator, site); + askDetailList.Add(_Askdetail); + var Tsuniapi = CreateTsuniapi(_Po, _PoAsk, _PoDetail, _Askdetail, dataRow, site); + uniList.Add(Tsuniapi); + } + } + } + } + int cnt = 1; + var podetail = po_DetailList.GroupBy(p => p.PoBillNum).ToList(); + + foreach (var item in poList) + { + + var oldGuid = item.PoBillNum; + var newBillId = SCP_BILLCODE_CONTROLLER.MakePOCode1();//订单号 + + var newAskNum = SCP_BILLCODE_CONTROLLER.MakeASKCodeByNum(cnt); + + var add_Po = item.Clone(newBillId, item.Site); + db.TB_PO.Add(add_Po); + + var Add_Po_DETAIL = po_DetailList.Where(p => p.PoBillNum == oldGuid).ToList(); + int cntPo_detail = 1; + List part = new List(); + Add_Po_DETAIL.ForEach(p => p.PoBillNum = newBillId); + Add_Po_DETAIL.ForEach(p => + { + + if (part.Contains(p.PartCode)) + { + var pa = Add_Po_DETAIL.FirstOrDefault(itm => itm.PartCode == p.PartCode); + p.PoLine = pa.PoLine; + } + else + { + p.PoLine = cntPo_detail; + cntPo_detail++; + } + part.Add(p.PartCode); + }); + + db.TB_PO_DETAIL.AddRange(Add_Po_DETAIL); + var Add_AskList = askList.Where(p => p.PoBillNum == oldGuid).ToList(); + Add_AskList.ForEach(p => p.PoBillNum = newBillId); + Add_AskList.ForEach(p => p.AskBillNum = newAskNum); + Add_AskList.ForEach(p => p.ErpBillNum = newBillId); + db.TB_ASK.AddRange(Add_AskList); + List part1 = new List(); + var Add_ASK_DETAIL = askDetailList.Where(p => p.PoBillNum == oldGuid).ToList(); + Add_ASK_DETAIL.ForEach(p => p.PoBillNum = newBillId); + int cntAsk_detail = 1; + Add_ASK_DETAIL.ForEach(p => p.AskBillNum = newAskNum); + Add_ASK_DETAIL.ForEach(p => + { + if (part1.Contains(p.PartCode)) + { + var pa = Add_ASK_DETAIL.FirstOrDefault(itm => itm.PartCode == p.PartCode); + p.PoLine = pa.PoLine; + } + else + { + p.PoLine = cntAsk_detail; + cntAsk_detail++; + } + part1.Add(p.PartCode); + }); + db.TB_ASK_DETAIL.AddRange(Add_ASK_DETAIL); + List part2 = new List(); + var Add_UniList = uniList.Where(p => p.BillNum == oldGuid).ToList(); + int cntTS_detail = 1; + Add_UniList.ForEach(p => + { + if (part2.Contains(p.PartCode)) + { + var pa = Add_UniList.FirstOrDefault(itm => itm.PartCode == p.PartCode); + p.ErpLineNum = pa.ErpLineNum; + } + else + { + p.ErpLineNum = cntTS_detail; + cntTS_detail++; + } + part2.Add(p.PartCode); + }); + Add_UniList.ForEach(p => p.BillNum = newBillId); + + db.TS_UNI_API.AddRange(Add_UniList); + if (_ret.MessageList.Count == 0) + { + int state = db.SaveChanges(); + if (state != -1) + { + _ret.State = ReturnStatus.Succeed; + _ret.Result = true; + } + else + { + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + } + } + else + { + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + } + + } + } + + } + //} + } + + + catch (System.Data.Entity.Validation.DbEntityValidationException dbEx)//捕获实体验证异常 + { + var sb = new StringBuilder(); + + foreach (var error in dbEx.EntityValidationErrors.ToList()) + { + + error.ValidationErrors.ToList().ForEach(i => + { + sb.AppendFormat("表:{0},字段:{1},信息:{2}\r\n", error.Entry.Entity.GetType().Name, i.PropertyName, i.ErrorMessage); + }); + } + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + _ret.ErrorList.Add(dbEx); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "EXCEL_PO_MOD", sb.ToString()); + throw new ScpException(ResultCode.DbEntityValidationException, sb.ToString(), "字段验证失败" + sb.ToString()); + } + catch (OptimisticConcurrencyException ex)//并发冲突异常 + { + + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + _ret.ErrorList.Add(ex); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "EXCEL_PO_MOD", ex.ToString()); + throw new ScpException(ResultCode.Exception, "9999", ex.ToString()); + } + catch (ScpException ex) + { + + + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + _ret.ErrorList.Add(ex); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "EXCEL_PO_MOD", ex.ToString()); + + if (ex.InnerException != null && ex.InnerException.GetType() == typeof(UpdateException)) + { + var inner = (UpdateException)ex.InnerException; + + + throw new ScpException(ResultCode.Exception, "0000", ex.ToString()); + } + else + { + if (ex.InnerException != null) throw ex.InnerException; + } + } + catch (Exception e) + { + _ret.State = ReturnStatus.Failed; + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "EXCEL_PO_MOD", e.Message); + _ret.Result = false; + _ret.ErrorList.Add(e); + throw e; + } + return _ret; + } + /// + /// 富维多组件订单导入验证 + /// + /// + /// + /// + /// + /// + /// + public static ResultObject EXCEL_PO_Multicomponent(DataTable p_order_list1, List p_order_list, bool wmsweb,string site) + { + ResultObject _ret = new ResultObject(); + try + { + using (ScpEntities db = EntitiesFactory.CreateScpInstance()) + { + int number = 1; + List lineError = new List(); + List ErrorList = new List(); + var _lst = p_order_list; + _lst.ForEach + (p => + { + var _count = _lst.Count(itm => itm.物料号码 == p.物料号码 && itm.供应商编号 == p.供应商编号); + if (_count > 1) + { + lineError.Add(string.Format("导入的物料号码{0}有重复", p.物料号码)); + ErrorList = lineError; + } + var _ls = CheckExcelMode_Multicomponent(db, p, wmsweb); + if (_ls.Count > 0) + { + lineError.Add(number.ToString()); + ErrorList.Add(string.Join("
", _ls.ToArray())); + } + number++; + }); + if (lineError.Count > 0) + { + _ret.State = ReturnStatus.Failed; + _ret.MessageList.AddRange(ErrorList); + _ret.Result = false; + } + else + { + _lst.ForEach + (p => + { + + if (wmsweb == false) + { + BomList.JsonService bomVersionRe = new BomList.JsonService(); + var _ReturnRelust = bomVersionRe.GetBomsByVer(p.物料号码, p.BOM版本); + var _Bomlist = JsonConvert.DeserializeObject>(_ReturnRelust); + foreach (var bom in _Bomlist) + { + var Bomsub = db.TA_SubPartCode.FirstOrDefault(t => t.PartCode == bom.PartCode && t.SubPartCode == bom.SubPartCode&&t.BOMedtiton==bom.BomFillIn); + if (Bomsub == null) + { + TA_SubPartCode subpart = new TA_SubPartCode(); + subpart.PartCode = bom.PartCode; + subpart.SubPartCode = bom.SubPartCode; + subpart.BOMedtiton = p.BOM版本; + subpart.Qty = bom.Qty; + subpart.Site = site; + db.TA_SubPartCode.AddOrUpdate(subpart); + } + else + { + Bomsub.Qty = bom.Qty; + db.TA_SubPartCode.AddOrUpdate(Bomsub); + } + + + } + } + else + { + BomList1.JsonService bomVersionRe = new BomList1.JsonService(); + var _ReturnRelust = bomVersionRe.GetBomsByVer(p.物料号码, p.BOM版本); + var _Bomlist = JsonConvert.DeserializeObject>(_ReturnRelust); + foreach (var bom in _Bomlist) + { + var Bomsub = db.TA_SubPartCode.FirstOrDefault(t => t.PartCode == bom.PartCode && t.SubPartCode == bom.SubPartCode && t.BOMedtiton == bom.BomFillIn); + if (Bomsub == null) + { + TA_SubPartCode subpart = new TA_SubPartCode(); + subpart.PartCode = bom.PartCode; + subpart.SubPartCode = bom.SubPartCode; + subpart.BOMedtiton = p.BOM版本; + subpart.Qty = bom.Qty; + subpart.Site = site; + db.TA_SubPartCode.AddOrUpdate(subpart); + } + else + { + Bomsub.Qty = bom.Qty; + db.TA_SubPartCode.AddOrUpdate(Bomsub); + } + + + } + } + + }); + if (_ret.MessageList.Count == 0) + { + int state = db.SaveChanges(); + if (state != -1) + { + _ret.State = ReturnStatus.Succeed; + _ret.Result = true; + + } + else + { + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + } + } + else + { + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + } + } + + } + } + + catch (System.Data.Entity.Validation.DbEntityValidationException dbEx)//捕获实体验证异常 + { + var sb = new StringBuilder(); + + foreach (var error in dbEx.EntityValidationErrors.ToList()) + { + + error.ValidationErrors.ToList().ForEach(i => + { + sb.AppendFormat("表:{0},字段:{1},信息:{2}\r\n", error.Entry.Entity.GetType().Name, i.PropertyName, i.ErrorMessage); + }); + } + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + _ret.ErrorList.Add(dbEx); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "EXCEL_PO_MOD", sb.ToString()); + throw new ScpException(ResultCode.DbEntityValidationException, sb.ToString(), "字段验证失败" + sb.ToString()); + } + catch (OptimisticConcurrencyException ex)//并发冲突异常 + { + + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + _ret.ErrorList.Add(ex); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "EXCEL_PO_MOD", ex.ToString()); + throw new ScpException(ResultCode.Exception, "9999", ex.ToString()); + } + catch (ScpException ex) + { + + + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + _ret.ErrorList.Add(ex); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "EXCEL_PO_MOD", ex.ToString()); + + if (ex.InnerException != null && ex.InnerException.GetType() == typeof(UpdateException)) + { + var inner = (UpdateException)ex.InnerException; + + + throw new ScpException(ResultCode.Exception, "0000", ex.ToString()); + } + else + { + if (ex.InnerException != null) throw ex.InnerException; + } + } + catch (Exception e) + { + _ret.State = ReturnStatus.Failed; + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "EXCEL_PO_MOD", e.Message); + _ret.Result = false; + _ret.ErrorList.Add(e); + throw e; + } + return _ret; + } + public static ResultObject EXCEL_PO_MAX(DataTable p_order_list1, List p_order_list, string site, string p_creator, DateTime p_time, PoState p_modtype, string SubSite, string p_chineseName, string time) + { + ResultObject _ret = new ResultObject(); + try + { + using (ScpEntities db = EntitiesFactory.CreateScpInstance()) + { + int number = 1; + //List PoError= new List(); + List lineError = new List(); + List ErrorList = new List(); + var _lst = p_order_list; + _lst.ForEach + (p => + { + var _count = _lst.Count(itm => itm.原材物料号 == p.原材物料号 && itm.供应商编号 == p.供应商编号); + if (_count > 1) + { + lineError.Add(string.Format("导入的物料号码{0}有重复", p.原材物料号)); + ErrorList = lineError; + } + var _ls = CheckExcelMode_MAXPO(db, p); + if (_ls.Count > 0) + { + lineError.Add(number.ToString()); + ErrorList.Add(string.Join("
", _ls.ToArray())); + } + number++; + }); + if (lineError.Count > 0) + { + _ret.State = ReturnStatus.Failed; + _ret.MessageList.AddRange(ErrorList); + _ret.Result = false; + } + else + { + + var VendidList = _lst.GroupBy(t => t.供应商编号).ToList(); + VendidList.ForEach((p) => + { + var list = p.ToList(); + + if (list.Count > 0) + { + var _entity = list.FirstOrDefault(); + + TB_MAXPO maxp = new TB_MAXPO(); + maxp.PoBillNum = SCP_BILLCODE_CONTROLLER.MakemaxPOCode(_entity.供应商编号, time); + maxp.VendId = _entity.供应商编号; + maxp.CreateUser = p_chineseName; + maxp.CreateTime = DateTime.Now; + maxp.ContractNo = maxp.PoBillNum; + maxp.ContractMonth = time; + maxp.Site = site; + maxp.Remark = _entity.备注; + db.TB_MAXPO.AddOrUpdate(maxp); + + + + int i = 1; + list.ForEach((itm) => + { + List yclist = new List(); + TB_MAXPO_DETAIL maxpodetail = new TB_MAXPO_DETAIL(); + BomList1.JsonService bomVersionRe = new BomList1.JsonService(); + var _ReturnRelust = bomVersionRe.GetBom(itm.零件号, itm.原材物料号); + var _Bomlist = JsonConvert.DeserializeObject>(_ReturnRelust); + var _bom = _Bomlist.First(); + maxpodetail.Singlecon = _bom.Qty; + var part = db.TA_PART.FirstOrDefault(t => t.PartCode == itm.原材物料号); + maxpodetail.PoBillNum = maxp.PoBillNum; + maxpodetail.ContractNo = maxp.PoBillNum; + maxpodetail.VendId = itm.供应商编号; + maxpodetail.PartCode = itm.原材物料号; + maxpodetail.PartNumber = itm.零件号; + maxpodetail.Texture = part.ProjectId;//材质 + maxpodetail.Model = itm.车型; + maxpodetail.Finprspec = part.PartDesc2;//规格 + maxpodetail.TechStandard = itm.技术标准; + maxpodetail.MinordQty = decimal.Parse(itm.起定量); + maxpodetail.OrderQtyd = decimal.Parse(itm.订货量吨); + maxpodetail.OrderQtykg = decimal.Parse(itm.订货量吨) * 1000; + maxpodetail.OrderNumber = decimal.Parse(itm.订货件数); + maxpodetail.SurplusQty = maxpodetail.OrderQtykg; + maxpodetail.CreateTime = DateTime.Now; + maxpodetail.CreateUser = p_chineseName; + maxpodetail.Site = site; + maxpodetail.AsnQty = maxpodetail.OrderQtykg; + maxpodetail.ReceQty = 0; + foreach (DataColumn column in p_order_list1.Columns)// + { + int yuce = int.MaxValue; + int.TryParse(column.ColumnName, out yuce); + if (yuce > 0) + { + foreach (DataRow dataRow in p_order_list1.Rows) + { + decimal _Qty = 0; + decimal.TryParse(dataRow[column.ColumnName].ToString(), out _Qty); + if (dataRow["原材物料号"].ToString() == itm.原材物料号 && dataRow["供应商编号"].ToString()==itm.供应商编号) + { + string forecast = ""; + if (_Qty > 0) + { + forecast = yuce + "/" + _Qty.ToString(); + } + else + { + forecast = yuce + "/" + "0"; + } + + yclist.Add(forecast); + } + + } + } + + + + } + + maxpodetail.CreateTime = maxp.CreateTime; + maxpodetail.Matermanu = itm.材料厂家; + maxpodetail.ContractMonth = time; + if (yclist.Count() > 0) + { + int forecascount = 6 - yclist.Count(); + if (forecascount > 0) + { + for (int a=1;a<=forecascount; a++) + { + yclist.Add(""); + } + } + maxpodetail.forecastone = yclist.First();//预测1 + maxpodetail.forecasttwo = yclist[yclist.Count - 5];//预测2 + maxpodetail.forecastthree = yclist[yclist.Count - 4];//预测3 + maxpodetail.forecastfour = yclist[yclist.Count - 3];//预测4 + maxpodetail.forecastfive = yclist[yclist.Count - 2];//预测5 + maxpodetail.forecastsix = yclist.Last();//预测6 + } + + maxpodetail.PoLine = i; + db.TB_MAXPO_DETAIL.AddOrUpdate(maxpodetail); + i++; + TS_UNI_API maxuni = new TS_UNI_API(); + maxuni.BillNum = maxpodetail.PoBillNum; + maxuni.InterfaceType = "MaxPobillnum"; + maxuni.TableName = "TS_UNI_API"; + maxuni.BillType = 701; + maxuni.SubBillType = 0; + maxuni.PartCode = maxpodetail.PartCode; + maxuni.VendId = maxpodetail.VendId;//供应商编号 + if (string.IsNullOrEmpty(part.ProjectId)) + { + maxuni.Batch = ""; + } + else + { + maxuni.Batch = part.ProjectId;//材质 + } + + maxuni.Qty = decimal.Parse(itm.订货件数); + maxuni.State = 1; + maxuni.CreateOper = p_chineseName;//创建者 + maxuni.CreateTime = maxp.CreateTime; + maxuni.PutTime = DateTime.Now; + maxuni.Extend1 = itm.零件号; + maxuni.PackQty = decimal.Parse(itm.起定量); + maxuni.Price = decimal.Parse(itm.订货量吨); + maxuni.VendBatch = time;//合同月 + maxuni.Currency = itm.车型; + maxuni.Buyer = itm.技术标准; + maxuni.BuyerPhone = part.PartDesc2;//规格 + maxuni.Tax = 0; + maxuni.PoUnit = maxpodetail.forecastone;//预测1 + maxuni.LocUnit = maxpodetail.forecasttwo;//预测2 + maxuni.Attn = maxpodetail.forecastthree;//预测3 + maxuni.Receiver = maxpodetail.forecastfour;//预测4 + maxuni.ModType = maxpodetail.forecastfive;//预测5 + maxuni.SubSite = maxpodetail.forecastsix;//预测6 + maxuni.Site = site; + maxuni.Extend2 = itm.材料厂家; + maxuni.TaxAmt =_bom.Qty;//单件消耗 + maxuni.ValidDate = DateTime.Now; + maxuni.ErpLineNum = maxpodetail.PoLine; + maxuni.Site = site; + maxuni.Domain = site; + maxuni.Extend3 = "A"; + db.TS_UNI_API.AddOrUpdate(maxuni); + }); + } + + + + + }); + + + + if (_ret.MessageList.Count == 0) + { + int state = db.SaveChanges(); + if (state != -1) + { + _ret.State = ReturnStatus.Succeed; + _ret.Result = true; + } + else + { + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + } + } + else + { + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + } + } + + } + } + + catch (System.Data.Entity.Validation.DbEntityValidationException dbEx)//捕获实体验证异常 + { + var sb = new StringBuilder(); + + foreach (var error in dbEx.EntityValidationErrors.ToList()) + { + + error.ValidationErrors.ToList().ForEach(i => + { + sb.AppendFormat("表:{0},字段:{1},信息:{2}\r\n", error.Entry.Entity.GetType().Name, i.PropertyName, i.ErrorMessage); + }); + } + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + _ret.ErrorList.Add(dbEx); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "EXCEL_PO_MOD", sb.ToString()); + throw new ScpException(ResultCode.DbEntityValidationException, sb.ToString(), "字段验证失败" + sb.ToString()); + } + catch (OptimisticConcurrencyException ex)//并发冲突异常 + { + + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + _ret.ErrorList.Add(ex); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "EXCEL_PO_MOD", ex.ToString()); + throw new ScpException(ResultCode.Exception, "9999", ex.ToString()); + } + catch (ScpException ex) + { + + + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + _ret.ErrorList.Add(ex); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "EXCEL_PO_MOD", ex.ToString()); + + if (ex.InnerException != null && ex.InnerException.GetType() == typeof(UpdateException)) + { + var inner = (UpdateException)ex.InnerException; + + + throw new ScpException(ResultCode.Exception, "0000", ex.ToString()); + } + else + { + if (ex.InnerException != null) throw ex.InnerException; + } + } + catch (Exception e) + { + _ret.State = ReturnStatus.Failed; + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "EXCEL_PO_MOD", e.Message); + _ret.Result = false; + _ret.ErrorList.Add(e); + throw e; + } + return _ret; + } + /// 富维多组件订单导入验证 + ///
+ /// + /// + /// + /// + /// + /// + public static ResultObject EXCEL_PO_SUBMANY(DataTable p_order_list1, List p_order_list, string p_creator, string site, string p_chineseName) + { + ResultObject _ret = new ResultObject(); + try + { + using (ScpEntities db = EntitiesFactory.CreateScpInstance()) + { + + List poList = new List(); + List po_DetailList = new List(); + List askList = new List(); + List askDetailList = new List(); + List uniList = new List(); + List posub_DetailList = new List(); + List asksubpartlist= new List(); + //先循环找到一个日期的订单 + foreach (DataColumn column in p_order_list1.Columns) + { + DateTime date = DateTime.MaxValue; + DateTime.TryParse(column.ColumnName, out date); + + if (date != DateTime.MaxValue && date.Year > 2000) + { + //找到所有日期下订单 + foreach (DataRow dataRow in p_order_list1.Rows)//订单分组表 + { + decimal _Qty = 0; + decimal.TryParse(dataRow[column.ColumnName].ToString(), out _Qty); + if (_Qty > 0) + { + // 创建主单据及看板 + var _Po = CreatePo(db, poList, dataRow, date, p_creator, site); + // 创建主单据及看板 + var _PoAsk = CreateManyAsk(poList, askList, dataRow, date, p_creator, db, site); + //创建明细 + var _PoDetail = CreateManyPoDetail(dataRow, _Qty, db, date, _Po, _PoAsk, p_creator, po_DetailList, site); + po_DetailList.Add(_PoDetail); + var _Askdetail = CreateManyAskDetail(db, dataRow, _Po, _PoAsk, _PoDetail, p_creator, site); + askDetailList.Add(_Askdetail); + List Tsuniapi = CreateManyTsuniapi(_Po, _PoAsk, _PoDetail, _Askdetail, dataRow, site, db); + foreach(var ts in Tsuniapi) + { + uniList.Add(ts); + } + List Subdetail = CreateManyPoDetailSubPart(_Po, _PoAsk, _PoDetail, _Askdetail, dataRow, site, db); + foreach (var su in Subdetail) + { + posub_DetailList.Add(su); + } + List SubAskdetail = CreateManyAskSubPart(_Po, _PoAsk, _PoDetail, _Askdetail, dataRow, site, db); + foreach (var suask in SubAskdetail) + { + asksubpartlist.Add(suask); + } + + } + } + } + } + int cnt = 1; + var podetail = po_DetailList.GroupBy(p => p.PoBillNum).ToList(); + + foreach (var item in poList) + { + + var oldGuid = item.PoBillNum; + var newBillId = SCP_BILLCODE_CONTROLLER.MakePOCode1();//订单号 + + var newAskNum = SCP_BILLCODE_CONTROLLER.MakeASKCodeByNum(cnt); + + var add_Po = item.Clone(newBillId, item.Site); + db.TB_PO.Add(add_Po); + + var Add_Po_DETAIL = po_DetailList.Where(p => p.PoBillNum == oldGuid).ToList(); + int cntPo_detail = 1; + Add_Po_DETAIL.ForEach(p => p.PoBillNum = newBillId); + Add_Po_DETAIL.ForEach(p => + { + p.PoLine = cntPo_detail; + cntPo_detail++; + }); + + db.TB_PO_DETAIL.AddRange(Add_Po_DETAIL); + var Add_AskList = askList.Where(p => p.PoBillNum == oldGuid).ToList(); + Add_AskList.ForEach(p => p.PoBillNum = newBillId); + Add_AskList.ForEach(p => p.AskBillNum = newAskNum); + Add_AskList.ForEach(p => p.ErpBillNum = newBillId); + db.TB_ASK.AddRange(Add_AskList); + var Add_AskSubList = asksubpartlist.Where(p => p.AskBillNum == oldGuid).ToList(); + Add_AskSubList.ForEach(p => p.AskBillNum = newAskNum); + db.TA_ASK_SUBPART.AddRange(Add_AskSubList); + var Add_ASK_DETAIL = askDetailList.Where(p => p.PoBillNum == oldGuid).ToList(); + Add_ASK_DETAIL.ForEach(p => p.PoBillNum = newBillId); + int cntAsk_detail = 1; + Add_ASK_DETAIL.ForEach(p => p.AskBillNum = newAskNum); + Add_ASK_DETAIL.ForEach(p => + { + p.PoLine = cntAsk_detail; + cntAsk_detail++; + }); + db.TB_ASK_DETAIL.AddRange(Add_ASK_DETAIL); + + var Add_UniList = uniList.Where(p => p.BillNum == oldGuid).ToList(); + int cntTS_detail = 1; + Add_UniList.ForEach(p => p.BillNum = newBillId); + //Add_UniList.ForEach(p => + //{ + var unii = Add_UniList.GroupBy(t => t.PartCode).ToList(); + unii.ForEach(t => + { + var uniii = t.ToList(); + uniii.ForEach(r => { + r.ErpLineNum = cntTS_detail; + }); + cntTS_detail++; + }); + //}); + + db.TS_UNI_API.AddRange(Add_UniList); + + var Add_PoSubList = posub_DetailList.Where(p => p.PoBillNum == oldGuid).ToList(); + int poSub_detail = 1; + Add_PoSubList.ForEach(p => p.PoBillNum = newBillId); + //Add_PoSubList.ForEach(p => + //{ + var poii = Add_PoSubList.GroupBy(t => t.PartCode).ToList(); + poii.ForEach(t => + { + var poiii = t.ToList(); + poiii.ForEach(r => { + r.PoLine = cntTS_detail; + }); + poSub_detail++; + }); + + //}); + + + db.TB_PO_SUBDETAIL.AddRange(Add_PoSubList); + foreach (var sub in Add_UniList) + { + var suu = db.TA_SubPartCode.FirstOrDefault(t => t.PartCode == sub.PartCode && t.SubPartCode == sub.Extend1); + if (suu != null) + { + db.TA_SubPartCode.Remove(suu); + } + + } + if (_ret.MessageList.Count == 0) + { + int state = db.SaveChanges(); + if (state != -1) + { + _ret.State = ReturnStatus.Succeed; + _ret.Result = true; + } + else + { + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + } + } + else + { + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + } + + } + } + + + //} + } + + + catch (System.Data.Entity.Validation.DbEntityValidationException dbEx)//捕获实体验证异常 + { + var sb = new StringBuilder(); + + foreach (var error in dbEx.EntityValidationErrors.ToList()) + { + + error.ValidationErrors.ToList().ForEach(i => + { + sb.AppendFormat("表:{0},字段:{1},信息:{2}\r\n", error.Entry.Entity.GetType().Name, i.PropertyName, i.ErrorMessage); + }); + } + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + _ret.ErrorList.Add(dbEx); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "EXCEL_PO_MOD", sb.ToString()); + throw new ScpException(ResultCode.DbEntityValidationException, sb.ToString(), "字段验证失败" + sb.ToString()); + } + catch (OptimisticConcurrencyException ex)//并发冲突异常 + { + + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + _ret.ErrorList.Add(ex); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "EXCEL_PO_MOD", ex.ToString()); + throw new ScpException(ResultCode.Exception, "9999", ex.ToString()); + } + catch (ScpException ex) + { + + + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + _ret.ErrorList.Add(ex); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "EXCEL_PO_MOD", ex.ToString()); + + if (ex.InnerException != null && ex.InnerException.GetType() == typeof(UpdateException)) + { + var inner = (UpdateException)ex.InnerException; + + + throw new ScpException(ResultCode.Exception, "0000", ex.ToString()); + } + else + { + if (ex.InnerException != null) throw ex.InnerException; + } + } + catch (Exception e) + { + _ret.State = ReturnStatus.Failed; + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "EXCEL_PO_MOD", e.Message); + _ret.Result = false; + _ret.ErrorList.Add(e); + throw e; + } + return _ret; + } + /// + /// 本特勒订单导入 + /// + /// + /// + /// + /// + /// + /// + public static ResultObject EXCEL_PO_MOD_BTL(DataTable p_order_list1, List p_order_list, string site, string p_creator, DateTime p_time, PoState p_modtype, string SubSite, string p_chineseName, string p_buyerPhone) + { + ResultObject _ret = new ResultObject(); + try + { + using (ScpEntities db = EntitiesFactory.CreateScpInstance()) + { + int number = 1; + List lineError = new List(); + List ErrorList = new List(); + var _lst = p_order_list; + _lst.ForEach + (p => + { + var _count = _lst.Count(itm => itm.物料号码 == p.物料号码 && itm.供应商编号 == p.供应商编号); + if (_count > 1) + { + lineError.Add(string.Format("导入的物料号码{0}有重复", p.物料号码)); + ErrorList = lineError; + } + var _ls = CheckExcelMode_BTL(db, p); + if (_ls.Count > 0) + { + lineError.Add(number.ToString()); + ErrorList.Add(string.Join("
", _ls.ToArray())); + } + number++; + }); + if (lineError.Count > 0) + { + _ret.State = ReturnStatus.Failed; + _ret.MessageList.AddRange(ErrorList); + _ret.Result = false; + } + else + { + + + List poList = new List(); + List po_DetailList = new List(); + List askList = new List(); + List askDetailList = new List(); + List uniList = new List(); + //先循环找到一个日期的订单 + foreach (DataColumn column in p_order_list1.Columns) + { + DateTime date = DateTime.MaxValue; + DateTime.TryParse(column.ColumnName, out date); + + if (date != DateTime.MaxValue && date.Year > 2000) + { + //找到所有日期下订单 + foreach (DataRow dataRow in p_order_list1.Rows)//订单分组表 + { + decimal _Qty = 0; + decimal.TryParse(dataRow[column.ColumnName].ToString(), out _Qty); + if (_Qty > 0) + { + // 创建主单据及看板 + var _Po = CreatePo(db, poList, dataRow, date, p_creator, site); + // 创建主单据及看板 + var _PoAsk = CreateAsk(poList, askList, dataRow, date, p_creator, db, site); + //创建明细 + var _PoDetail = CreatePoDetail(dataRow, _Qty, db, date, _Po, _PoAsk, p_creator, po_DetailList, site); + po_DetailList.Add(_PoDetail); + var _Askdetail = CreateAskDetail(db, dataRow, _Po, _PoAsk, _PoDetail, p_creator, site); + askDetailList.Add(_Askdetail); + var Tsuniapi = CreateTsuniapi(_Po, _PoAsk, _PoDetail, _Askdetail, dataRow, site); + uniList.Add(Tsuniapi); + } + } + } + } + int cnt = 1; + var podetail = po_DetailList.GroupBy(p => p.PoBillNum).ToList(); + + foreach (var item in poList) + { + + var oldGuid = item.PoBillNum; + var newBillId = SCP_BILLCODE_CONTROLLER.MakePOCode3();//订单号 + + var newAskNum = SCP_BILLCODE_CONTROLLER.MakeASKCodeByNum(cnt); + + var add_Po = item.Clone(newBillId, item.Site); + db.TB_PO.Add(add_Po); + + var Add_Po_DETAIL = po_DetailList.Where(p => p.PoBillNum == oldGuid).ToList(); + int cntPo_detail = 1; + Add_Po_DETAIL.ForEach(p => p.PoBillNum = newBillId); + Add_Po_DETAIL.ForEach(p => + { + + p.PoLine = cntPo_detail; + cntPo_detail++; + }); + + db.TB_PO_DETAIL.AddRange(Add_Po_DETAIL); + var Add_AskList = askList.Where(p => p.PoBillNum == oldGuid).ToList(); + Add_AskList.ForEach(p => p.PoBillNum = newBillId); + Add_AskList.ForEach(p => p.AskBillNum = newAskNum); + Add_AskList.ForEach(p => p.ErpBillNum = newBillId); + db.TB_ASK.AddRange(Add_AskList); + + var Add_ASK_DETAIL = askDetailList.Where(p => p.PoBillNum == oldGuid).ToList(); + Add_ASK_DETAIL.ForEach(p => p.PoBillNum = newBillId); + int cntAsk_detail = 1; + Add_ASK_DETAIL.ForEach(p => p.AskBillNum = newAskNum); + Add_ASK_DETAIL.ForEach(p => + { + p.PoLine = cntAsk_detail; + cntAsk_detail++; + }); + db.TB_ASK_DETAIL.AddRange(Add_ASK_DETAIL); + + var Add_UniList = uniList.Where(p => p.BillNum == oldGuid).ToList(); + int cntTS_detail = 1; + Add_UniList.ForEach(p => + { + p.ErpLineNum = cntTS_detail; + cntTS_detail++; + }); + Add_UniList.ForEach(p => p.BillNum = newBillId); + + db.TS_UNI_API.AddRange(Add_UniList); + if (_ret.MessageList.Count == 0) + { + int state = db.SaveChanges(); + if (state != -1) + { + _ret.State = ReturnStatus.Succeed; + _ret.Result = true; + } + else + { + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + } + } + else + { + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + } + + } + } + + } + //} + } + + catch (System.Data.Entity.Validation.DbEntityValidationException dbEx)//捕获实体验证异常 + { + var sb = new StringBuilder(); + + foreach (var error in dbEx.EntityValidationErrors.ToList()) + { + + error.ValidationErrors.ToList().ForEach(i => + { + sb.AppendFormat("表:{0},字段:{1},信息:{2}\r\n", error.Entry.Entity.GetType().Name, i.PropertyName, i.ErrorMessage); + }); + } + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + _ret.ErrorList.Add(dbEx); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "EXCEL_PO_MOD", sb.ToString()); + throw new ScpException(ResultCode.DbEntityValidationException, sb.ToString(), "字段验证失败" + sb.ToString()); + } + catch (OptimisticConcurrencyException ex)//并发冲突异常 + { + + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + _ret.ErrorList.Add(ex); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "EXCEL_PO_MOD", ex.ToString()); + throw new ScpException(ResultCode.Exception, "9999", ex.ToString()); + } + catch (ScpException ex) + { + + + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + _ret.ErrorList.Add(ex); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "EXCEL_PO_MOD", ex.ToString()); + + if (ex.InnerException != null && ex.InnerException.GetType() == typeof(UpdateException)) + { + var inner = (UpdateException)ex.InnerException; + + + throw new ScpException(ResultCode.Exception, "0000", ex.ToString()); + } + else + { + if (ex.InnerException != null) throw ex.InnerException; + } + } + catch (Exception e) + { + _ret.State = ReturnStatus.Failed; + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "EXCEL_PO_MOD", e.Message); + _ret.Result = false; + _ret.ErrorList.Add(e); + throw e; + } + return _ret; + } + private static TB_PO CreatePo(ScpEntities db,List p_poList, DataRow p_dataRow,DateTime p_PoBillTime, string str,string site) + { + var _VendId = p_dataRow["供应商编号"].ToString(); + var po = p_poList.FirstOrDefault(p=>p.VendId== _VendId + && p.EndTime== p_PoBillTime); + if (po != null) return po; + TB_PO _po = new TB_PO(); + _po.PoBillNum = Guid.NewGuid().ToString(); // + _po.VendId = p_dataRow["供应商编号"].ToString(); + _po.Buyer = p_dataRow["采购员"].ToString(); + _po.ErpBillNum = _po.PoBillNum; + _po.ModType = (int)BillFwModType.Non_Contract; + _po.BuyerPhone = p_dataRow["采购员电话"].ToString(); + _po.Site = site; + _po.State = (int)PoState.Open; + _po.GUID = Guid.NewGuid(); + _po.IsDeleted = false; + _po.CreateTime = DateTime.Now; + _po.CreateUser = str; + _po.BeginTime = DateTime.Now; + _po.EndTime = p_PoBillTime; + if (site == "U32") + { + _po.Remark = p_dataRow["备注"].ToString(); + } + p_poList.Add(_po); + + return _po; + } + private static TB_ASK CreateAsk(List p_poList, List p_askList, DataRow p_dataRow, DateTime p_PoBillTime, string str,ScpEntities db,string site) + { + var _VendId = p_dataRow["供应商编号"].ToString(); + var _po = p_poList.FirstOrDefault(p => p.VendId == _VendId + && p.EndTime == p_PoBillTime); + var _Ask = p_askList.FirstOrDefault(p => p.VendId == _VendId + && p.EndTime == p_PoBillTime); + if (_Ask != null) return _Ask; + TB_ASK _ask = new TB_ASK(); + _ask.AskBillNum = "1"; + _ask.GUID = Guid.NewGuid(); + _ask.PoBillNum = _po.PoBillNum; + _ask.VendId = _po.VendId; + _ask.IsDeleted = false; + _ask.CreateTime = DateTime.Now; + _ask.CreateUser = str; + _ask.Site = site; + _ask.ReceivedPort = "";//交货口 + _ask.State = (int)AskState.New; + _ask.ModType = 2; + _ask.ErpBillNum = _po.PoBillNum; + _ask.BeginTime = DateTime.Parse(_po.BeginTime.ToString()); + _ask.Buyer = _po.Buyer; + _ask.EndTime = p_PoBillTime; + _ask.BuyerPhone = _po.BuyerPhone; + _ask.SubSite = site; + if (site == "U32") + { + _ask.Remark = p_dataRow["备注"].ToString(); + _po.Remark = p_dataRow["备注"].ToString(); + } + p_askList.Add(_ask); + return _ask; + } + private static TB_ASK CreateManyAsk(List p_poList, List p_askList, DataRow p_dataRow, DateTime p_PoBillTime, string str, ScpEntities db, string site) + { + var _VendId = p_dataRow["供应商编号"].ToString(); + var _po = p_poList.FirstOrDefault(p => p.VendId == _VendId + && p.EndTime == p_PoBillTime); + var _Ask = p_askList.FirstOrDefault(p => p.VendId == _VendId + && p.EndTime == p_PoBillTime); + if (_Ask != null) return _Ask; + TB_ASK _ask = new TB_ASK(); + _ask.AskBillNum = "1"; + _ask.GUID = Guid.NewGuid(); + _ask.PoBillNum = _po.PoBillNum; + _ask.VendId = _po.VendId; + _ask.IsDeleted = false; + _ask.CreateTime = DateTime.Now; + _ask.CreateUser = str; + _ask.Site = site; + _ask.ReceivedPort = "";//交货口 + _ask.State = (int)AskState.New; + _ask.ModType = 2; + _ask.ErpBillNum = _po.PoBillNum; + _ask.BeginTime = DateTime.Parse(_po.BeginTime.ToString()); + _ask.Buyer = _po.Buyer; + _ask.EndTime = p_PoBillTime; + _ask.BuyerPhone = _po.BuyerPhone; + _ask.SubSite = site; + if (site == "U32") + { + _ask.Remark = p_dataRow["备注"].ToString(); + _po.Remark = p_dataRow["备注"].ToString(); + } + _ask.Extend3 = "1"; + p_askList.Add(_ask); + return _ask; + } + + private static TB_ASK_DETAIL CreateAskDetail(ScpEntities db, DataRow p_dataRow, TB_PO p_Po, TB_ASK p_Ask,TB_PO_DETAIL p_PoDetail,string str,string site) + { + TB_ASK_DETAIL _tDetail = new TB_ASK_DETAIL(); + + _tDetail.PoBillNum = p_Po.PoBillNum; + _tDetail.AskBillNum = p_Ask.AskBillNum; + _tDetail.PoLine = p_PoDetail.PoLine; + _tDetail.PoUnit = p_PoDetail.PoUnit; + _tDetail.CreateTime = DateTime.Now; + _tDetail.CreateUser = str; + _tDetail.PartCode = p_PoDetail.PartCode; + _tDetail.BeginTime = DateTime.Now; + _tDetail.EndTime = p_PoDetail.EndTime; + _tDetail.TempQty = 0; + _tDetail.AskQty = p_PoDetail.PlanQty; + _tDetail.IsDeleted = false; + _tDetail.LocUnit = p_PoDetail.LocUnit; + _tDetail.UnConv = 1; + _tDetail.SubSite = p_dataRow["零件号"].ToString(); + var _vender2 = db.TA_Appliance.SingleOrDefault(t => t.PartNumber == _tDetail.SubSite.ToUpper() && t.VendID == p_Po.VendId); + var part = db.TA_PART.SingleOrDefault(t => t.PartCode == _tDetail.PartCode); + _tDetail.DockCode = part.PartGroup; + _tDetail.Extend1 = _vender2.ReceivingPort;//收货口 + _tDetail.Extend2 = _vender2.Model;//车型 + _tDetail.Extend3 = _vender2.Texture;//材质 + _tDetail.State = (int)PoState.Open; + _tDetail.Currency = part.PartDesc2;//规格 + _tDetail.GUID = Guid.NewGuid(); + _tDetail.Price = p_PoDetail.Price; + _tDetail.Remark = p_Po.VendId; + _tDetail.Remark1= p_Po.VendId; + _tDetail.UpdateInfo= p_dataRow["组件物料号"].ToString(); + + if (site == "U32") + { + _tDetail.Remark = p_dataRow["备注"].ToString(); + } + + return _tDetail; + } + private static TB_ASK_DETAIL CreateManyAskDetail(ScpEntities db, DataRow p_dataRow, TB_PO p_Po, TB_ASK p_Ask, TB_PO_DETAIL p_PoDetail, string str, string site) + { + TB_ASK_DETAIL _tDetail = new TB_ASK_DETAIL(); + + _tDetail.PoBillNum = p_Po.PoBillNum; + _tDetail.AskBillNum = p_Ask.AskBillNum; + _tDetail.PoLine = p_PoDetail.PoLine; + _tDetail.PoUnit = p_PoDetail.PoUnit; + _tDetail.CreateTime = DateTime.Now; + _tDetail.CreateUser = str; + _tDetail.PartCode = p_PoDetail.PartCode; + _tDetail.BeginTime = DateTime.Now; + _tDetail.EndTime = p_PoDetail.EndTime; + _tDetail.TempQty = 0; + _tDetail.AskQty = p_PoDetail.PlanQty; + _tDetail.IsDeleted = false; + _tDetail.LocUnit = p_PoDetail.LocUnit; + _tDetail.UnConv = 1; + _tDetail.SubSite = p_dataRow["零件号"].ToString(); + var _vender2 = db.TA_Appliance.SingleOrDefault(t => t.PartNumber == _tDetail.SubSite.ToUpper() && t.VendID == p_Po.VendId); + var part = db.TA_PART.SingleOrDefault(t => t.PartCode == _tDetail.PartCode); + _tDetail.DockCode = part.PartGroup; + _tDetail.Extend1 = _vender2.ReceivingPort;//收货口 + _tDetail.Extend2 = _vender2.Model;//车型 + _tDetail.Extend3 = _vender2.Texture;//材质 + _tDetail.State = (int)PoState.Open; + _tDetail.Currency = part.PartDesc2;//规格 + _tDetail.GUID = Guid.NewGuid(); + _tDetail.Price = p_PoDetail.Price; + _tDetail.Remark = p_Po.VendId; + //_tDetail.UpdateInfo = p_dataRow["组件物料号"].ToString(); + return _tDetail; + } + + private static TB_PO_DETAIL CreatePoDetail(DataRow p_dataRow,decimal p_Qty, ScpEntities db, DateTime p_PoBillTime,TB_PO p_Po,TB_ASK p_Ask,string str, List po_DetailList,string site) + { + int _rowNumber = 1; + var _Part = p_dataRow["物料号码"].ToString(); + TB_PO_DETAIL _detail = new TB_PO_DETAIL(); + + _detail.PoBillNum = p_Po.PoBillNum; + _detail.PartCode = p_dataRow["物料号码"].ToString(); + _detail.PoUnit = p_dataRow["单位"].ToString(); + _detail.Extend1 = p_dataRow["零件号"].ToString(); + _detail.Currency = "CNY"; + _detail.CreateTime =DateTime.Parse( p_dataRow["订单创建时间"].ToString()); + _detail.BeginTime = DateTime.Now; + _detail.IsDeleted = false; + _detail.LocUnit = p_dataRow["组件计量单位"].ToString(); + _detail.UnConv = 1; + _detail.PackQty = decimal.Parse(p_dataRow["组件数量"].ToString()); + _detail.State = (int)PoState.Open; + _detail.GUID = Guid.NewGuid(); + _detail.Site = site; + _detail.EndTime = p_PoBillTime; + _detail.PlanQty = p_Qty; + _detail.CreateUser = str; + var _price = db.TB_NetPrice.Count(t => t.PartCode == _detail.PartCode.ToUpper() && t.VendId == p_Po.VendId); + if (_price == 0) + { + var _price1 = db.TA_PART.SingleOrDefault(t => t.PartCode == _detail.PartCode.ToUpper()); + _detail.Price = decimal.Parse(_price1.Remark); + } + else + { + var _price2 = db.TB_NetPrice.Where(t => t.PartCode == _detail.PartCode.ToUpper()&&t.VendId==p_Po.VendId).Select(r => r.EndTime).Max(); + var _price8 = db.TB_NetPrice.Where(t => t.PartCode == _detail.PartCode.ToUpper() && t.VendId == p_Po.VendId).Select(r => r.StartTime).Max(); + DateTime dateTime = DateTime.Now; + if (_price2 > dateTime || _price2 == dateTime) + { + var _price3 = db.TB_NetPrice.FirstOrDefault(t => t.PartCode == _detail.PartCode.ToUpper() && t.StartTime == _price8 && t.VendId == p_Po.VendId); + _detail.Price = _price3.Amt; + } + else + { + var _price4 = db.TA_PART.SingleOrDefault(t => t.PartCode == _detail.PartCode.ToUpper()); + _detail.Price = decimal.Parse(_price4.Remark); + } + } + _detail.Extend3 = p_dataRow["BOM版本"].ToString(); + _detail.Extend2= p_dataRow["存储地点"].ToString(); + _detail.SubSite = p_dataRow["组件物料号"].ToString(); + _detail.CreateUser = p_dataRow["采购组"].ToString();//采购组 + _rowNumber++; + + + return _detail; + } + private static TB_PO_DETAIL CreateManyPoDetail(DataRow p_dataRow, decimal p_Qty, ScpEntities db, DateTime p_PoBillTime, TB_PO p_Po, TB_ASK p_Ask, string str, List po_DetailList, string site) + { + int _rowNumber = 1; + var _Part = p_dataRow["物料号码"].ToString(); + TB_PO_DETAIL _detail = new TB_PO_DETAIL(); + _detail.PoBillNum = p_Po.PoBillNum; + _detail.PartCode = p_dataRow["物料号码"].ToString(); + _detail.PoUnit = p_dataRow["单位"].ToString(); + _detail.Extend1 = p_dataRow["零件号"].ToString(); + _detail.Currency = "CNY"; + _detail.CreateTime = DateTime.Parse(p_dataRow["订单创建时间"].ToString()); + _detail.BeginTime = DateTime.Now; + _detail.IsDeleted = false; + _detail.UnConv = 1; + _detail.State = (int)PoState.Open; + _detail.GUID = Guid.NewGuid(); + _detail.Site = site; + _detail.EndTime = p_PoBillTime; + _detail.PlanQty = p_Qty; + _detail.CreateUser = str; + var _price = db.TB_NetPrice.Count(t => t.PartCode == _detail.PartCode.ToUpper() && t.VendId == p_Po.VendId); + if (_price == 0) + { + var _price1 = db.TA_PART.SingleOrDefault(t => t.PartCode == _detail.PartCode.ToUpper()); + _detail.Price = decimal.Parse(_price1.Remark); + } + else + { + var _price2 = db.TB_NetPrice.Where(t => t.PartCode == _detail.PartCode.ToUpper() && t.VendId == p_Po.VendId).Select(r => r.EndTime).Max(); + var _price8 = db.TB_NetPrice.Where(t => t.PartCode == _detail.PartCode.ToUpper() && t.VendId == p_Po.VendId).Select(r => r.StartTime).Max(); + DateTime dateTime = DateTime.Now; + if (_price2 > dateTime || _price2 == dateTime) + { + var _price3 = db.TB_NetPrice.FirstOrDefault(t => t.PartCode == _detail.PartCode.ToUpper() && t.StartTime == _price8 && t.VendId == p_Po.VendId); + _detail.Price = _price3.Amt; + } + else + { + var _price4 = db.TA_PART.SingleOrDefault(t => t.PartCode == _detail.PartCode.ToUpper()); + _detail.Price = decimal.Parse(_price4.Remark); + } + } + _detail.CreateUser = p_dataRow["采购组"].ToString();//采购组 + _rowNumber++; + + + return _detail; + } + private static TS_UNI_API CreateTsuniapi( TB_PO p_Po, TB_ASK p_Ask, TB_PO_DETAIL p_PoDetail,TB_ASK_DETAIL p_AskDetail,DataRow p_dataRow,string site) + { + + TS_UNI_API uni = new TS_UNI_API(); + + uni.InterfaceType = "Pobillnum"; //订单标识 + uni.TableName = "TS_UNI_API"; + uni.BillType = (int)BillType.ReHandleVin; + uni.SubBillType = 0; + uni.BillNum = p_Po.PoBillNum;//订单号 + uni.PartCode = p_PoDetail.PartCode; //零件号 + uni.Buyer = p_Po.Buyer;//采购员 + uni.BuyerPhone = p_Po.BuyerPhone;//采购员电话 + uni.ModType = p_PoDetail.CreateUser;//采购组 + uni.Qty = p_PoDetail.PlanQty;//零件数量 + uni.CreateOper = p_Po.CreateUser; + uni.CreateTime = p_Po.CreateTime;//订单创建时间 + uni.PutTime = ScpCache.GetServerTime(); + uni.VendId = p_Po.VendId;//供应商编号 + uni.PoUnit = p_PoDetail.PoUnit;//零件单位 + uni.LocUnit = p_PoDetail.LocUnit;//组件单位 + uni.ValidDate = DateTime.Now;//当前系统时间 + uni.ErpLineNum = p_PoDetail.PoLine;//订单行号 + uni.Price = p_PoDetail.Price;//零件价格 + uni.Site = p_Po.Site;//地点 + uni.Extend3= p_dataRow["存储地点"].ToString(); + uni.Domain = site; + uni.Extend2 = "N";//退货凭证 + uni.Extend1 = p_PoDetail.SubSite;//组件物料号 + // uni.PutTime = DateTime.Parse(_detail.EndTime.ToString()); //要求到货日期 + uni.Batch = p_PoDetail.PoUnit;//采购计量单位 + uni.ErpBillNum = p_PoDetail.PackQty.ToString();//组件数量 + uni.VendBatch = p_PoDetail.CreateUser; + uni.State = 1; + uni.Invoice = "3"; + uni.Currency = p_Po.SubSite; + if (site == "W21") + { + uni.Barcode = "CY03"; + } + else + { + uni.Barcode = "FB06"; + } + + uni.Currency = p_PoDetail.Extend3; + uni.Receiver = "I";//订单类型 + uni.SubSite = p_AskDetail.Extend1; + uni.Attn = p_dataRow["备注"].ToString(); + return uni; + } + private static List CreateManyTsuniapi(TB_PO p_Po, TB_ASK p_Ask, TB_PO_DETAIL p_PoDetail, TB_ASK_DETAIL p_AskDetail, DataRow p_dataRow, string site, ScpEntities db) + { + + List unilist = new List(); + var _bom = p_dataRow["BOM版本"].ToString(); + var subpart = db.TA_SubPartCode.Where(p => p.PartCode == p_PoDetail.PartCode&&p.BOMedtiton == _bom).ToList(); + foreach (var sub in subpart) + { + TS_UNI_API uni = new TS_UNI_API(); + uni.InterfaceType = "Pobillnum"; //订单标识 + uni.TableName = "TS_UNI_API"; + uni.BillType = (int)BillType.ReHandleVin; + uni.SubBillType = 0; + uni.BillNum = p_Po.PoBillNum;//订单号 + uni.PartCode = p_PoDetail.PartCode; //零件号 + uni.Buyer = p_Po.Buyer;//采购员 + uni.BuyerPhone = p_Po.BuyerPhone;//采购员电话 + uni.ModType = p_PoDetail.CreateUser;//采购组 + uni.Qty = p_PoDetail.PlanQty;//零件数量 + uni.CreateOper = p_Po.CreateUser; + uni.CreateTime = p_Po.CreateTime;//订单创建时间 + uni.PutTime = ScpCache.GetServerTime(); + uni.VendId = p_Po.VendId;//供应商编号 + uni.PoUnit = p_PoDetail.PoUnit;//零件单位 + var unit = db.TA_PART.FirstOrDefault(t=>t.PartCode==sub.SubPartCode); + uni.LocUnit = unit.Unit;//组件单位 + uni.ValidDate = DateTime.Now;//当前系统时间 + uni.ErpLineNum = p_PoDetail.PoLine;//订单行号 + uni.Price = p_PoDetail.Price;//零件价格 + uni.Site = p_Po.Site;//地点 + uni.Extend3 = p_dataRow["存储地点"].ToString(); + uni.Domain = site; + uni.Extend2 = "N";//退货凭证 + uni.Extend1 = sub.SubPartCode;//组件物料号 + uni.Batch = p_PoDetail.PoUnit;//采购计量单位 + uni.ErpBillNum = (sub.Qty* p_PoDetail.PlanQty).ToString();//组件数量 + uni.VendBatch = p_PoDetail.CreateUser; + uni.State = 1; + uni.Invoice = "3"; + uni.Currency = p_Po.SubSite; + if (site == "W21") + { + uni.Barcode = "CY03"; + } + else + { + uni.Barcode = "FB06"; + } + + uni.Currency = p_dataRow["BOM版本"].ToString(); + uni.Receiver = "I";//订单类型 + uni.SubSite = p_AskDetail.Extend1; + unilist.Add(uni); + } + return unilist; + } + private static List CreateManyPoDetailSubPart(TB_PO p_Po, TB_ASK p_Ask, TB_PO_DETAIL p_PoDetail, TB_ASK_DETAIL p_AskDetail, DataRow p_dataRow, string site, ScpEntities db) + { + List posublist = new List(); + var _bom = p_dataRow["BOM版本"].ToString(); + var subpart = db.TA_SubPartCode.Where(p => p.PartCode == p_PoDetail.PartCode && p.BOMedtiton == _bom).ToList(); + foreach (var sub in subpart) + { + TB_PO_SUBDETAIL posub = new TB_PO_SUBDETAIL(); + posub.PoBillNum = p_Po.PoBillNum; + posub.PartCode = p_PoDetail.PartCode; + posub.SubPartCode = sub.SubPartCode; + posub.BOMedtiton = sub.BOMedtiton; + posub.Qty = p_PoDetail.PlanQty; + posub.SubQty = p_PoDetail.PlanQty * sub.Qty; + posub.PoLine = p_PoDetail.PoLine; + posublist.Add(posub); + } + + + return posublist; + } + private static List CreateManyAskSubPart(TB_PO p_Po, TB_ASK p_Ask, TB_PO_DETAIL p_PoDetail, TB_ASK_DETAIL p_AskDetail, DataRow p_dataRow, string site, ScpEntities db) + { + List asksublist = new List(); + var _bom = p_dataRow["BOM版本"].ToString(); + var subpart = db.TA_SubPartCode.Where(p => p.PartCode == p_PoDetail.PartCode && p.BOMedtiton == _bom).ToList(); + foreach (var sub in subpart) + { + TA_ASK_SUBPART asksub = new TA_ASK_SUBPART(); + asksub.PartCode = p_PoDetail.PartCode; + asksub.SubPartCode = sub.SubPartCode; + asksub.BOMedtiton = sub.BOMedtiton; + asksub.Qty = p_PoDetail.PlanQty*sub.Qty; + asksub.AskBillNum = p_AskDetail.PoBillNum; + + asksublist.Add(asksub); + } + + + return asksublist; + } + private static TB_PO CreatePo1(List p_poList, DataRow p_dataRow, DateTime p_PoBillTime, string str,string site ) + { + var _VendId = p_dataRow["供应商编号"].ToString(); + var po = p_poList.FirstOrDefault(p => p.VendId == _VendId + && p.EndTime == p_PoBillTime); + if (po != null) return po; + TB_PO _po = new TB_PO(); + _po.PoBillNum = Guid.NewGuid().ToString(); // + _po.VendId = p_dataRow["供应商编号"].ToString(); + _po.Buyer = p_dataRow["采购员"].ToString(); + _po.ErpBillNum = _po.PoBillNum; + _po.ModType = (int)BillFwModType.Contract; + _po.BuyerPhone = p_dataRow["采购员电话"].ToString(); + _po.Site = site; + _po.State = (int)PoState.Open; + _po.GUID = Guid.NewGuid(); + _po.IsDeleted = false; + _po.CreateTime = DateTime.Now; + _po.CreateUser = str; + _po.BeginTime = DateTime.Now; + _po.EndTime = p_PoBillTime; + if (site == "U32") + { + _po.Remark = p_dataRow["备注"].ToString(); + } + p_poList.Add(_po); + return _po; + } + private static TB_PO CreatePoQh(List p_poList, DataRow p_dataRow, DateTime p_PoBillTime, string str, string site) + { + var _VendId = p_dataRow["供应商编号"].ToString(); + var po = p_poList.FirstOrDefault(p => p.VendId == _VendId + && p.EndTime == p_PoBillTime); + if (po != null) return po; + TB_PO _po = new TB_PO(); + _po.PoBillNum = Guid.NewGuid().ToString(); // + _po.VendId = p_dataRow["供应商编号"].ToString(); + _po.Buyer = p_dataRow["采购员"].ToString(); + _po.ErpBillNum = _po.PoBillNum; + _po.ModType = (int)BillFwModType.Qh_Contract; + _po.BuyerPhone = p_dataRow["采购员电话"].ToString(); + _po.Site = site; + _po.State = (int)PoState.Open; + _po.GUID = Guid.NewGuid(); + _po.IsDeleted = false; + _po.CreateTime = DateTime.Now; + _po.CreateUser = str; + _po.BeginTime = DateTime.Now; + _po.EndTime = p_PoBillTime; + + if (site == "U32") + { + _po.Remark = p_dataRow["备注"].ToString(); + } + _po.UpdateInfo="Y"; + p_poList.Add(_po); + return _po; + } + + private static TB_ASK CreateAsk1(List p_poList, List p_askList, DataRow p_dataRow, DateTime p_PoBillTime, string str, ScpEntities db,string site ) + { + var _VendId = p_dataRow["供应商编号"].ToString(); + var _po = p_poList.FirstOrDefault(p => p.VendId == _VendId + && p.EndTime == p_PoBillTime); + var _Ask = p_askList.FirstOrDefault(p => p.VendId == _VendId + && p.EndTime == p_PoBillTime); + if (_Ask != null) return _Ask; + int _num = 1; + TB_ASK _ask = new TB_ASK(); + _ask.AskBillNum = "1"; + _ask.GUID = Guid.NewGuid(); + _ask.PoBillNum = _po.PoBillNum; + _ask.VendId = _po.VendId; + _ask.IsDeleted = false; + _ask.CreateTime = DateTime.Now; + _ask.CreateUser = str; + _ask.Site = site; + _ask.ReceivedPort = "";//交货口 + _ask.State = (int)AskState.New; + //_ask.State = (int)AskState.Release; + _ask.ModType = 2; + _ask.ErpBillNum = _po.PoBillNum; + _ask.BeginTime = DateTime.Parse(_po.BeginTime.ToString()); + _ask.Buyer = _po.Buyer; + _ask.BuyerPhone = _po.BuyerPhone; + _ask.EndTime = p_PoBillTime; + _ask.SubSite = site; + if (site == "U32") + { + _ask.Remark = p_dataRow["备注"].ToString(); + } + p_askList.Add(_ask); + return _ask; + } + + private static TB_ASK_DETAIL CreateAskDetail1(ScpEntities db, DataRow p_dataRow, TB_PO p_Po, TB_ASK p_Ask, TB_PO_DETAIL p_PoDetail, string str,string site) + { + TB_ASK_DETAIL _tDetail = new TB_ASK_DETAIL(); + + _tDetail.PoBillNum = p_Po.PoBillNum; + _tDetail.AskBillNum = p_Ask.AskBillNum; + _tDetail.PoLine = p_PoDetail.PoLine; + _tDetail.PoUnit = p_PoDetail.PoUnit; + _tDetail.CreateTime = DateTime.Now; + _tDetail.CreateUser = str; + _tDetail.PartCode = p_PoDetail.PartCode; + _tDetail.BeginTime = DateTime.Now; + _tDetail.EndTime = p_PoDetail.EndTime; + _tDetail.TempQty = 0; + _tDetail.AskQty = p_PoDetail.PlanQty; + _tDetail.IsDeleted = false; + _tDetail.LocUnit = p_PoDetail.LocUnit; + _tDetail.UnConv = 1; + _tDetail.SubSite = p_dataRow["零件号"].ToString(); + if (!string.IsNullOrEmpty(_tDetail.SubSite.ToString())) + { + var _vender2 = db.TA_Appliance.FirstOrDefault(t => t.PartNumber == _tDetail.SubSite.ToUpper() && t.VendID == p_Po.VendId); + _tDetail.Extend1 = _vender2.ReceivingPort;//收货口 + _tDetail.Extend2 = _vender2.Model;//车型 + _tDetail.Extend3 = _vender2.Texture;//材质 + } + var part = db.TA_PART.SingleOrDefault(t => t.PartCode == _tDetail.PartCode); + _tDetail.DockCode = part.PartGroup; + + _tDetail.State = (int)PoState.Open; + _tDetail.Currency = part.PartDesc2;//规格 + _tDetail.GUID = Guid.NewGuid(); + _tDetail.Price = p_PoDetail.Price; + _tDetail.Remark = p_Po.VendId; + _tDetail.Remark1 = p_Po.VendId; + if (site == "U32") + { + _tDetail.Remark = p_dataRow["备注"].ToString(); + } + return _tDetail; + } + + private static TB_PO_DETAIL CreatePoDetail1(DataRow p_dataRow, decimal p_Qty, ScpEntities db, DateTime p_PoBillTime, TB_PO p_Po, TB_ASK p_Ask, string str,string site) + { + int _rowNumber = 1; + TB_PO_DETAIL _detail = new TB_PO_DETAIL(); + _detail.PartCode= p_dataRow["物料号码"].ToString(); + _detail.PoBillNum = p_Po.PoBillNum; + _detail.PoUnit = p_dataRow["单位"].ToString(); + _detail.Extend1 = p_dataRow["零件号"].ToString(); + _detail.Currency = "CNY"; + _detail.PoLine = _rowNumber; + _detail.CreateTime = DateTime.Parse(p_dataRow["订单创建时间"].ToString()); + _detail.BeginTime = DateTime.Now; + _detail.IsDeleted = false; + _detail.UnConv = 1; + _detail.State = (int)PoState.Open; + _detail.GUID = Guid.NewGuid(); + _detail.Site = site; + _detail.EndTime = p_PoBillTime; + _detail.PlanQty = p_Qty; + _detail.CreateUser = str; + var _price = db.TB_PRICE.Count(t => t.PartCode == _detail.PartCode.ToUpper() && t.VendId == p_Po.VendId); + if (_price == 0) + { + var _price1 = db.TA_PART.SingleOrDefault(t => t.PartCode == _detail.PartCode.ToUpper()); + _detail.Price = decimal.Parse(_price1.Remark); + } + else + { + var _price2 = db.TB_PRICE.Where(t => t.PartCode == _detail.PartCode.ToUpper()&&t.VendId==p_Po.VendId).Select(r => r.EndTime).Max(); + var _price8 = db.TB_PRICE.Where(t => t.PartCode == _detail.PartCode.ToUpper() && t.VendId == p_Po.VendId).Select(r => r.StartTime).Max(); + DateTime dateTime = DateTime.Now; + if(_price2> dateTime|| _price2 ==dateTime) + { + var _price3 = db.TB_PRICE.FirstOrDefault(t => t.PartCode == _detail.PartCode.ToUpper() && t.EndTime == _price2 && t.VendId == p_Po.VendId); + _detail.Price = _price3.Amt; + } + else + { + var _price4 = db.TA_PART.FirstOrDefault(t => t.PartCode == _detail.PartCode.ToUpper()); + _detail.Price = decimal.Parse(_price4.Remark); + } + + } + _detail.Extend2 = p_dataRow["存储地点"].ToString(); + _detail.CreateUser = p_dataRow["采购组"].ToString();//采购组 + _rowNumber++; + return _detail; + } + private static TB_PO_DETAIL CreatePoDetail1Qh(DataRow p_dataRow, decimal p_Qty, ScpEntities db, DateTime p_PoBillTime, TB_PO p_Po, TB_ASK p_Ask, string str, string site) + { + int _rowNumber = 1; + TB_PO_DETAIL _detail = new TB_PO_DETAIL(); + _detail.PartCode = p_dataRow["物料号码"].ToString(); + _detail.PoBillNum = p_Po.PoBillNum; + _detail.PoUnit = p_dataRow["单位"].ToString(); + _detail.Extend1 = p_dataRow["零件号"].ToString(); + _detail.Currency = "CNY"; + _detail.PoLine = _rowNumber; + _detail.CreateTime = DateTime.Parse(p_dataRow["订单创建时间"].ToString()); + _detail.BeginTime = DateTime.Now; + _detail.IsDeleted = false; + _detail.UnConv = 1; + _detail.State = (int)PoState.Open; + _detail.GUID = Guid.NewGuid(); + _detail.Site = site; + _detail.EndTime = p_PoBillTime; + _detail.PlanQty = p_Qty; + _detail.CreateUser = str; + var _price = db.TB_PRICE.Count(t => t.PartCode == _detail.PartCode.ToUpper() && t.VendId == p_Po.VendId); + if (_price == 0) + { + var _price1 = db.TA_PART.SingleOrDefault(t => t.PartCode == _detail.PartCode.ToUpper()); + _detail.Price = decimal.Parse(_price1.Remark); + } + else + { + var _price2 = db.TB_PRICE.Where(t => t.PartCode == _detail.PartCode.ToUpper() && t.VendId == p_Po.VendId).Select(r => r.EndTime).Max(); + var _price8 = db.TB_PRICE.Where(t => t.PartCode == _detail.PartCode.ToUpper() && t.VendId == p_Po.VendId).Select(r => r.StartTime).Max(); + DateTime dateTime = DateTime.Now; + if (_price2 > dateTime || _price2 == dateTime) + { + var _price3 = db.TB_PRICE.FirstOrDefault(t => t.PartCode == _detail.PartCode.ToUpper() && t.EndTime == _price2 && t.VendId == p_Po.VendId); + _detail.Price = _price3.Amt; + } + else + { + var _price4 = db.TA_PART.FirstOrDefault(t => t.PartCode == _detail.PartCode.ToUpper()); + _detail.Price = decimal.Parse(_price4.Remark); + } + + } + _detail.Extend2 = p_dataRow["存储地点"].ToString(); + _detail.CreateUser = p_dataRow["采购组"].ToString();//采购组 + _detail.UpdateInfo = p_dataRow["供应商编号"].ToString(); + _rowNumber++; + + + return _detail; + } + private static TS_UNI_API CreateTsuniapi1(TB_PO p_Po, TB_ASK p_Ask, TB_PO_DETAIL p_PoDetail, DataRow p_dataRow,TB_ASK_DETAIL _Askdetail,string site) + { + + TS_UNI_API uni = new TS_UNI_API(); + + uni.InterfaceType = "Pobillnum"; //订单标识 + uni.TableName = "TS_UNI_API"; + uni.BillType = (int)BillType.ReHandleVin; + uni.SubBillType = 0; + uni.BillNum = p_Po.PoBillNum;//订单号 + uni.PartCode = p_PoDetail.PartCode; //零件号 + uni.Buyer = p_Po.Buyer;//采购员 + uni.BuyerPhone = p_Po.BuyerPhone;//采购员电话 + uni.ModType = p_PoDetail.CreateUser;//采购组 + uni.Qty = p_PoDetail.PlanQty;//零件数量 + uni.CreateOper = p_Po.CreateUser; + uni.CreateTime = p_Po.CreateTime;//订单创建时间 + uni.PutTime = ScpCache.GetServerTime(); + uni.VendId = p_Po.VendId;//供应商编号 + uni.PoUnit = p_PoDetail.PoUnit;//零件单位 + uni.LocUnit = p_PoDetail.LocUnit;//组件单位 + uni.ValidDate = DateTime.Now;//当前系统时间 + uni.ErpLineNum = 1;//订单行号 + uni.Price = p_PoDetail.Price;//零件价格 + uni.Site = p_Po.Site;//地点 + uni.Extend3 = p_dataRow["存储地点"].ToString(); + uni.Domain = site; + uni.Extend2 = "N";//退货凭证 + uni.PutTime = DateTime.Parse(p_PoDetail.EndTime.ToString()); //要求到货日期 + uni.Batch = p_PoDetail.PoUnit;//采购计量单位 + uni.VendBatch = p_PoDetail.CreateUser; + uni.State = 1; + uni.Invoice = "0"; + if (p_Po.Site == "W21") + { + uni.Barcode = "CY01"; + } + else{ + uni.Barcode = "FB03"; + } + + uni.Currency = p_PoDetail.Extend3; + uni.Receiver = "I"; + uni.SubSite = _Askdetail.Extend1; + if (site == "U32") + { + uni.Attn = p_dataRow["备注"].ToString(); + } + return uni; + } + private static TS_UNI_API CreateTsuniapiQh(TB_PO p_Po, TB_ASK p_Ask, TB_PO_DETAIL p_PoDetail, DataRow p_dataRow, TB_ASK_DETAIL _Askdetail, string site) + { + + TS_UNI_API uni = new TS_UNI_API(); + + uni.InterfaceType = "Pobillnum"; //订单标识 + uni.TableName = "TS_UNI_API"; + uni.BillType = (int)BillType.ReHandleVin; + uni.SubBillType = 0; + uni.BillNum = p_Po.PoBillNum;//订单号 + uni.PartCode = p_PoDetail.PartCode; //零件号 + uni.Buyer = p_Po.Buyer;//采购员 + uni.BuyerPhone = p_Po.BuyerPhone;//采购员电话 + uni.ModType = p_PoDetail.CreateUser;//采购组 + uni.Qty = p_PoDetail.PlanQty;//零件数量 + uni.CreateOper = p_Po.CreateUser; + uni.CreateTime = p_Po.CreateTime;//订单创建时间 + uni.PutTime = ScpCache.GetServerTime(); + uni.VendId = p_Po.VendId;//供应商编号 + uni.PoUnit = p_PoDetail.PoUnit;//零件单位 + uni.LocUnit = p_PoDetail.LocUnit;//组件单位 + uni.ValidDate = DateTime.Now;//当前系统时间 + uni.ErpLineNum = 1;//订单行号 + uni.Price = p_PoDetail.Price;//零件价格 + uni.Site = p_Po.Site;//地点 + uni.Extend3 = p_dataRow["存储地点"].ToString(); + uni.Domain = site; + uni.Extend2 = "N";//退货凭证 + uni.PutTime = DateTime.Parse(p_PoDetail.EndTime.ToString()); //要求到货日期 + uni.Batch = p_PoDetail.PoUnit;//采购计量单位 + uni.VendBatch = p_PoDetail.CreateUser; + uni.State = 1; + uni.Invoice = "0"; + if (p_Po.Site == "W21") + { + uni.Barcode = "CY01"; + } + else + { + uni.Barcode = "FB03"; + } + + uni.Currency = p_PoDetail.Extend3; + uni.Receiver = "I"; + uni.SubSite = _Askdetail.Extend1; + uni.SubSite = "Y"; + return uni; + } + public static List EXCEL_ASK_Check(List p_order_list) + { + List ErrorList = new List(); + using (ScpEntities db = EntitiesFactory.CreateScpInstance()) + { + + p_order_list.ForEach + (p => + { + //var _ls = CheckExcel(db, p); + var _checkls = CheckExcelPackQty(db, p); + if (_checkls.Count > 0) + { + ErrorList.Add(string.Join("
", _checkls.ToArray())); + } + }); + } + return ErrorList; + } + public static ResultObject EXCEL_PO_TO_ASK(List p_order_list, string p_creator, string p_buyer, DateTime p_time, BillModType p_modtype, string p_site, bool IsAutoPublish = false) + { + ResultObject _ret = new ResultObject(); + try + { + using (ScpEntities db = EntitiesFactory.CreateScpInstance()) + { + int number = 1; + List lineError = new List(); + List ErrorList = new List(); + p_order_list.ForEach + (p => + { + var _ls = CheckExcel(db, p); + if (_ls.Count > 0) + { + lineError.Add(number.ToString()); + ErrorList.Add(string.Join("
", _ls.ToArray())); + } + number++; + + }); + if (lineError.Count > 0) + { + _ret.State = ReturnStatus.Failed; + _ret.MessageList.AddRange(ErrorList); + _ret.Result = false; + } + else + { + p_order_list = p_order_list.Where(p => int.Parse(p.数量) != 0).ToList(); + + + //var VenderList = p_order_list.Select(p => p.供应商编号).Distinct(); + //var PartCodeList = p_order_list.Select(p => p.零件号).Distinct(); + var OrderList = p_order_list.GroupBy(p => new { p.分组编号, p.供应商编号 }).ToList(); + OrderList.ForEach((p) => + { + var list_distinct = p.GroupBy(t => new { t.零件号, t.行号 }).ToList(); + var list = p.ToList(); + if (list_distinct.Count < list.Count) + { + _ret.MessageList.Add("相同组号,存在同一编号、行号的数据"); + return; + } + if (list.Count > 0) + { + + var _entity = list.FirstOrDefault(); + TB_ASK _ask = new TB_ASK(); + _ask.AskBillNum = SCP_BILLCODE_CONTROLLER.MakeASKCode(); + _ask.State = (int)AskState.New; + _ask.PoBillNum = _entity.QAD订单号.ToUpper(); + _ask.ModType = (int)BillModType.Contract; + _ask.Site = p_site; + if (IsAutoPublish) + { + _ask.State = (int)AskState.Release; + } + else + { + _ask.State = (int)AskState.New; + } + _ask.BeginTime = DateTime.Now; + _ask.Buyer = _entity.交货联系人; + _ask.BuyerPhone = _entity.交货联系人电话; + _ask.ErpBillNum = _entity.QAD订单号.ToUpper(); + _ask.EndTime = DateTime.Parse(_entity.要求到货日期); + _ask.CreateTime = DateTime.Now; + _ask.CreateUser = p_creator; + _ask.VendId = _entity.供应商编号.ToUpper(); + _ask.GUID = Guid.NewGuid(); + _ask.IsDeleted = false; + db.TB_ASK.Add(_ask); + + #region 供应商新任务代办接口 + TB_PENING_ITEMS _item = new TB_PENING_ITEMS(); + _item.ROLE_NAME = "供应商"; + _item.ITEM_NO = _ask.AskBillNum; + _item.ITEM_CONTENT = "要货看盘有信息"; + _item.ITEM_TYPE = (int)PENDING_MESSAGE_TYPE.NEW_ASK; + _item.VEND_ID = _ask.VendId; + _item.ITEM_STATE = (int)PENDING_STATE.WAITING; + _item.SENDER = _entity.交货联系人; + _item.SENDING_TIME = DateTime.Now; + db.TB_PENING_ITEMS.Add(_item); + #endregion + + // int _number = 1; + list.ForEach((itm) => + { + TB_ASK_DETAIL _t_ASK_Detail = new TB_ASK_DETAIL(); + //_t_ASK_Detail.PoLine = _number; + _t_ASK_Detail.PoLine = Int32.Parse(itm.行号); + _t_ASK_Detail.Currency = itm.币种; + _t_ASK_Detail.AskBillNum = _ask.AskBillNum; + _t_ASK_Detail.PoBillNum = _ask.PoBillNum; + _t_ASK_Detail.PoUnit = itm.单位; + _t_ASK_Detail.CreateTime = DateTime.Now; + _t_ASK_Detail.CreateUser = _ask.CreateUser; + _t_ASK_Detail.PartCode = (itm.零件号.ToUpper()).TrimEnd(); + _t_ASK_Detail.BeginTime = _ask.BeginTime; + _t_ASK_Detail.EndTime = DateTime.Parse(itm.要求到货日期); + _t_ASK_Detail.TempQty = decimal.Parse(itm.数量); + _t_ASK_Detail.AskQty = decimal.Parse(itm.数量); + _t_ASK_Detail.IsDeleted = false; + _t_ASK_Detail.LocUnit = itm.单位; + _t_ASK_Detail.UnConv = 1; + _t_ASK_Detail.State = _ask.State; + _t_ASK_Detail.Price = string.IsNullOrEmpty(itm.价格) ? 0 : decimal.Parse(itm.价格); + _t_ASK_Detail.GUID = Guid.NewGuid(); + _t_ASK_Detail.Remark = itm.备注; + db.TB_ASK_DETAIL.Add(_t_ASK_Detail); + // _number++; + + }); + } + else + { + _ret.MessageList.Add("ERP订单编号已存在,请重新导入!"); + return; + } + + if (_ret.MessageList.Count == 0) + { + int state = db.SaveChanges(); + if (state != -1) + { + _ret.State = ReturnStatus.Succeed; + _ret.Result = true; + } + else + { + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + } + } + else + { + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + } + } + ); + } + } + } + catch (System.Data.Entity.Validation.DbEntityValidationException dbEx)//捕获实体验证异常 + { + var sb = new StringBuilder(); + + foreach (var error in dbEx.EntityValidationErrors.ToList()) + { + + error.ValidationErrors.ToList().ForEach(i => + { + sb.AppendFormat("表:{0},字段:{1},信息:{2}\r\n", error.Entry.Entity.GetType().Name, i.PropertyName, i.ErrorMessage); + }); + } + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + _ret.ErrorList.Add(dbEx); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "EXCEL_PO_TO_ASK", sb.ToString()); + throw new ScpException(ResultCode.DbEntityValidationException, sb.ToString(), "字段验证失败" + sb.ToString()); + } + catch (OptimisticConcurrencyException ex)//并发冲突异常 + { + + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + _ret.ErrorList.Add(ex); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "EXCEL_PO_TO_ASK", ex.ToString()); + throw new ScpException(ResultCode.Exception, "9999", ex.ToString()); + } + catch (ScpException ex) + { + + + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + _ret.ErrorList.Add(ex); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "EXCEL_PO_TO_ASK", ex.ToString()); + + if (ex.InnerException != null && ex.InnerException.GetType() == typeof(UpdateException)) + { + var inner = (UpdateException)ex.InnerException; + + + throw new ScpException(ResultCode.Exception, "0000", ex.ToString()); + } + else + { + if (ex.InnerException != null) throw ex.InnerException; + } + } + catch (Exception e) + { + _ret.State = ReturnStatus.Failed; + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "EXCEL_PO_TO_ASK", e.Message); + _ret.Result = false; + _ret.ErrorList.Add(e); + if (e.InnerException != null) + { + _ret.MessageList.Add(e.InnerException.Message); + } + else + { + _ret.MessageList.Add(e.Message); + } + } + return _ret; + + } + + + public static ResultObject Save_PO_TO_ASK(V_TB_PO p_order, List p_order_list + , string p_buyer, string p_buyerPhone, string p_creator) + { + ResultObject _ret = new ResultObject(); + try + { + using (ScpEntities db = EntitiesFactory.CreateScpInstance()) + { + TB_ASK _t = new TB_ASK(); + _t.AskBillNum = SCP_BILLCODE_CONTROLLER.MakeASKCode(); + _t.PoBillNum = p_order.PoBillNum; + _t.VendId = p_order.VendId; + _t.IsDeleted = false;//操作员 + _t.CreateTime = DateTime.Now; + _t.CreateUser = p_creator; + _t.Site = p_order.Site; + _t.ReceivedPort = p_order.ReceivedPort; + _t.Remark = p_order.Remark; + _t.State = (int)AskState.New; + _t.SubSite = p_order.SubSite; + _t.Extend1 = p_order.Extend1; + _t.Extend2 = p_order.Extend2; + _t.Extend3 = p_order.Extend3; + + _t.GUID = Guid.NewGuid(); + _t.ModType = (int)p_order.ModType; + _t.ErpBillNum = p_order.ErpBillNum; + _t.BeginTime = (DateTime)p_order.BeginTime; + var _date = p_order.BeginTime; + if (p_order_list.Count > 0) + { + _date = p_order_list[0].EndTime; + } + _t.EndTime = p_order.EndTime; + _t.Buyer = p_buyer; + _t.BuyerPhone = p_buyerPhone; + db.TB_ASK.AddOrUpdate(p => p.AskBillNum, _t); + List _list = new List(); + foreach (var itm in p_order_list) + { + TB_ASK_DETAIL _tDetail = new TB_ASK_DETAIL(); + _tDetail.Remark = _t.Remark; + _tDetail.PoBillNum = _t.PoBillNum; + _tDetail.AskBillNum = _t.AskBillNum; + _tDetail.PoLine = itm.PoLine; + _tDetail.PoUnit = itm.PoUnit; + _tDetail.CreateTime = DateTime.Now; + _tDetail.CreateUser = p_creator; + _tDetail.PartCode = itm.PartCode; + _tDetail.ReceivedPort = itm.ReceivedPort; + _tDetail.BeginTime = itm.BeginTime; + _tDetail.EndTime = _t.EndTime; + _tDetail.TempQty = itm.TempQty == null ? 0 : (decimal)itm.TempQty; + _tDetail.AskQty = (decimal)itm.PublishQty; + _tDetail.IsDeleted = false; + _tDetail.LocUnit = itm.LocUnit; + _tDetail.UnConv = itm.UnConv; + _tDetail.State = (int)p_order.State; + _tDetail.Price = itm.Price; + _tDetail.GUID = Guid.NewGuid(); + _tDetail.Currency = itm.Currency; + _tDetail.Site = itm.Site; + _tDetail.SubSite = itm.SubSite; + _tDetail.Extend1 = itm.Extend1; + _tDetail.Extend2 = itm.Extend2; + _tDetail.Extend3 = itm.Extend3; + db.TB_ASK_DETAIL.Add(_tDetail); + var _order_detail = db.TB_PO_DETAIL.Where(p => p.UID == itm.UID).FirstOrDefault(); + _order_detail.TempQty = itm.TempQty; + db.TB_PO_DETAIL.AddOrUpdate(p => p.UID, _order_detail); + } + int state = db.SaveChanges(); + if (state != -1) + { + _ret.State = ReturnStatus.Succeed; + _ret.Result = true; + } + else + { + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + } + + } + } + catch (System.Data.Entity.Validation.DbEntityValidationException dbEx)//捕获实体验证异常 + { + var sb = new StringBuilder(); + + foreach (var error in dbEx.EntityValidationErrors.ToList()) + { + + error.ValidationErrors.ToList().ForEach(i => + { + sb.AppendFormat("表:{0},字段:{1},信息:{2}\r\n", error.Entry.Entity.GetType().Name, i.PropertyName, i.ErrorMessage); + }); + } + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + _ret.ErrorList.Add(dbEx); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "Save_PO_TO_ASK", sb.ToString()); + throw new ScpException(ResultCode.DbEntityValidationException, sb.ToString(), "字段验证失败" + sb.ToString()); + } + catch (OptimisticConcurrencyException ex)//并发冲突异常 + { + + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + _ret.ErrorList.Add(ex); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "Save_PO_TO_ASK", ex.ToString()); + throw new ScpException(ResultCode.Exception, "9999", ex.ToString()); + } + catch (ScpException ex) + { + + + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + _ret.ErrorList.Add(ex); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "Save_PO_TO_ASK", ex.ToString()); + + if (ex.InnerException != null && ex.InnerException.GetType() == typeof(UpdateException)) + { + var inner = (UpdateException)ex.InnerException; + + + throw new ScpException(ResultCode.Exception, "0000", ex.ToString()); + } + else + { + if (ex.InnerException != null) throw ex.InnerException; + } + } + catch (Exception e) + { + _ret.State = ReturnStatus.Failed; + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "Save_PO_TO_ASK", e.Message); + _ret.Result = false; + _ret.ErrorList.Add(e); + throw e; + } + return _ret; + } + public static ResultObject ToVoid_ts_uni_api(List ls,List part) + { + ResultObject _ret = new ResultObject(); + try + { + using (ScpEntities db = EntitiesFactory.CreateScpInstance()) + { + var pp = ls.First(); + var billnum = db.TB_PO_DETAIL.Count(p => p.PoBillNum == pp && p.State > 0); + if (billnum == ls.Count) + { + var po1 = db.TB_PO.FirstOrDefault(t => t.PoBillNum == pp && t.State == 1); + po1.State = 0; + db.TB_PO.AddOrUpdate(po1); + var ask1 = db.TB_ASK.FirstOrDefault(t => t.PoBillNum == pp && t.State > -1); + ask1.State = -1; + ask1.IsDeleted = true; + db.TB_ASK.AddOrUpdate(ask1); + } + foreach(var po in ls) + { + foreach(var pa in part) + { + var asn = db.TB_ASN_DETAIL.Count(p => p.PartCode == pa && p.PoBillNum == po&&p.State>=0); + if (asn > 0) + { + _ret.MessageList.Add("零件号"+pa+"已经存在发货单,订单明细作废失败"); + } + else + { + var ponum = db.TB_PO_DETAIL.Where(p => p.PartCode == pa && p.PoBillNum == po&&p.State>0).ToList(); + foreach(var poo in ponum) + { + poo.State = 0; + db.TB_PO_DETAIL.AddOrUpdate(poo); + } + + var ask = db.TB_ASK_DETAIL.Where(p => p.PartCode == pa && p.PoBillNum == po).ToList(); + foreach (var askk in ask) + { + askk.State = -1; + askk.IsDeleted = true; + db.TB_ASK_DETAIL.AddOrUpdate(askk); + } + var uni = db.TS_UNI_API.Where(p => p.PartCode == pa && p.BillNum == po&&p.Receiver=="I"); + foreach(var un in uni) + { + un.State = 1; + un.Receiver = "D"; + db.TS_UNI_API.AddOrUpdate(un); + } + var coust = db.TB_MAXPO_CONSUME.Where(t => t.BillNum == po&&t.PartCode==pa).ToList(); + foreach (var co in coust) + { + var maxpo = db.TB_MAXPO_DETAIL.FirstOrDefault(t => t.PoBillNum == co.PoBillNum && t.PartCode == co.PartCode); + maxpo.SurplusQty = maxpo.SurplusQty + co.PoQty; + } + } + } + } + + if (_ret.MessageList.Count == 0) + { + int state = db.SaveChanges(); + if (state != -1) + { + _ret.State = ReturnStatus.Succeed; + _ret.Result = true; + } + else + { + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + } + } + else + { + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + } + + } + } + catch (System.Data.Entity.Validation.DbEntityValidationException dbEx)//捕获实体验证异常 + { + var sb = new StringBuilder(); + + foreach (var error in dbEx.EntityValidationErrors.ToList()) + { + + error.ValidationErrors.ToList().ForEach(i => + { + sb.AppendFormat("表:{0},字段:{1},信息:{2}\r\n", error.Entry.Entity.GetType().Name, i.PropertyName, i.ErrorMessage); + }); + } + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + _ret.ErrorList.Add(dbEx); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "Save_PO_TO_ASK", sb.ToString()); + throw new ScpException(ResultCode.DbEntityValidationException, sb.ToString(), "字段验证失败" + sb.ToString()); + } + catch (OptimisticConcurrencyException ex)//并发冲突异常 + { + + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + _ret.ErrorList.Add(ex); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "Save_PO_TO_ASK", ex.ToString()); + throw new ScpException(ResultCode.Exception, "9999", ex.ToString()); + } + catch (ScpException ex) + { + + + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + _ret.ErrorList.Add(ex); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "Save_PO_TO_ASK", ex.ToString()); + + if (ex.InnerException != null && ex.InnerException.GetType() == typeof(UpdateException)) + { + var inner = (UpdateException)ex.InnerException; + + + throw new ScpException(ResultCode.Exception, "0000", ex.ToString()); + } + else + { + if (ex.InnerException != null) throw ex.InnerException; + } + } + catch (Exception e) + { + _ret.State = ReturnStatus.Failed; + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "Save_PO_TO_ASK", e.Message); + _ret.Result = false; + _ret.ErrorList.Add(e); + throw e; + } + return _ret; } - /// - /// 北京安通林 - /// - /// - /// - /// - /// - /// - /// - public static ResultObject EXCEL_PO_TO_ASK_MOD(List p_order_list, string p_creator, string p_buyer, DateTime p_time, BillModType p_modtype, bool IsAutoPublish = false) + public static ResultObject Save_ts_uni_api(List ls) { ResultObject _ret = new ResultObject(); try { using (ScpEntities db = EntitiesFactory.CreateScpInstance()) { - p_order_list.ForEach(p => + { - if (string.IsNullOrEmpty(p.订单数)) + int number = 1; + List lineError = new List(); + List ErrorList = new List(); + + foreach (var po in ls) { - p.订单数 = "0"; + var _ls = CheckExce2(db, po); + if (_ls.Count > 0) + { + lineError.Add(number.ToString()); + ErrorList.Add(string.Join("
", _ls.ToArray())); + number++; + } + if (lineError.Count > 0) + { + _ret.State = ReturnStatus.Failed; + _ret.MessageList.AddRange(ErrorList); + _ret.Result = false; + } + else + { + var po1 = db.TB_PO.FirstOrDefault(t => t.PoBillNum == po&&t.State==1); + + po1.State = 0; + db.TB_PO.AddOrUpdate(po1); + var po2 = db.TB_PO_DETAIL.Where(t => t.PoBillNum == po&&t.State==1).ToList(); + foreach (var po3 in po2) + { + po3.State = 0; + db.TB_PO_DETAIL.AddOrUpdate(po3); + } + var ask1 = db.TB_ASK.FirstOrDefault(t => t.PoBillNum == po && t.State > -1); + ask1.State = -1; + ask1.IsDeleted = true; + db.TB_ASK.AddOrUpdate(ask1); + var ask2 = db.TB_ASK_DETAIL.Where(t => t.PoBillNum == po&&t.State>-1).ToList(); + foreach (var ask3 in ask2) + { + ask3.State = -1; + db.TB_ASK_DETAIL.AddOrUpdate(ask3); + } + var lx = db.TS_UNI_API.Where(t => t.BillNum == po&&t.Receiver=="I").ToList(); + foreach (var po4 in lx) + { + po4.State = 1; + po4.Receiver = "D"; + db.TS_UNI_API.AddOrUpdate(po4); + } + var coust = db.TB_MAXPO_CONSUME.Where(t => t.BillNum == po).ToList(); + if (coust.Count() > 0) + { + foreach (var co in coust) + { + var maxpo = db.TB_MAXPO_DETAIL.FirstOrDefault(t => t.PoBillNum == co.PoBillNum && t.PartCode == co.PartCode); + maxpo.SurplusQty = maxpo.SurplusQty + co.PoQty; + db.TB_MAXPO_CONSUME.Remove(co); + } + } + + + } } - }); + } - int number = 1; - List lineError = new List(); - List ErrorList = new List(); - var _lst = p_order_list.Where(p => p.订单数 != "0").ToList(); - _lst.ForEach - (p => + if (_ret.MessageList.Count == 0) { - var _ls = CheckExcelMode(db, p); - if (_ls.Count > 0) + int state = db.SaveChanges(); + if (state != -1) { - lineError.Add(number.ToString()); - ErrorList.Add(string.Join("
", _ls.ToArray())); + _ret.State = ReturnStatus.Succeed; + _ret.Result = true; } - number++; - }); - if (lineError.Count > 0) + else + { + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + } + } + else { _ret.State = ReturnStatus.Failed; - _ret.MessageList.AddRange(ErrorList); _ret.Result = false; } - else + + } + } + catch (System.Data.Entity.Validation.DbEntityValidationException dbEx)//捕获实体验证异常 + { + var sb = new StringBuilder(); + + foreach (var error in dbEx.EntityValidationErrors.ToList()) + { + + error.ValidationErrors.ToList().ForEach(i => { - var VenderList = _lst.Select(p => p.供应商编码).Distinct(); - var PartCodeList = _lst.Select(p => p.零件编码).Distinct(); - var OrderList = _lst.GroupBy(p => p.订单编号).ToList(); - OrderList.ForEach((p) => + sb.AppendFormat("表:{0},字段:{1},信息:{2}\r\n", error.Entry.Entity.GetType().Name, i.PropertyName, i.ErrorMessage); + }); + } + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + _ret.ErrorList.Add(dbEx); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "Save_PO_TO_ASK", sb.ToString()); + throw new ScpException(ResultCode.DbEntityValidationException, sb.ToString(), "字段验证失败" + sb.ToString()); + } + catch (OptimisticConcurrencyException ex)//并发冲突异常 + { + + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + _ret.ErrorList.Add(ex); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "Save_PO_TO_ASK", ex.ToString()); + throw new ScpException(ResultCode.Exception, "9999", ex.ToString()); + } + catch (ScpException ex) + { + + + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + _ret.ErrorList.Add(ex); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "Save_PO_TO_ASK", ex.ToString()); + + if (ex.InnerException != null && ex.InnerException.GetType() == typeof(UpdateException)) + { + var inner = (UpdateException)ex.InnerException; + + + throw new ScpException(ResultCode.Exception, "0000", ex.ToString()); + } + else + { + if (ex.InnerException != null) throw ex.InnerException; + } + } + catch (Exception e) + { + _ret.State = ReturnStatus.Failed; + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "Save_PO_TO_ASK", e.Message); + _ret.Result = false; + _ret.ErrorList.Add(e); + throw e; + } + return _ret; + } + public static ResultObject Maxpo_ts_uni_api(List maxpo) + { + ResultObject _ret = new ResultObject(); + try + { + using (ScpEntities db = EntitiesFactory.CreateScpInstance()) + { + + { + foreach(var po in maxpo) { - var list = p.ToList(); - if (list.Count > 0) + var _list = db.TB_MAXPO_DETAIL.Where(p=>p.PoBillNum==po).ToList(); + foreach(var _li in _list) { - var _entity = list.FirstOrDefault(); - TB_ASK _ask = new TB_ASK(); - _ask.AskBillNum = SCP_BILLCODE_CONTROLLER.MakeASKCode(); - _ask.VendId = _entity.供应商编码; - _ask.State = (int)AskState.New; - _ask.PoBillNum = _entity.订单编号; - _ask.ModType = (int)BillModType.Contract; - _ask.Site = _entity.域名; - _ask.Remark = _entity.站点; - if (IsAutoPublish) + if (_li.OrderQtykg != _li.SurplusQty) { - _ask.State = (int)AskState.Release; + _ret.MessageList.Add("大订单号" + _li.PoBillNum + "已经开始期货订单消耗,作废失败"); } else { - _ask.State = (int)AskState.New; - } - _ask.BeginTime = DateTime.Parse(_entity.订货日期); - _ask.Buyer = p_buyer; - _ask.BuyerPhone = _entity.计划员电话; - _ask.ErpBillNum = _entity.项目编号; - _ask.EndTime = DateTime.Parse(_entity.到货日期); - _ask.CreateTime = DateTime.Now; - _ask.CreateUser = p_creator; - _ask.VendId = _entity.供应商编码; - _ask.GUID = Guid.NewGuid(); - _ask.ReceivedPort = _entity.收货口; - _ask.IsDeleted = false; - db.TB_ASK.Add(_ask); - #region 供应商新任务代办接口 - TB_PENING_ITEMS _item = new TB_PENING_ITEMS(); - _item.ROLE_NAME = "供应商"; - _item.ITEM_NO = _ask.AskBillNum; - _item.ITEM_CONTENT = "要货看盘有信息"; - _item.ITEM_TYPE = (int)PENDING_MESSAGE_TYPE.NEW_ASK; - _item.VEND_ID = _ask.VendId; - _item.ITEM_STATE = (int)PENDING_STATE.WAITING; - _item.SENDER = p_buyer; - _item.SENDING_TIME = DateTime.Now; - db.TB_PENING_ITEMS.Add(_item); - #endregion - // int _number = 1; - List _ls = new List(); - list.ForEach((itm) => - { - var _number = _ls.Count(p1 => p1.PoBillNum == _ask.PoBillNum - && p1.PoLine == Int32.Parse(itm.行号) && p1.PartCode == itm.零件编码 && itm.域名 == p1.Remark); - if (_number > 0) + UniApiEntities idb = EntitiesFactory.CreateUniApiInstance(); + var _wmsret = idb.xxwms_rc_det.Where(p=>p.xxwms_rc_ware_class.Contains(_li.PoBillNum)).ToList(); + if (_wmsret.Count() > 0) { - _ret.MessageList.Add(string.Format("已经存在订单为{0}行号为{1}零件编码为{2}", itm.订单编号, itm.行号, itm.零件编码)); + _ret.MessageList.Add("大订单号" + _li.PoBillNum + "已经开始收货消耗,作废失败"); } - - TB_ASK_DETAIL _t_ASK_Detail = new TB_ASK_DETAIL(); - - _t_ASK_Detail.PoLine = Int32.Parse(itm.行号); - _t_ASK_Detail.Currency = itm.币种; - _t_ASK_Detail.AskBillNum = _ask.AskBillNum; - _t_ASK_Detail.PoBillNum = _ask.PoBillNum; - _t_ASK_Detail.PoUnit = itm.单位; - _t_ASK_Detail.CreateTime = DateTime.Now; - _t_ASK_Detail.CreateUser = _ask.CreateUser; - _t_ASK_Detail.PartCode = itm.零件编码; - _t_ASK_Detail.BeginTime = DateTime.Parse(itm.订货日期); - _t_ASK_Detail.EndTime = DateTime.Parse(itm.到货日期); - _t_ASK_Detail.TempQty = decimal.Parse(itm.订单数); - _t_ASK_Detail.AskQty = decimal.Parse(itm.订单数); - _t_ASK_Detail.IsDeleted = false; - _t_ASK_Detail.LocUnit = itm.单位; - _t_ASK_Detail.UnConv = 1; - _t_ASK_Detail.DockCode = itm.收货口; - _t_ASK_Detail.State = _ask.State; - _t_ASK_Detail.Price = string.IsNullOrEmpty(itm.价格) ? 0 : decimal.Parse(itm.价格); - _t_ASK_Detail.GUID = Guid.NewGuid(); - _t_ASK_Detail.Remark = _ask.Site; - _t_ASK_Detail.UpdateInfo = itm.备注; - db.TB_ASK_DETAIL.Add(_t_ASK_Detail); - _ls.Add(_t_ASK_Detail); - // _number++; - }); - } - else - { - _ret.MessageList.Add("ERP订单编号已存在,请重新导入!"); - + } } - if (_ret.MessageList.Count == 0) + } + if(_ret.MessageList.Count == 0) + { + foreach (var po in maxpo) { - int state = db.SaveChanges(); - if (state != -1) - { - _ret.State = ReturnStatus.Succeed; - _ret.Result = true; - } - else + var _maxpo = db.TB_MAXPO.FirstOrDefault(p=>p.PoBillNum== po); + _maxpo.IsDeleted = true; + db.TB_MAXPO.AddOrUpdate(_maxpo); + var _maxpodetail=db.TB_MAXPO_DETAIL.Where(p => p.PoBillNum == po).ToList(); + _maxpodetail.ForEach(itm => itm.IsDeleted = true); + db.TB_MAXPO_DETAIL.AddOrUpdate(itm => itm.UID, _maxpodetail.ToArray()); + var _Ts = db.TS_UNI_API.Where(p => p.BillNum == po).ToList(); + foreach(var ts in _Ts) { - _ret.State = ReturnStatus.Failed; - _ret.Result = false; + ts.Extend3 = "D"; + ts.State = 1; + db.TS_UNI_API.AddOrUpdate(ts); } } - else - { - _ret.State = ReturnStatus.Failed; - _ret.Result = false; - } } - ); } + + if (_ret.MessageList.Count == 0) + { + int state = db.SaveChanges(); + if (state != -1) + { + _ret.State = ReturnStatus.Succeed; + _ret.Result = true; + } + else + { + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + } + } + else + { + _ret.MessageList= _ret.MessageList.Distinct().ToList(); + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + } + } } catch (System.Data.Entity.Validation.DbEntityValidationException dbEx)//捕获实体验证异常 @@ -1879,7 +8122,7 @@ namespace CK.SCP.Controller _ret.State = ReturnStatus.Failed; _ret.Result = false; _ret.ErrorList.Add(dbEx); - LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "EXCEL_PO_TO_ASK", sb.ToString()); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "Save_PO_TO_ASK", sb.ToString()); throw new ScpException(ResultCode.DbEntityValidationException, sb.ToString(), "字段验证失败" + sb.ToString()); } catch (OptimisticConcurrencyException ex)//并发冲突异常 @@ -1888,7 +8131,7 @@ namespace CK.SCP.Controller _ret.State = ReturnStatus.Failed; _ret.Result = false; _ret.ErrorList.Add(ex); - LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "EXCEL_PO_TO_ASK", ex.ToString()); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "Save_PO_TO_ASK", ex.ToString()); throw new ScpException(ResultCode.Exception, "9999", ex.ToString()); } catch (ScpException ex) @@ -1898,7 +8141,7 @@ namespace CK.SCP.Controller _ret.State = ReturnStatus.Failed; _ret.Result = false; _ret.ErrorList.Add(ex); - LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "EXCEL_PO_TO_ASK", ex.ToString()); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "Save_PO_TO_ASK", ex.ToString()); if (ex.InnerException != null && ex.InnerException.GetType() == typeof(UpdateException)) { @@ -1915,96 +8158,49 @@ namespace CK.SCP.Controller catch (Exception e) { _ret.State = ReturnStatus.Failed; - LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "EXCEL_PO_TO_ASK", e.Message); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "Save_PO_TO_ASK", e.Message); _ret.Result = false; _ret.ErrorList.Add(e); throw e; } return _ret; - } - /// - /// 供应商零件导入 - /// - /// - /// - /// - /// - public static ResultObject EXCEL_VENDER_PART_MOD(List p_order_list, string site, string p_creator) + public static ResultObject Maxpodetail_ts_uni_api(List Uid) { ResultObject _ret = new ResultObject(); try { using (ScpEntities db = EntitiesFactory.CreateScpInstance()) { - int number = 1; - List lineError = new List(); - List ErrorList = new List(); - var _lst = p_order_list; - _lst.ForEach(p => + { - var _count = _lst.Count(itm => itm.供应商代码 == p.供应商代码 && itm.零件号 == p.零件号); - if (_count > 1) + foreach (var ui in Uid) { - lineError.Add(string.Format("导入的供应商{0}零件编号{1}有重复", p.供应商代码, p.零件号)); - ErrorList = lineError; + var maxpodetail = db.V_TB_MAXPO_DETAIL.FirstOrDefault(p=>p.UID.ToString()==ui); + if (maxpodetail.SurplusQty != maxpodetail.OrderQtykg || maxpodetail.AnQty > 0 || maxpodetail.ReceQty > 0) + { + _ret.MessageList.Add("零件号"+maxpodetail.PartCode+"已经开始消耗,作废失败!"); + } } - }); - _lst.ForEach(p => - { - var _ls = CheckExcelMode_VenderPart(db, p, site); - if (_ls.Count > 0) + if (_ret.MessageList.Count == 0) { - lineError.Add(number.ToString()); - ErrorList.Add(string.Join("
", _ls.ToArray())); + foreach (var ui in Uid) + { + var maxpodetail = db.V_TB_MAXPO_DETAIL.FirstOrDefault(p => p.UID.ToString() == ui); + var uni = db.TS_UNI_API.FirstOrDefault(p=>p.PartCode==maxpodetail.PartCode&&p.BillNum==maxpodetail.PoBillNum); + uni.State = 1; + db.TS_UNI_API.AddOrUpdate(uni); + } } - number++; - }); - if (lineError.Count > 0) - { - _ret.State = ReturnStatus.Failed; - _ret.MessageList.AddRange(ErrorList); - _ret.Result = false; } - else + + if (_ret.MessageList.Count == 0) { - _lst.ForEach(p => - { - var _venderpart = db.TA_VEND_PART.SingleOrDefault(t => t.VendId == p.供应商代码.ToUpper() && t.PartCode == p.零件号.ToUpper()) ?? - new TA_VEND_PART - { - VendId = p.供应商代码.ToUpper(), - PartCode = p.零件号.ToUpper(), - State = 1, - CreateTime = DateTime.Now, - CreateUser = p_creator, - IsDeleted = false, - GUID = System.Guid.NewGuid(), - }; - _venderpart.VendPartCode = p.供应商零件号.ToUpper(); - _venderpart.VendPackQty = decimal.Parse(p.标包数); - _venderpart.MinPackQty = decimal.Parse(p.小包装数); - _venderpart.PalletPackQty = decimal.Parse(p.托盘包装数); - _venderpart.PoUnit = p.单位; - _venderpart.Remark = ""; - _venderpart.UpdateTime = DateTime.Now; - _venderpart.UpdateUser = p_creator; - _venderpart.Site = site; - db.TA_VEND_PART.AddOrUpdate(_venderpart); - }); - if (_ret.MessageList.Count == 0) + int state = db.SaveChanges(); + if (state != -1) { - int state = db.SaveChanges(); - if (state != -1) - { - _ret.State = ReturnStatus.Succeed; - _ret.Result = true; - } - else - { - _ret.State = ReturnStatus.Failed; - _ret.Result = false; - } + _ret.State = ReturnStatus.Succeed; + _ret.Result = true; } else { @@ -2012,8 +8208,14 @@ namespace CK.SCP.Controller _ret.Result = false; } } - } + else + { + _ret.MessageList = _ret.MessageList.Distinct().ToList(); + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + } + } } catch (System.Data.Entity.Validation.DbEntityValidationException dbEx)//捕获实体验证异常 { @@ -2030,7 +8232,7 @@ namespace CK.SCP.Controller _ret.State = ReturnStatus.Failed; _ret.Result = false; _ret.ErrorList.Add(dbEx); - LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "EXCEL_VENDER_PART_MOD", sb.ToString()); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "Save_PO_TO_ASK", sb.ToString()); throw new ScpException(ResultCode.DbEntityValidationException, sb.ToString(), "字段验证失败" + sb.ToString()); } catch (OptimisticConcurrencyException ex)//并发冲突异常 @@ -2039,7 +8241,7 @@ namespace CK.SCP.Controller _ret.State = ReturnStatus.Failed; _ret.Result = false; _ret.ErrorList.Add(ex); - LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "EXCEL_VENDER_PART_MOD", ex.ToString()); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "Save_PO_TO_ASK", ex.ToString()); throw new ScpException(ResultCode.Exception, "9999", ex.ToString()); } catch (ScpException ex) @@ -2049,7 +8251,7 @@ namespace CK.SCP.Controller _ret.State = ReturnStatus.Failed; _ret.Result = false; _ret.ErrorList.Add(ex); - LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "EXCEL_VENDER_PART_MOD", ex.ToString()); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "Save_PO_TO_ASK", ex.ToString()); if (ex.InnerException != null && ex.InnerException.GetType() == typeof(UpdateException)) { @@ -2066,91 +8268,37 @@ namespace CK.SCP.Controller catch (Exception e) { _ret.State = ReturnStatus.Failed; - LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "EXCEL_VENDER_PART_MOD", e.Message); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "Save_PO_TO_ASK", e.Message); _ret.Result = false; _ret.ErrorList.Add(e); throw e; } return _ret; } - /// - /// 供应商导入 - /// - /// - /// - /// - /// - public static ResultObject EXCEL_VENDER_MOD(List p_order_list, string site, string p_creator) + public static ResultObject Delete_Ta_Subpart() { ResultObject _ret = new ResultObject(); try { using (ScpEntities db = EntitiesFactory.CreateScpInstance()) { - int number = 1; - List lineError = new List(); - List ErrorList = new List(); - var _lst = p_order_list; - _lst.ForEach(p => - { - var _count = _lst.Count(itm => itm.供应商编号 == p.供应商编号); - if (_count > 1) - { - lineError.Add(string.Format("导入零件编号{0}有重复", p.供应商编号)); - ErrorList = lineError; - } - }); - _lst.ForEach(p => + { - var _ls = CheckExcelMode_Vender(db, p, site); - if (_ls.Count > 0) + var sublist = db.TA_SubPartCode.ToList(); + foreach(var sub in sublist) { - lineError.Add(number.ToString()); - ErrorList.Add(string.Join("
", _ls.ToArray())); + db.TA_SubPartCode.Remove(sub); } - number++; - }); - if (lineError.Count > 0) - { - _ret.State = ReturnStatus.Failed; - _ret.MessageList.AddRange(ErrorList); - _ret.Result = false; + } - else + + if (_ret.MessageList.Count == 0) { - _lst.ForEach(p => - { - var _vender = db.TA_VENDER.SingleOrDefault(t => t.VendId == p.供应商编号.ToUpper()) ?? - new TA_VENDER { VendId = p.供应商编号.ToUpper(), State = 1 }; - _vender.VendName = p.供应商名称; - _vender.VendAbbCode = string.IsNullOrEmpty(p.供应商缩写) ? "0" : p.供应商缩写; - _vender.VendType = p.供应商类型; - _vender.Country = p.国家; - _vender.City = p.城市; - _vender.Currency = p.币种; - _vender.Address = p.地址; - _vender.ZipCode = p.邮编; - _vender.Contacter = p.联系人; - _vender.Phone = p.电话; - _vender.Fax = p.传真; - _vender.Remark = p.备注; - _vender.Tax = Convert.ToDecimal(p.税率); - _vender.Site = site; - db.TA_VENDER.AddOrUpdate(_vender); - }); - if (_ret.MessageList.Count == 0) + int state = db.SaveChanges(); + if (state != -1) { - int state = db.SaveChanges(); - if (state != -1) - { - _ret.State = ReturnStatus.Succeed; - _ret.Result = true; - } - else - { - _ret.State = ReturnStatus.Failed; - _ret.Result = false; - } + _ret.State = ReturnStatus.Succeed; + _ret.Result = true; } else { @@ -2158,8 +8306,13 @@ namespace CK.SCP.Controller _ret.Result = false; } } - } + else + { + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + } + } } catch (System.Data.Entity.Validation.DbEntityValidationException dbEx)//捕获实体验证异常 { @@ -2176,7 +8329,7 @@ namespace CK.SCP.Controller _ret.State = ReturnStatus.Failed; _ret.Result = false; _ret.ErrorList.Add(dbEx); - LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "EXCEL_VENDER_MOD", sb.ToString()); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "Save_PO_TO_ASK", sb.ToString()); throw new ScpException(ResultCode.DbEntityValidationException, sb.ToString(), "字段验证失败" + sb.ToString()); } catch (OptimisticConcurrencyException ex)//并发冲突异常 @@ -2185,7 +8338,7 @@ namespace CK.SCP.Controller _ret.State = ReturnStatus.Failed; _ret.Result = false; _ret.ErrorList.Add(ex); - LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "EXCEL_VENDER_MOD", ex.ToString()); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "Save_PO_TO_ASK", ex.ToString()); throw new ScpException(ResultCode.Exception, "9999", ex.ToString()); } catch (ScpException ex) @@ -2195,7 +8348,7 @@ namespace CK.SCP.Controller _ret.State = ReturnStatus.Failed; _ret.Result = false; _ret.ErrorList.Add(ex); - LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "EXCEL_VENDER_MOD", ex.ToString()); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "Save_PO_TO_ASK", ex.ToString()); if (ex.InnerException != null && ex.InnerException.GetType() == typeof(UpdateException)) { @@ -2212,82 +8365,78 @@ namespace CK.SCP.Controller catch (Exception e) { _ret.State = ReturnStatus.Failed; - LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "EXCEL_VENDER_MOD", e.Message); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "Save_PO_TO_ASK", e.Message); _ret.Result = false; _ret.ErrorList.Add(e); throw e; } return _ret; } - /// - /// 价格导入 - /// - /// - /// - /// - /// - public static ResultObject EXCEL_PRICE_MOD(List p_order_list, string site, string p_creator) + public static ResultObject Save_ts_uni_api1(List ls) { ResultObject _ret = new ResultObject(); try { using (ScpEntities db = EntitiesFactory.CreateScpInstance()) { - int number = 1; - List lineError = new List(); - List ErrorList = new List(); - var _lst = p_order_list; - _lst.ForEach - (p => - { - var _ls = CheckExcelMode_Price(db, p, site); - if (_ls.Count > 0) - { - lineError.Add(number.ToString()); - ErrorList.Add(string.Join("
", _ls.ToArray())); - } - number++; - }); - if (lineError.Count > 0) - { - _ret.State = ReturnStatus.Failed; - _ret.MessageList.AddRange(ErrorList); - _ret.Result = false; - } - else - { - - - + { + int number = 1; + List lineError = new List(); + List ErrorList = new List(); - _lst.ForEach(p => - { - var _price = new TB_PRICE(); - _price.VendId= p.供应商编号.Trim(); - _price.PartCode = p.零件编码.Trim(); - _price.StartTime = DateTime.Parse( p.开始时间); - _price.EndTime = DateTime.Parse(p.结束时间); - _price.Curr = p.币种; - _price.Unit = p.单位; - _price.Amt = decimal.Parse( p.价格); - _price.Site = site.Trim(); - _price.Remarks = p.备注; - db.TB_PRICE.Add(_price); - }); - if (_ret.MessageList.Count == 0) + foreach (var po in ls) { - int state = db.SaveChanges(); - if (state != -1) + var _ls = CheckExce3(db, po); + if (_ls.Count > 0) { - _ret.State = ReturnStatus.Succeed; - _ret.Result = true; + lineError.Add(number.ToString()); + ErrorList.Add(string.Join("
", _ls.ToArray())); + number++; } - else + if (lineError.Count > 0) { _ret.State = ReturnStatus.Failed; + _ret.MessageList.AddRange(ErrorList); _ret.Result = false; } + else + { + var _entity = db.TB_ASK.FirstOrDefault(p => p.AskBillNum.ToString() == po); + _entity.State = -1; + _entity.IsDeleted = true; + db.TB_ASK.AddOrUpdate(_entity); + if (_entity.Site == "U32") + { + var _po = db.TB_PO.FirstOrDefault(P => P.PoBillNum == _entity.PoBillNum); + _po.State = 0; + db.TB_PO.AddOrUpdate(_po); + var _podetail = db.TB_PO_DETAIL.Where(p=>p.PoBillNum==_entity.PoBillNum).ToList(); + _podetail.ForEach(p => + { + p.State = 0; + db.TB_PO_DETAIL.AddOrUpdate(p); + }); + } + + var _entity1 = db.TB_ASK_DETAIL.Where(p => p.AskBillNum.ToString() == po).ToList(); + foreach(var ask in _entity1) + { + ask.State = -1; + ask.IsDeleted = true; + db.TB_ASK_DETAIL.AddOrUpdate(ask); + } + } + } + } + + if (_ret.MessageList.Count == 0) + { + int state = db.SaveChanges(); + if (state != -1) + { + _ret.State = ReturnStatus.Succeed; + _ret.Result = true; } else { @@ -2295,6 +8444,12 @@ namespace CK.SCP.Controller _ret.Result = false; } } + else + { + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + } + } } catch (System.Data.Entity.Validation.DbEntityValidationException dbEx)//捕获实体验证异常 @@ -2312,7 +8467,7 @@ namespace CK.SCP.Controller _ret.State = ReturnStatus.Failed; _ret.Result = false; _ret.ErrorList.Add(dbEx); - LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "EXCEL_PRICE_MOD", sb.ToString()); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "Save_PO_TO_ASK", sb.ToString()); throw new ScpException(ResultCode.DbEntityValidationException, sb.ToString(), "字段验证失败" + sb.ToString()); } catch (OptimisticConcurrencyException ex)//并发冲突异常 @@ -2321,7 +8476,7 @@ namespace CK.SCP.Controller _ret.State = ReturnStatus.Failed; _ret.Result = false; _ret.ErrorList.Add(ex); - LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "EXCEL_PRICE_MOD", ex.ToString()); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "Save_PO_TO_ASK", ex.ToString()); throw new ScpException(ResultCode.Exception, "9999", ex.ToString()); } catch (ScpException ex) @@ -2331,7 +8486,7 @@ namespace CK.SCP.Controller _ret.State = ReturnStatus.Failed; _ret.Result = false; _ret.ErrorList.Add(ex); - LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "EXCEL_PRICE_MOD", ex.ToString()); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "Save_PO_TO_ASK", ex.ToString()); if (ex.InnerException != null && ex.InnerException.GetType() == typeof(UpdateException)) { @@ -2348,94 +8503,109 @@ namespace CK.SCP.Controller catch (Exception e) { _ret.State = ReturnStatus.Failed; - LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "EXCEL_PRICE_MOD", e.Message); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "Save_PO_TO_ASK", e.Message); _ret.Result = false; _ret.ErrorList.Add(e); throw e; } return _ret; } - /// - /// 零件导入 - /// - /// - /// - /// - /// - public static ResultObject EXCEL_PART_MOD(List p_order_list, string site, string p_creator) + public static void Get_V_TB_PO_DETAIL_OUTPUT_List(V_TB_PO_DETAIL p_entity, Action>> p_action) { - ResultObject _ret = new ResultObject(); + ResultObject> _ret = new ResultObject>(); try { using (ScpEntities db = EntitiesFactory.CreateScpInstance()) { - int number = 1; - List lineError = new List(); - List ErrorList = new List(); - var _lst = p_order_list; - _lst.ForEach(p => + IQueryable q = db.V_TB_PO_DETAIL; + + if (!string.IsNullOrEmpty(p_entity.PoBillNum)) { - var _count = _lst.Count(itm => itm.零件编号 == p.零件编号); - if (_count > 1) - { - lineError.Add(string.Format("导入零件编号{0}有重复", p.零件编号)); - ErrorList = lineError; - } - }); - _lst.ForEach - (p => + q = q.Where(p => p.PoBillNum == p_entity.PoBillNum); + } + if (!string.IsNullOrEmpty(p_entity.ErpBillNum)) { - var _ls = CheckExcelMode_Part(db, p, site); - if (_ls.Count > 0) - { - lineError.Add(number.ToString()); - ErrorList.Add(string.Join("
", _ls.ToArray())); - } - number++; - }); - if (lineError.Count > 0) + q = q.Where(p => p.ErpBillNum.Contains(p_entity.ErpBillNum)); + } + if (p_entity.BeginTime != null) { - _ret.State = ReturnStatus.Failed; - _ret.MessageList.AddRange(ErrorList); - _ret.Result = false; + q = q.Where(p => p.BeginTime >= p_entity.BeginTime); } - else + if (p_entity.EndTime != null) { - _lst.ForEach(p => + q = q.Where(p => p.BeginTime <= p_entity.EndTime); + } + + if (!string.IsNullOrEmpty(p_entity.VendId)) { - var _part = db.TA_PART.SingleOrDefault(t => t.PartCode == p.零件编号.ToUpper()) ?? - new TA_PART { PartCode = p.零件编号.ToUpper() }; - _part.PartCode = p.零件编号; - _part.ErpPartCode = p.零件编号; - _part.PartDesc1 = p.零件名称; - _part.PartDesc2 = ""; - _part.ProjectId = p.项目编号; - _part.Unit = p.单位; - _part.PartGroup = p.项目编号; - _part.State = p.状态; - _part.Site = site; - db.TA_PART.AddOrUpdate(_part); - }); - if (_ret.MessageList.Count == 0) - { - int state = db.SaveChanges(); - if (state != -1) - { - _ret.State = ReturnStatus.Succeed; - _ret.Result = true; - } - else - { - _ret.State = ReturnStatus.Failed; - _ret.Result = false; - } - } - else - { - _ret.State = ReturnStatus.Failed; - _ret.Result = false; - } + q = q.Where(p => p.VendId.Contains(p_entity.VendId)); + } + if (!string.IsNullOrEmpty(p_entity.VendName)) + { + q = q.Where(p => p.VendName.Contains(p_entity.VendName)); + } + + + if (p_entity.ModType != null) + { + q = q.Where(p => p.ModType == p_entity.ModType); + } + if (!string.IsNullOrEmpty(p_entity.ProjectId)) + { + q = q.Where(p => p.ProjectId.Contains(p_entity.ProjectId)); + } + if (!string.IsNullOrEmpty(p_entity.PartCode)) + { + q = q.Where(p => p.PartCode.Contains(p_entity.PartCode)); + } + if (p_entity.State != null) + { + q = q.Where(p => p.State == p_entity.State); + } + //q = q.Where(p => p.IsDeleted == p_entity.IsDeleted); + + //IQueryable _aq = db.TB_ASK_DETAIL; + //_aq = _aq.Where(p => p.PoBillNum == p_entity.PoBillNum); + //var _a=_aq.GroupBy(p => new { p.PoBillNum, p.PoLine, p.PartCode }).Select(p => new { AskSum = p.Max(itm=>itm .AskQty),PoLine=p.Key }); + if (p_entity.UserInAddress != null && p_entity.UserInAddress.Count > 0) + { + q = q.Where(p => p_entity.UserInAddress.Contains(p.Site)); + } + if (!string.IsNullOrEmpty(p_entity.SubSite)) + { + q = q.Where(p => p.SubSite == p_entity.SubSite); + } + if (!string.IsNullOrEmpty(p_entity.Extend1)) + { + q = q.Where(p => p.Extend1 == p_entity.Extend1); + } + if (!string.IsNullOrEmpty(p_entity.Extend2)) + { + q = q.Where(p => p.Extend1 == p_entity.Extend2); + } + if (!string.IsNullOrEmpty(p_entity.Extend3)) + { + q = q.Where(p => p.Extend1 == p_entity.Extend3); + } + if (!string.IsNullOrEmpty(p_entity.SubSite)) + { + q = q.Where(p => p.SubSite.Contains(p_entity.SubSite)); + } + if (!string.IsNullOrEmpty(p_entity.Extend1)) + { + q = q.Where(p => p.Extend1.Contains(p_entity.Extend1)); + } + if (!string.IsNullOrEmpty(p_entity.Extend2)) + { + q = q.Where(p => p.Extend2.Contains(p_entity.Extend2)); + } + if (!string.IsNullOrEmpty(p_entity.Extend3)) + { + q = q.Where(p => p.Extend3.Contains(p_entity.Extend3)); } + _ret.State = ReturnStatus.Succeed; + _ret.Result = q; + p_action(_ret); } } catch (System.Data.Entity.Validation.DbEntityValidationException dbEx)//捕获实体验证异常 @@ -2451,18 +8621,16 @@ namespace CK.SCP.Controller }); } _ret.State = ReturnStatus.Failed; - _ret.Result = false; _ret.ErrorList.Add(dbEx); - LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "EXCEL_PART_MOD", sb.ToString()); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "Get_V_TB_PO_DETAIL_List", sb.ToString()); throw new ScpException(ResultCode.DbEntityValidationException, sb.ToString(), "字段验证失败" + sb.ToString()); } catch (OptimisticConcurrencyException ex)//并发冲突异常 { _ret.State = ReturnStatus.Failed; - _ret.Result = false; _ret.ErrorList.Add(ex); - LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "EXCEL_PART_MOD", ex.ToString()); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "Get_V_TB_PO_DETAIL_List", ex.ToString()); throw new ScpException(ResultCode.Exception, "9999", ex.ToString()); } catch (ScpException ex) @@ -2470,9 +8638,8 @@ namespace CK.SCP.Controller _ret.State = ReturnStatus.Failed; - _ret.Result = false; _ret.ErrorList.Add(ex); - LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "EXCEL_PART_MOD", ex.ToString()); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "Get_V_TB_PO_DETAIL_List", ex.ToString()); if (ex.InnerException != null && ex.InnerException.GetType() == typeof(UpdateException)) { @@ -2489,149 +8656,72 @@ namespace CK.SCP.Controller catch (Exception e) { _ret.State = ReturnStatus.Failed; - LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "EXCEL_PART_MOD", e.Message); - _ret.Result = false; _ret.ErrorList.Add(e); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "Get_V_TB_PO_DETAIL_List", e.Message); throw e; } - return _ret; + } - /// - /// 订单导入 - /// - /// - /// - /// - /// - /// - /// - public static ResultObject EXCEL_PO_MOD(List p_order_list, string site, string p_creator, DateTime p_time, PoState p_modtype) + + + + public static void Get_V_TB_PO_DETAIL_List(V_TB_PO_DETAIL p_entity, Action>> p_action) { - ResultObject _ret = new ResultObject(); + ResultObject> _ret = new ResultObject>(); try { using (ScpEntities db = EntitiesFactory.CreateScpInstance()) { - int number = 1; - List lineError = new List(); - List ErrorList = new List(); - var _lst = p_order_list; - _lst.ForEach(p => + IQueryable q = db.V_TB_PO_DETAIL; + + if (!string.IsNullOrEmpty(p_entity.PoBillNum)) { - var _count = _lst.Count(itm => itm.订单编号 == p.订单编号 && itm.行号 == p.行号); - if (_count > 1) - { - lineError.Add(string.Format("导入订单编号{0}行号{1}有重复", p.订单编号, p.行号)); - ErrorList = lineError; - } - }); - _lst.ForEach(p => + q = q.Where(p => p.PoBillNum == p_entity.PoBillNum); + } + if (!string.IsNullOrEmpty(p_entity.ErpBillNum)) { - var _count = _lst.Count(itm => itm.订单编号 == p.订单编号 && itm.零件号 == p.零件号 && itm.行号 == p.行号); - if (_count > 1) - { - lineError.Add(string.Format("导入订单编号{0}行号{1}零件编码{2}有重复", p.订单编号,p.行号, p.零件号)); - ErrorList = lineError; - } - }); - - _lst.ForEach - (p => + q = q.Where(p => p.ErpBillNum.Contains(p_entity.ErpBillNum)); + } + if (p_entity.BeginTime != null) { - var _ls = CheckExcelMode_Po(db, p); - if (_ls.Count > 0) - { - lineError.Add(number.ToString()); - ErrorList.Add(string.Join("
", _ls.ToArray())); - } - number++; - }); - if (lineError.Count > 0) + q = q.Where(p => p.BeginTime >= p_entity.BeginTime); + } + if (p_entity.EndTime != null) + { + q = q.Where(p => p.BeginTime <= p_entity.EndTime); + } + if (!string.IsNullOrEmpty(p_entity.VendName)) + { + q = q.Where(p => p.VendName == p_entity.VendName); + } + if (p_entity.ModType != null) + { + q = q.Where(p => p.ModType == p_entity.ModType); + } + if (!string.IsNullOrEmpty(p_entity.ProjectId)) + { + q = q.Where(p => p.ProjectId == p_entity.ProjectId); + } + if (!string.IsNullOrEmpty(p_entity.PartCode)) { - _ret.State = ReturnStatus.Failed; - _ret.MessageList.AddRange(ErrorList); - _ret.Result = false; + q = q.Where(p => p.PartCode == p_entity.PartCode); } - else + if (p_entity.State != null) { - var OrderList = _lst.GroupBy(p => p.订单编号).ToList(); - OrderList.ForEach((p) => - { - var list = p.ToList(); - if (list.Count > 0) - { - var _entity = list.FirstOrDefault(); - TB_PO _po = new TB_PO(); - _po.PoBillNum = _entity.订单编号.ToUpper(); - _po.ErpBillNum = _entity.订单编号.ToUpper(); - _po.VendId = _entity.供应商编号.ToUpper(); - _po.ModType = (int)BillModType.Contract; - _po.Contacter = _entity.联系人; - _po.Site = site; - _po.Remark = _entity.备注; - _po.State = (int)PoState.Open; - _po.GUID = Guid.NewGuid(); - _po.IsDeleted = false; - _po.CreateTime = DateTime.Parse(_entity.订单创建时间); - _po.CreateUser = p_creator; - _po.BeginTime = p_time; - _po.EndTime = DateTime.Parse(_entity.要求到货日期); - _po.Site = site; - db.TB_PO.Add(_po); - // int _number = 1; - list.ForEach((itm) => - { - TB_PO_DETAIL _PO_Detail = new TB_PO_DETAIL(); - _PO_Detail.PoLine = Int32.Parse(itm.行号); - _PO_Detail.Currency = "CNY"; - _PO_Detail.PoBillNum = itm.订单编号; - _PO_Detail.PoUnit = itm.单位; - _PO_Detail.CreateTime = DateTime.Parse(itm.订单创建时间); - _PO_Detail.CreateUser = p_creator; - _PO_Detail.PartCode = itm.零件号.ToUpper(); - _PO_Detail.BeginTime = p_time; - _PO_Detail.EndTime = DateTime.Parse(itm.要求到货日期); - _PO_Detail.PlanQty = decimal.Parse(itm.数量); - _PO_Detail.IsDeleted = false; - _PO_Detail.LocUnit = itm.单位; - _PO_Detail.PoUnit = itm.单位; - _PO_Detail.UnConv = 1; - _PO_Detail.State = (int)PoState.Open; - _PO_Detail.Price = string.IsNullOrEmpty(itm.单价) ? 0 : decimal.Parse(itm.单价); - _PO_Detail.GUID = Guid.NewGuid(); - _PO_Detail.Site = site; - db.TB_PO_DETAIL.Add(_PO_Detail); - // _number++; - }); - } - else - { - _ret.MessageList.Add("ERP订单编号已存在,请重新导入!"); - return; - } + q = q.Where(p => p.State == p_entity.State); + } + //q = q.Where(p => p.IsDeleted == p_entity.IsDeleted); - if (_ret.MessageList.Count == 0) - { - int state = db.SaveChanges(); - if (state != -1) - { - _ret.State = ReturnStatus.Succeed; - _ret.Result = true; - } - else - { - _ret.State = ReturnStatus.Failed; - _ret.Result = false; - } - } - else - { - _ret.State = ReturnStatus.Failed; - _ret.Result = false; - } - } - ); + //IQueryable _aq = db.TB_ASK_DETAIL; + //_aq = _aq.Where(p => p.PoBillNum == p_entity.PoBillNum); + //var _a=_aq.GroupBy(p => new { p.PoBillNum, p.PoLine, p.PartCode }).Select(p => new { AskSum = p.Max(itm=>itm .AskQty),PoLine=p.Key }); + if (p_entity.UserInAddress != null && p_entity.UserInAddress.Count > 0) + { + q = q.Where(p => p_entity.UserInAddress.Contains(p.Site)); } + _ret.State = ReturnStatus.Succeed; + _ret.Result = q; + p_action(_ret); } } catch (System.Data.Entity.Validation.DbEntityValidationException dbEx)//捕获实体验证异常 @@ -2647,18 +8737,16 @@ namespace CK.SCP.Controller }); } _ret.State = ReturnStatus.Failed; - _ret.Result = false; _ret.ErrorList.Add(dbEx); - LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "EXCEL_PO_MOD", sb.ToString()); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "Get_V_TB_PO_DETAIL_List", sb.ToString()); throw new ScpException(ResultCode.DbEntityValidationException, sb.ToString(), "字段验证失败" + sb.ToString()); } catch (OptimisticConcurrencyException ex)//并发冲突异常 { _ret.State = ReturnStatus.Failed; - _ret.Result = false; _ret.ErrorList.Add(ex); - LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "EXCEL_PO_MOD", ex.ToString()); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "Get_V_TB_PO_DETAIL_List", ex.ToString()); throw new ScpException(ResultCode.Exception, "9999", ex.ToString()); } catch (ScpException ex) @@ -2666,9 +8754,8 @@ namespace CK.SCP.Controller _ret.State = ReturnStatus.Failed; - _ret.Result = false; _ret.ErrorList.Add(ex); - LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "EXCEL_PO_MOD", ex.ToString()); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "Get_V_TB_PO_DETAIL_List", ex.ToString()); if (ex.InnerException != null && ex.InnerException.GetType() == typeof(UpdateException)) { @@ -2685,178 +8772,58 @@ namespace CK.SCP.Controller catch (Exception e) { _ret.State = ReturnStatus.Failed; - LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "EXCEL_PO_MOD", e.Message); - _ret.Result = false; _ret.ErrorList.Add(e); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "Get_V_TB_PO_DETAIL_List", e.Message); throw e; } - return _ret; - - } - public static List EXCEL_ASK_Check(List p_order_list) - { - List ErrorList = new List(); - using (ScpEntities db = EntitiesFactory.CreateScpInstance()) - { - p_order_list.ForEach - (p => - { - //var _ls = CheckExcel(db, p); - var _checkls = CheckExcelPackQty(db, p); - if (_checkls.Count > 0) - { - ErrorList.Add(string.Join("
", _checkls.ToArray())); - } - }); - } - return ErrorList; } - public static ResultObject EXCEL_PO_TO_ASK(List p_order_list, string p_creator, string p_buyer, DateTime p_time, BillModType p_modtype, string p_site, bool IsAutoPublish = false) + public static void Get_V_TB_MAXPO_DETAIL_List(V_TB_MAXPO_DETAIL p_entity, Action>> p_action) { - ResultObject _ret = new ResultObject(); + ResultObject> _ret = new ResultObject>(); try { using (ScpEntities db = EntitiesFactory.CreateScpInstance()) { - int number = 1; - List lineError = new List(); - List ErrorList = new List(); - p_order_list.ForEach - (p => - { - var _ls = CheckExcel(db, p); - if (_ls.Count > 0) - { - lineError.Add(number.ToString()); - ErrorList.Add(string.Join("
", _ls.ToArray())); - } - number++; + IQueryable q = db.V_TB_MAXPO_DETAIL; - }); - if (lineError.Count > 0) + if (!string.IsNullOrEmpty(p_entity.PoBillNum)) { - _ret.State = ReturnStatus.Failed; - _ret.MessageList.AddRange(ErrorList); - _ret.Result = false; + q = q.Where(p => p.PoBillNum == p_entity.PoBillNum); } - else - { - p_order_list = p_order_list.Where(p => int.Parse(p.数量) != 0).ToList(); - - - //var VenderList = p_order_list.Select(p => p.供应商编号).Distinct(); - //var PartCodeList = p_order_list.Select(p => p.零件号).Distinct(); - var OrderList = p_order_list.GroupBy(p =>new { p.分组编号, p.供应商编号 }).ToList(); - OrderList.ForEach((p) => - { - var list_distinct = p.GroupBy(t => new { t.零件号, t.行号 }).ToList(); - var list = p.ToList(); - if (list_distinct.Count < list.Count) - { - _ret.MessageList.Add("相同组号,存在同一编号、行号的数据"); - return; - } - if (list.Count > 0) - { - - var _entity = list.FirstOrDefault(); - TB_ASK _ask = new TB_ASK(); - _ask.AskBillNum = SCP_BILLCODE_CONTROLLER.MakeASKCode(); - _ask.State = (int)AskState.New; - _ask.PoBillNum = _entity.QAD订单号.ToUpper(); - _ask.ModType = (int)BillModType.Contract; - _ask.Site = p_site; - if (IsAutoPublish) - { - _ask.State = (int)AskState.Release; - } - else - { - _ask.State = (int)AskState.New; - } - _ask.BeginTime = DateTime.Now; - _ask.Buyer = _entity.交货联系人; - _ask.BuyerPhone = _entity.交货联系人电话; - _ask.ErpBillNum = _entity.QAD订单号.ToUpper(); - _ask.EndTime = DateTime.Parse(_entity.要求到货日期); - _ask.CreateTime = DateTime.Now; - _ask.CreateUser = p_creator; - _ask.VendId = _entity.供应商编号.ToUpper(); - _ask.GUID = Guid.NewGuid(); - _ask.IsDeleted = false; - db.TB_ASK.Add(_ask); - - #region 供应商新任务代办接口 - TB_PENING_ITEMS _item = new TB_PENING_ITEMS(); - _item.ROLE_NAME = "供应商"; - _item.ITEM_NO = _ask.AskBillNum; - _item.ITEM_CONTENT = "要货看盘有信息"; - _item.ITEM_TYPE = (int)PENDING_MESSAGE_TYPE.NEW_ASK; - _item.VEND_ID = _ask.VendId; - _item.ITEM_STATE = (int)PENDING_STATE.WAITING; - _item.SENDER = _entity.交货联系人; - _item.SENDING_TIME = DateTime.Now; - db.TB_PENING_ITEMS.Add(_item); - #endregion - - // int _number = 1; - list.ForEach((itm) => - { - TB_ASK_DETAIL _t_ASK_Detail = new TB_ASK_DETAIL(); - //_t_ASK_Detail.PoLine = _number; - _t_ASK_Detail.PoLine = Int32.Parse(itm.行号); - _t_ASK_Detail.Currency = itm.币种; - _t_ASK_Detail.AskBillNum = _ask.AskBillNum; - _t_ASK_Detail.PoBillNum = _ask.PoBillNum; - _t_ASK_Detail.PoUnit = itm.单位; - _t_ASK_Detail.CreateTime = DateTime.Now; - _t_ASK_Detail.CreateUser = _ask.CreateUser; - _t_ASK_Detail.PartCode = (itm.零件号.ToUpper()).TrimEnd(); - _t_ASK_Detail.BeginTime = _ask.BeginTime; - _t_ASK_Detail.EndTime = DateTime.Parse(itm.要求到货日期); - _t_ASK_Detail.TempQty = decimal.Parse(itm.数量); - _t_ASK_Detail.AskQty = decimal.Parse(itm.数量); - _t_ASK_Detail.IsDeleted = false; - _t_ASK_Detail.LocUnit = itm.单位; - _t_ASK_Detail.UnConv = 1; - _t_ASK_Detail.State = _ask.State; - _t_ASK_Detail.Price = string.IsNullOrEmpty(itm.价格) ? 0 : decimal.Parse(itm.价格); - _t_ASK_Detail.GUID = Guid.NewGuid(); - _t_ASK_Detail.Remark = itm.备注; - db.TB_ASK_DETAIL.Add(_t_ASK_Detail); - // _number++; - }); - } - else - { - _ret.MessageList.Add("ERP订单编号已存在,请重新导入!"); - return; - } - - if (_ret.MessageList.Count == 0) - { - int state = db.SaveChanges(); - if (state != -1) - { - _ret.State = ReturnStatus.Succeed; - _ret.Result = true; - } - else - { - _ret.State = ReturnStatus.Failed; - _ret.Result = false; - } - } - else - { - _ret.State = ReturnStatus.Failed; - _ret.Result = false; - } - } - ); + if (!string.IsNullOrEmpty(p_entity.ContractMonth)) + { + q = q.Where(p => p.ContractMonth == p_entity.ContractMonth); + } + if (!string.IsNullOrEmpty(p_entity.PartCode)) + { + q = q.Where(p => p.PartCode == p_entity.PartCode); + } + if (!string.IsNullOrEmpty(p_entity.VendId)) + { + q = q.Where(p => p.VendId == p_entity.VendId); + } + if (!string.IsNullOrEmpty(p_entity.CreateUser)) + { + q = q.Where(p => p.CreateUser == p_entity.CreateUser); } + if (!string.IsNullOrEmpty(p_entity.PartNumber)) + { + q = q.Where(p => p.PartNumber == p_entity.PartNumber); + } + if (!string.IsNullOrEmpty(p_entity.BeginTime.ToString())) + { + q = q.Where(p => p.CreateTime >= p_entity.BeginTime); + } + if (!string.IsNullOrEmpty(p_entity.EndTime.ToString())) + { + q = q.Where(p => p.CreateTime <= p_entity.EndTime); + } + q = q.Where(p=>p.IsDeleted==p_entity.IsDeleted); + _ret.State = ReturnStatus.Succeed; + _ret.Result = q; + p_action(_ret); } } catch (System.Data.Entity.Validation.DbEntityValidationException dbEx)//捕获实体验证异常 @@ -2872,18 +8839,16 @@ namespace CK.SCP.Controller }); } _ret.State = ReturnStatus.Failed; - _ret.Result = false; _ret.ErrorList.Add(dbEx); - LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "EXCEL_PO_TO_ASK", sb.ToString()); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "Get_V_TB_PO_DETAIL_List", sb.ToString()); throw new ScpException(ResultCode.DbEntityValidationException, sb.ToString(), "字段验证失败" + sb.ToString()); } catch (OptimisticConcurrencyException ex)//并发冲突异常 { _ret.State = ReturnStatus.Failed; - _ret.Result = false; _ret.ErrorList.Add(ex); - LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "EXCEL_PO_TO_ASK", ex.ToString()); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "Get_V_TB_PO_DETAIL_List", ex.ToString()); throw new ScpException(ResultCode.Exception, "9999", ex.ToString()); } catch (ScpException ex) @@ -2891,9 +8856,8 @@ namespace CK.SCP.Controller _ret.State = ReturnStatus.Failed; - _ret.Result = false; _ret.ErrorList.Add(ex); - LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "EXCEL_PO_TO_ASK", ex.ToString()); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "Get_V_TB_PO_DETAIL_List", ex.ToString()); if (ex.InnerException != null && ex.InnerException.GetType() == typeof(UpdateException)) { @@ -2910,106 +8874,40 @@ namespace CK.SCP.Controller catch (Exception e) { _ret.State = ReturnStatus.Failed; - LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "EXCEL_PO_TO_ASK", e.Message); - _ret.Result = false; _ret.ErrorList.Add(e); - if (e.InnerException != null) - { - _ret.MessageList.Add(e.InnerException.Message); - } - else - { - _ret.MessageList.Add(e.Message); - } + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "Get_V_TB_PO_DETAIL_List", e.Message); + throw e; } - return _ret; } - - - public static ResultObject Save_PO_TO_ASK(V_TB_PO p_order, List p_order_list - , string p_buyer, string p_buyerPhone, string p_creator) + public static void Get_V_TB_MAXPO_INCOMPLETE_DETAIL(V_TB_MAXPO_CONSUME p_entity, Action>> p_action) { - ResultObject _ret = new ResultObject(); + ResultObject> _ret = new ResultObject>(); try { using (ScpEntities db = EntitiesFactory.CreateScpInstance()) { - TB_ASK _t = new TB_ASK(); - _t.AskBillNum = SCP_BILLCODE_CONTROLLER.MakeASKCode(); - _t.PoBillNum = p_order.PoBillNum; - _t.VendId = p_order.VendId; - _t.IsDeleted = false;//操作员 - _t.CreateTime = DateTime.Now; - _t.CreateUser = p_creator; - _t.Site = p_order.Site; - _t.ReceivedPort = p_order.ReceivedPort; - _t.Remark = p_order.Remark; - _t.State = (int)AskState.New; - _t.SubSite = p_order.SubSite; - _t.Extend1 = p_order.Extend1; - _t.Extend2 = p_order.Extend2; - _t.Extend3 = p_order.Extend3; + IQueryable q = db.V_TB_MAXPO_CONSUME; - _t.GUID = Guid.NewGuid(); - _t.ModType = (int)p_order.ModType; - _t.ErpBillNum = p_order.ErpBillNum; - _t.BeginTime = (DateTime)p_order.BeginTime; - var _date = p_order.BeginTime; - if(p_order_list.Count>0) - { - _date = p_order_list[0].EndTime; - } - _t.EndTime = _date; - _t.Buyer = p_buyer; - _t.BuyerPhone = p_buyerPhone; - db.TB_ASK.AddOrUpdate(p => p.AskBillNum, _t); - List _list = new List(); - foreach (var itm in p_order_list) - { - TB_ASK_DETAIL _tDetail = new TB_ASK_DETAIL(); - _tDetail.Remark = _t.Remark; - _tDetail.PoBillNum = _t.PoBillNum; - _tDetail.AskBillNum = _t.AskBillNum; - _tDetail.PoLine = itm.PoLine; - _tDetail.PoUnit = itm.PoUnit; - _tDetail.CreateTime = DateTime.Now; - _tDetail.CreateUser = p_creator; - _tDetail.PartCode = itm.PartCode; - _tDetail.ReceivedPort = itm.ReceivedPort; - _tDetail.BeginTime = itm.BeginTime; - _tDetail.EndTime = itm.EndTime; - _tDetail.TempQty = itm.TempQty == null ? 0 : (decimal)itm.TempQty; - _tDetail.AskQty = (decimal)itm.PublishQty; - _tDetail.IsDeleted = false; - _tDetail.LocUnit = itm.LocUnit; - _tDetail.UnConv = itm.UnConv; - _tDetail.State = (int)p_order.State; - _tDetail.Price = itm.Price; - _tDetail.GUID = Guid.NewGuid(); - _tDetail.Currency = itm.Currency; - _tDetail.Site = itm.Site; - _tDetail.SubSite = itm.SubSite; - _tDetail.Extend1 = itm.Extend1; - _tDetail.Extend2 = itm.Extend2; - _tDetail.Extend3 = itm.Extend3; - db.TB_ASK_DETAIL.Add(_tDetail); - var _order_detail = db.TB_PO_DETAIL.Where(p => p.UID == itm.UID).FirstOrDefault(); - _order_detail.TempQty = itm.TempQty; - db.TB_PO_DETAIL.AddOrUpdate(p => p.UID, _order_detail); - } - int state = db.SaveChanges(); - if (state != -1) + //if (!string.IsNullOrEmpty(p_entity.PoBillNum)) + //{ + // q = q.Where(p => p.PoBillNum == p_entity.PoBillNum); + //} + //if (!string.IsNullOrEmpty(p_entity.PartCode)) + //{ + // q = q.Where(p => p.PartCode == p_entity.PartCode); + //} + if (p_entity.PoList != null && p_entity.PoList.Count > 0) { - _ret.State = ReturnStatus.Succeed; - _ret.Result = true; + q = q.Where(p => p_entity.PoList.Contains(p.PoBillNum)); } - else + if (p_entity.PartList != null && p_entity.PartList.Count > 0) { - _ret.State = ReturnStatus.Failed; - _ret.Result = false; + q = q.Where(p => p_entity.PartList.Contains(p.PartCode)); } - + _ret.State = ReturnStatus.Succeed; + _ret.Result = q; + p_action(_ret); } } catch (System.Data.Entity.Validation.DbEntityValidationException dbEx)//捕获实体验证异常 @@ -3025,18 +8923,16 @@ namespace CK.SCP.Controller }); } _ret.State = ReturnStatus.Failed; - _ret.Result = false; _ret.ErrorList.Add(dbEx); - LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "Save_PO_TO_ASK", sb.ToString()); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "Get_V_TB_PO_DETAIL_List", sb.ToString()); throw new ScpException(ResultCode.DbEntityValidationException, sb.ToString(), "字段验证失败" + sb.ToString()); } catch (OptimisticConcurrencyException ex)//并发冲突异常 { _ret.State = ReturnStatus.Failed; - _ret.Result = false; _ret.ErrorList.Add(ex); - LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "Save_PO_TO_ASK", ex.ToString()); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "Get_V_TB_PO_DETAIL_List", ex.ToString()); throw new ScpException(ResultCode.Exception, "9999", ex.ToString()); } catch (ScpException ex) @@ -3044,9 +8940,8 @@ namespace CK.SCP.Controller _ret.State = ReturnStatus.Failed; - _ret.Result = false; _ret.ErrorList.Add(ex); - LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "Save_PO_TO_ASK", ex.ToString()); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "Get_V_TB_PO_DETAIL_List", ex.ToString()); if (ex.InnerException != null && ex.InnerException.GetType() == typeof(UpdateException)) { @@ -3063,107 +8958,46 @@ namespace CK.SCP.Controller catch (Exception e) { _ret.State = ReturnStatus.Failed; - LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "Save_PO_TO_ASK", e.Message); - _ret.Result = false; _ret.ErrorList.Add(e); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "Get_V_TB_PO_DETAIL_List", e.Message); throw e; } - return _ret; - } - public static void Get_V_TB_PO_DETAIL_OUTPUT_List(V_TB_PO_DETAIL p_entity, Action>> p_action) + } + public static void Get_V_TB_MAXPO_List(V_TB_MAXPO p_entity, Action>> p_action) { - ResultObject> _ret = new ResultObject>(); + ResultObject> _ret = new ResultObject>(); try { using (ScpEntities db = EntitiesFactory.CreateScpInstance()) { - IQueryable q = db.V_TB_PO_DETAIL; + IQueryable q = db.V_TB_MAXPO; if (!string.IsNullOrEmpty(p_entity.PoBillNum)) { q = q.Where(p => p.PoBillNum == p_entity.PoBillNum); } - if (!string.IsNullOrEmpty(p_entity.ErpBillNum)) - { - q = q.Where(p => p.ErpBillNum.Contains(p_entity.ErpBillNum)); - } - if (p_entity.BeginTime != null) - { - q = q.Where(p => p.BeginTime >= p_entity.BeginTime); - } - if (p_entity.EndTime != null) - { - q = q.Where(p => p.BeginTime <= p_entity.EndTime); - } - if (!string.IsNullOrEmpty(p_entity.VendId)) { - q = q.Where(p => p.VendId.Contains(p_entity.VendId)); - } - if (!string.IsNullOrEmpty(p_entity.VendName)) - { - q = q.Where(p => p.VendName.Contains(p_entity.VendName)); - } - - - if (p_entity.ModType != null) - { - q = q.Where(p => p.ModType == p_entity.ModType); - } - if (!string.IsNullOrEmpty(p_entity.ProjectId)) - { - q = q.Where(p => p.ProjectId.Contains(p_entity.ProjectId)); - } - if (!string.IsNullOrEmpty(p_entity.PartCode)) - { - q = q.Where(p => p.PartCode.Contains(p_entity.PartCode)); - } - if (p_entity.State != null) - { - q = q.Where(p => p.State == p_entity.State); - } - //q = q.Where(p => p.IsDeleted == p_entity.IsDeleted); - - //IQueryable _aq = db.TB_ASK_DETAIL; - //_aq = _aq.Where(p => p.PoBillNum == p_entity.PoBillNum); - //var _a=_aq.GroupBy(p => new { p.PoBillNum, p.PoLine, p.PartCode }).Select(p => new { AskSum = p.Max(itm=>itm .AskQty),PoLine=p.Key }); - if (p_entity.UserInAddress != null && p_entity.UserInAddress.Count > 0) - { - q = q.Where(p => p_entity.UserInAddress.Contains(p.Site)); - } - if (!string.IsNullOrEmpty(p_entity.SubSite)) - { - q = q.Where(p => p.SubSite == p_entity.SubSite); - } - if (!string.IsNullOrEmpty(p_entity.Extend1)) - { - q = q.Where(p => p.Extend1 == p_entity.Extend1); - } - if (!string.IsNullOrEmpty(p_entity.Extend2)) - { - q = q.Where(p => p.Extend1 == p_entity.Extend2); - } - if (!string.IsNullOrEmpty(p_entity.Extend3)) - { - q = q.Where(p => p.Extend1 == p_entity.Extend3); + q = q.Where(p => p.VendId == p_entity.VendId); } - if (!string.IsNullOrEmpty(p_entity.SubSite)) + if (!string.IsNullOrEmpty(p_entity.CreateUser)) { - q = q.Where(p => p.SubSite.Contains(p_entity.SubSite)); + q = q.Where(p => p.CreateUser == p_entity.CreateUser); } - if (!string.IsNullOrEmpty(p_entity.Extend1)) + if (!string.IsNullOrEmpty(p_entity.ContractMonth)) { - q = q.Where(p => p.Extend1.Contains(p_entity.Extend1)); + q = q.Where(p => p.ContractMonth == p_entity.ContractMonth); } - if (!string.IsNullOrEmpty(p_entity.Extend2)) + if (!string.IsNullOrEmpty(p_entity.BeginTime.ToString())) { - q = q.Where(p => p.Extend2.Contains(p_entity.Extend2)); + q = q.Where(p => p.CreateTime >= p_entity.BeginTime); } - if (!string.IsNullOrEmpty(p_entity.Extend3)) + if (!string.IsNullOrEmpty(p_entity.EndTime.ToString())) { - q = q.Where(p => p.Extend3.Contains(p_entity.Extend3)); + q = q.Where(p => p.CreateTime <= p_entity.EndTime); } + q = q.Where(p => p.IsDeleted == p_entity.IsDeleted); _ret.State = ReturnStatus.Succeed; _ret.Result = q; p_action(_ret); @@ -3226,60 +9060,20 @@ namespace CK.SCP.Controller - public static void Get_V_TB_PO_DETAIL_List(V_TB_PO_DETAIL p_entity, Action>> p_action) + public static void Get_V_TB_PO_SUBDETAIL(V_TB_PO_SUBDETAIL p_entity, Action>> p_action) { - ResultObject> _ret = new ResultObject>(); + ResultObject> _ret = new ResultObject>(); try { using (ScpEntities db = EntitiesFactory.CreateScpInstance()) { - IQueryable q = db.V_TB_PO_DETAIL; + IQueryable q = db.V_TB_PO_SUBDETAIL; if (!string.IsNullOrEmpty(p_entity.PoBillNum)) { q = q.Where(p => p.PoBillNum == p_entity.PoBillNum); } - if (!string.IsNullOrEmpty(p_entity.ErpBillNum)) - { - q = q.Where(p => p.ErpBillNum.Contains(p_entity.ErpBillNum)); - } - if (p_entity.BeginTime != null) - { - q = q.Where(p => p.BeginTime >= p_entity.BeginTime); - } - if (p_entity.EndTime != null) - { - q = q.Where(p => p.BeginTime <= p_entity.EndTime); - } - if (!string.IsNullOrEmpty(p_entity.VendName)) - { - q = q.Where(p => p.VendName == p_entity.VendName); - } - if (p_entity.ModType != null) - { - q = q.Where(p => p.ModType == p_entity.ModType); - } - if (!string.IsNullOrEmpty(p_entity.ProjectId)) - { - q = q.Where(p => p.ProjectId == p_entity.ProjectId); - } - if (!string.IsNullOrEmpty(p_entity.PartCode)) - { - q = q.Where(p => p.PartCode == p_entity.PartCode); - } - if (p_entity.State != null) - { - q = q.Where(p => p.State == p_entity.State); - } - //q = q.Where(p => p.IsDeleted == p_entity.IsDeleted); - - //IQueryable _aq = db.TB_ASK_DETAIL; - //_aq = _aq.Where(p => p.PoBillNum == p_entity.PoBillNum); - //var _a=_aq.GroupBy(p => new { p.PoBillNum, p.PoLine, p.PartCode }).Select(p => new { AskSum = p.Max(itm=>itm .AskQty),PoLine=p.Key }); - if (p_entity.UserInAddress != null && p_entity.UserInAddress.Count > 0) - { - q = q.Where(p => p_entity.UserInAddress.Contains(p.Site)); - } + _ret.State = ReturnStatus.Succeed; _ret.Result = q; p_action(_ret); @@ -3341,9 +9135,6 @@ namespace CK.SCP.Controller } - - - #region 沈阳金杯 public static ResultObject Save_PO_TO_ASK_SYJB(V_TB_PO p_order, List p_order_list , string p_buyer, string p_buyerPhone) diff --git a/Controller/SCP_REPORT_CONTROLLER.cs b/Controller/SCP_REPORT_CONTROLLER.cs index 5b01e33..cd3a195 100644 --- a/Controller/SCP_REPORT_CONTROLLER.cs +++ b/Controller/SCP_REPORT_CONTROLLER.cs @@ -912,7 +912,71 @@ namespace CK.SCP.Controller } } + public static void Get_V_TB_ASK_ASN_View_List1(V_TB_REEEE p_entity, Action>> p_action) + { + ResultObject> _ret = new ResultObject>(); + try + { + using (ScpEntities db = EntitiesFactory.CreateScpInstance()) + { + IQueryable q = db.V_TB_REEEE; + if (!string.IsNullOrEmpty(p_entity.PoBillNum)) + { + q = q.Where(p => p.PoBillNum == p_entity.PoBillNum); + } + + _ret.State = ReturnStatus.Succeed; + _ret.Result = q; + p_action(_ret); + } + + } + catch (System.Data.Entity.Validation.DbEntityValidationException dbEx)//捕获实体验证异常 + { + var sb = new StringBuilder(); + foreach (var error in dbEx.EntityValidationErrors.ToList()) + { + error.ValidationErrors.ToList().ForEach(i => + { + sb.AppendFormat("表:{0},字段:{1},信息:{2}\r\n", error.Entry.Entity.GetType().Name, i.PropertyName, i.ErrorMessage); + }); + } + _ret.State = ReturnStatus.Failed; + _ret.ErrorList.Add(dbEx); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_ASK_CONTROLLER), "Get_V_TB_ASK_ASN_View_List", sb.ToString()); + throw new ScpException(ResultCode.DbEntityValidationException, sb.ToString(), "字段验证失败" + sb.ToString()); + } + catch (OptimisticConcurrencyException ex)//并发冲突异常 + { + _ret.State = ReturnStatus.Failed; + _ret.ErrorList.Add(ex); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_ASK_CONTROLLER), "Get_V_TB_ASK_ASN_View_List", ex.ToString()); + throw new ScpException(ResultCode.Exception, "9999", ex.ToString()); + } + catch (ScpException ex) + { + _ret.State = ReturnStatus.Failed; + _ret.ErrorList.Add(ex); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_ASK_CONTROLLER), "Get_V_TB_ASK_ASN_View_List", ex.ToString()); + if (ex.InnerException != null && ex.InnerException.GetType() == typeof(UpdateException)) + { + var inner = (UpdateException)ex.InnerException; + throw new ScpException(ResultCode.Exception, "0000", ex.ToString()); + } + else + { + if (ex.InnerException != null) throw ex.InnerException; + } + } + catch (Exception e) + { + _ret.State = ReturnStatus.Failed; + _ret.ErrorList.Add(e); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_ASK_CONTROLLER), "Get_V_TB_ASK_ASN_View_List", e.Message); + throw e; + } + } public static void Get_V_TB_ASK_RECEIVE_List(TB_ASK_RECEIVE p_entity, Action>> p_action) { diff --git a/Controller/SCP_TA_LANGUAGE_CONTROLLER.cs b/Controller/SCP_TA_LANGUAGE_CONTROLLER.cs index 0b68e5b..56b4e65 100644 --- a/Controller/SCP_TA_LANGUAGE_CONTROLLER.cs +++ b/Controller/SCP_TA_LANGUAGE_CONTROLLER.cs @@ -122,9 +122,199 @@ namespace CK.SCP.Controller } return _ret; } - + public static ResultObject> Get_TA_LANGUAGE_List1(TA_Appliance p_entity) + { + ResultObject> _ret = new ResultObject>(); + try + { + using (ScpEntities db = EntitiesFactory.CreateScpInstance()) + { + IQueryable q = db.TA_Appliance; + if (!string.IsNullOrEmpty(p_entity.PartNumber)) + { + q = q.Where(p => p.PartNumber == p_entity.PartNumber); + } + if (!string.IsNullOrEmpty(p_entity.PartDesc2)) + { + q = q.Where(p => p.PartDesc2 == p_entity.PartDesc2); + } + if (!string.IsNullOrEmpty(p_entity.Texture)) + { + q = q.Where(p => p.Texture == p_entity.Texture); + } + if (!string.IsNullOrEmpty(p_entity.ReceivingPort)) + { + q = q.Where(p => p.ReceivingPort == p_entity.ReceivingPort); + } + if (!string.IsNullOrEmpty(p_entity.PartDesc1)) + { + q = q.Where(p => p.PartDesc1 == p_entity.PartDesc1); + } + if (!string.IsNullOrEmpty(p_entity.Model)) + { + q = q.Where(p => p.Model == p_entity.Model); + } + if (p_entity.PackNumber != 0) + { + q = q.Where(p => p.PackNumber == p_entity.PackNumber); + } + if (!string.IsNullOrEmpty(p_entity.ReciteNumber)) + { + q = q.Where(p => p.ReciteNumber == p_entity.ReciteNumber); + } + if (!string.IsNullOrEmpty(p_entity.SufanLand)) + { + q = q.Where(p => p.SufanLand == p_entity.SufanLand); + } + if (!string.IsNullOrEmpty(p_entity.BoxType)) + { + q = q.Where(p => p.BoxType == p_entity.BoxType); + } + if (!string.IsNullOrEmpty(p_entity.PostEngineering)) + { + q = q.Where(p => p.PostEngineering == p_entity.PostEngineering); + } + if (!string.IsNullOrEmpty(p_entity.VendID)) + { + q = q.Where(p => p.VendID == p_entity.VendID); + } + _ret.Result = q.ToList(); + _ret.State = ReturnStatus.Succeed; + } + } + catch (System.Data.Entity.Validation.DbEntityValidationException dbEx)//捕获实体验证异常 + { + var sb = new StringBuilder(); - public static ResultObject Save_TA_LANGUAGE(List p_entitys) + foreach (var error in dbEx.EntityValidationErrors.ToList()) + { + + error.ValidationErrors.ToList().ForEach(i => + { + sb.AppendFormat("表:{0},字段:{1},信息:{2}\r\n", error.Entry.Entity.GetType().Name, i.PropertyName, i.ErrorMessage); + }); + } + _ret.State = ReturnStatus.Failed; + _ret.ErrorList.Add(dbEx); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_TA_LANGUAGE_CONTROLLER), "Get_TA_LANGUAGE_List", sb.ToString()); + throw new ScpException(ResultCode.DbEntityValidationException, sb.ToString(), "字段验证失败" + sb.ToString()); + } + catch (OptimisticConcurrencyException ex)//并发冲突异常 + { + + _ret.State = ReturnStatus.Failed; + _ret.ErrorList.Add(ex); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_TA_LANGUAGE_CONTROLLER), "Get_TA_LANGUAGE_List", ex.ToString()); + throw new ScpException(ResultCode.Exception, "9999", ex.ToString()); + } + catch (ScpException ex) + { + + + _ret.State = ReturnStatus.Failed; + _ret.ErrorList.Add(ex); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_TA_LANGUAGE_CONTROLLER), "Get_TA_LANGUAGE_List", ex.ToString()); + + if (ex.InnerException != null && ex.InnerException.GetType() == typeof(UpdateException)) + { + var inner = (UpdateException)ex.InnerException; + + + throw new ScpException(ResultCode.Exception, "0000", ex.ToString()); + } + else + { + if (ex.InnerException != null) throw ex.InnerException; + } + } + catch (Exception e) + { + _ret.State = ReturnStatus.Failed; + _ret.ErrorList.Add(e); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_TA_LANGUAGE_CONTROLLER), "Get_TA_LANGUAGE_List", e.Message); + throw e; + } + return _ret; + } + public static ResultObject> Get_TA_PurchaGroup_List(TA_PurchasGroup p_entity) + { + ResultObject> _ret = new ResultObject>(); + try + { + using (ScpEntities db = EntitiesFactory.CreateScpInstance()) + { + IQueryable q = db.TA_PurchasGroup; + if (!string.IsNullOrEmpty(p_entity.PurchasingGroup)) + { + q = q.Where(p => p.PurchasingGroup == p_entity.PurchasingGroup); + } + if (!string.IsNullOrEmpty(p_entity.ChineseName)) + { + q = q.Where(p => p.ChineseName == p_entity.ChineseName); + } + if (!string.IsNullOrEmpty(p_entity.Describe)) + { + q = q.Where(p => p.Describe == p_entity.Describe); + } + _ret.Result = q.ToList(); + _ret.State = ReturnStatus.Succeed; + } + } + catch (System.Data.Entity.Validation.DbEntityValidationException dbEx)//捕获实体验证异常 + { + var sb = new StringBuilder(); + + foreach (var error in dbEx.EntityValidationErrors.ToList()) + { + + error.ValidationErrors.ToList().ForEach(i => + { + sb.AppendFormat("表:{0},字段:{1},信息:{2}\r\n", error.Entry.Entity.GetType().Name, i.PropertyName, i.ErrorMessage); + }); + } + _ret.State = ReturnStatus.Failed; + _ret.ErrorList.Add(dbEx); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_TA_LANGUAGE_CONTROLLER), "Get_TA_LANGUAGE_List", sb.ToString()); + throw new ScpException(ResultCode.DbEntityValidationException, sb.ToString(), "字段验证失败" + sb.ToString()); + } + catch (OptimisticConcurrencyException ex)//并发冲突异常 + { + + _ret.State = ReturnStatus.Failed; + _ret.ErrorList.Add(ex); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_TA_LANGUAGE_CONTROLLER), "Get_TA_LANGUAGE_List", ex.ToString()); + throw new ScpException(ResultCode.Exception, "9999", ex.ToString()); + } + catch (ScpException ex) + { + + + _ret.State = ReturnStatus.Failed; + _ret.ErrorList.Add(ex); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_TA_LANGUAGE_CONTROLLER), "Get_TA_LANGUAGE_List", ex.ToString()); + + if (ex.InnerException != null && ex.InnerException.GetType() == typeof(UpdateException)) + { + var inner = (UpdateException)ex.InnerException; + + + throw new ScpException(ResultCode.Exception, "0000", ex.ToString()); + } + else + { + if (ex.InnerException != null) throw ex.InnerException; + } + } + catch (Exception e) + { + _ret.State = ReturnStatus.Failed; + _ret.ErrorList.Add(e); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_TA_LANGUAGE_CONTROLLER), "Get_TA_LANGUAGE_List", e.Message); + throw e; + } + return _ret; + } + public static ResultObject Save_TA_PurchaGroup(List p_entitys) { ResultObject _ret = new ResultObject(); try @@ -133,7 +323,7 @@ namespace CK.SCP.Controller { foreach (var itm in p_entitys) { - db.TA_LANGUAGE.AddOrUpdate(p => p.GUID, itm); + db.TA_PurchasGroup.AddOrUpdate(p => p.PurchasingGroup, itm); } if (db.SaveChanges() != -1) { @@ -206,20 +396,48 @@ namespace CK.SCP.Controller return _ret; } - - - public static ResultObject Del_TA_LANGUAGE(string _ls) + public static ResultObject Save_TA_LANGUAGE1(TA_Appliance p_entitys) { ResultObject _ret = new ResultObject(); try { using (ScpEntities db = EntitiesFactory.CreateScpInstance()) { - + var appliance = db.TA_Appliance.FirstOrDefault(p => p.PartNumber == p_entitys.PartNumber && p.VendID==p_entitys.VendID); + if (appliance == null) + { + TA_Appliance applianc = new TA_Appliance(); + applianc.PartNumber = p_entitys.PartNumber; + applianc.VendID = p_entitys.VendID; + applianc.Texture = p_entitys.Texture; + applianc.ReceivingPort = p_entitys.ReceivingPort; + applianc.PartDesc1 = p_entitys.PartDesc1; + applianc.Model = p_entitys.Model; + applianc.PackNumber = p_entitys.PackNumber; + applianc.ReciteNumber = p_entitys.ReciteNumber; + applianc.SufanLand = p_entitys.SufanLand; + applianc.BoxType = p_entitys.BoxType; + applianc.PostEngineering = p_entitys.PostEngineering; + + db.TA_Appliance.AddOrUpdate(applianc); + } + else + { + appliance.Texture = p_entitys.Texture; + appliance.ReceivingPort = p_entitys.ReceivingPort; + appliance.PartDesc1 = p_entitys.PartDesc1; + appliance.Model = p_entitys.Model; + appliance.PackNumber = p_entitys.PackNumber; + appliance.ReciteNumber = p_entitys.ReciteNumber; + appliance.SufanLand = p_entitys.SufanLand; + appliance.BoxType = p_entitys.BoxType; + appliance.PostEngineering = p_entitys.PostEngineering; + + db.TA_Appliance.AddOrUpdate(appliance); + } + - var _entity = db.TA_LANGUAGE.Where(p=>p.UID.ToString()==_ls).FirstOrDefault(); - db.TA_LANGUAGE.Remove(_entity); if (db.SaveChanges() != -1) { _ret.State = ReturnStatus.Succeed; @@ -247,32 +465,32 @@ namespace CK.SCP.Controller _ret.State = ReturnStatus.Failed; _ret.Result = false; _ret.ErrorList.Add(dbEx); - LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_TA_LANGUAGE_CONTROLLER), "Del_TA_LANGUAGE", sb.ToString()); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_TA_LANGUAGE_CONTROLLER), "Save_TA_LANGUAGE", sb.ToString()); throw new ScpException(ResultCode.DbEntityValidationException, sb.ToString(), "字段验证失败" + sb.ToString()); } catch (OptimisticConcurrencyException ex)//并发冲突异常 { - + _ret.State = ReturnStatus.Failed; _ret.Result = false; _ret.ErrorList.Add(ex); - LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_TA_LANGUAGE_CONTROLLER), "Del_TA_LANGUAGE", ex.ToString()); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_TA_LANGUAGE_CONTROLLER), "Save_TA_LANGUAGE", ex.ToString()); throw new ScpException(ResultCode.Exception, "9999", ex.ToString()); } catch (ScpException ex) { - + _ret.State = ReturnStatus.Failed; _ret.Result = false; _ret.ErrorList.Add(ex); - LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_TA_LANGUAGE_CONTROLLER), "Del_TA_LANGUAGE", ex.ToString()); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_TA_LANGUAGE_CONTROLLER), "Save_TA_LANGUAGE", ex.ToString()); if (ex.InnerException != null && ex.InnerException.GetType() == typeof(UpdateException)) { var inner = (UpdateException)ex.InnerException; - + throw new ScpException(ResultCode.Exception, "0000", ex.ToString()); } else @@ -283,17 +501,759 @@ namespace CK.SCP.Controller catch (Exception e) { _ret.State = ReturnStatus.Failed; + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_TA_LANGUAGE_CONTROLLER), "Save_TA_LANGUAGE", e.Message); _ret.Result = false; _ret.ErrorList.Add(e); - LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_TA_LANGUAGE_CONTROLLER), "Del_TA_LANGUAGE", e.Message); throw e; + throw e; } return _ret; } + public static ResultObject Save_TA_LANGUAGE(List p_entitys) + { + ResultObject _ret = new ResultObject(); + try + { + using (ScpEntities db = EntitiesFactory.CreateScpInstance()) + { + foreach (var itm in p_entitys) + { + db.TA_LANGUAGE.AddOrUpdate(p => p.GUID, itm); + } + if (db.SaveChanges() != -1) + { + _ret.State = ReturnStatus.Succeed; + _ret.Result = true; + } + else + { + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + } + } + } + catch (System.Data.Entity.Validation.DbEntityValidationException dbEx)//捕获实体验证异常 + { + var sb = new StringBuilder(); + + foreach (var error in dbEx.EntityValidationErrors.ToList()) + { + + error.ValidationErrors.ToList().ForEach(i => + { + sb.AppendFormat("表:{0},字段:{1},信息:{2}\r\n", error.Entry.Entity.GetType().Name, i.PropertyName, i.ErrorMessage); + }); + } + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + _ret.ErrorList.Add(dbEx); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_TA_LANGUAGE_CONTROLLER), "Save_TA_LANGUAGE", sb.ToString()); + throw new ScpException(ResultCode.DbEntityValidationException, sb.ToString(), "字段验证失败" + sb.ToString()); + } + catch (OptimisticConcurrencyException ex)//并发冲突异常 + { + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + _ret.ErrorList.Add(ex); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_TA_LANGUAGE_CONTROLLER), "Save_TA_LANGUAGE", ex.ToString()); + throw new ScpException(ResultCode.Exception, "9999", ex.ToString()); + } + catch (ScpException ex) + { - } + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + _ret.ErrorList.Add(ex); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_TA_LANGUAGE_CONTROLLER), "Save_TA_LANGUAGE", ex.ToString()); + + if (ex.InnerException != null && ex.InnerException.GetType() == typeof(UpdateException)) + { + var inner = (UpdateException)ex.InnerException; - -} + throw new ScpException(ResultCode.Exception, "0000", ex.ToString()); + } + else + { + if (ex.InnerException != null) throw ex.InnerException; + } + } + catch (Exception e) + { + _ret.State = ReturnStatus.Failed; + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_TA_LANGUAGE_CONTROLLER), "Save_TA_LANGUAGE", e.Message); + _ret.Result = false; + _ret.ErrorList.Add(e); + throw e; + } + return _ret; + } + + + + public static ResultObject Del_TA_LANGUAGE(string _ls) + { + ResultObject _ret = new ResultObject(); + try + { + using (ScpEntities db = EntitiesFactory.CreateScpInstance()) + { + + + var _entity = db.TA_LANGUAGE.Where(p=>p.UID.ToString()==_ls).FirstOrDefault(); + + db.TA_LANGUAGE.Remove(_entity); + if (db.SaveChanges() != -1) + { + _ret.State = ReturnStatus.Succeed; + _ret.Result = true; + } + else + { + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + } + } + } + catch (System.Data.Entity.Validation.DbEntityValidationException dbEx)//捕获实体验证异常 + { + var sb = new StringBuilder(); + + foreach (var error in dbEx.EntityValidationErrors.ToList()) + { + + error.ValidationErrors.ToList().ForEach(i => + { + sb.AppendFormat("表:{0},字段:{1},信息:{2}\r\n", error.Entry.Entity.GetType().Name, i.PropertyName, i.ErrorMessage); + }); + } + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + _ret.ErrorList.Add(dbEx); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_TA_LANGUAGE_CONTROLLER), "Del_TA_LANGUAGE", sb.ToString()); + throw new ScpException(ResultCode.DbEntityValidationException, sb.ToString(), "字段验证失败" + sb.ToString()); + } + catch (OptimisticConcurrencyException ex)//并发冲突异常 + { + + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + _ret.ErrorList.Add(ex); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_TA_LANGUAGE_CONTROLLER), "Del_TA_LANGUAGE", ex.ToString()); + throw new ScpException(ResultCode.Exception, "9999", ex.ToString()); + } + catch (ScpException ex) + { + + + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + _ret.ErrorList.Add(ex); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_TA_LANGUAGE_CONTROLLER), "Del_TA_LANGUAGE", ex.ToString()); + + if (ex.InnerException != null && ex.InnerException.GetType() == typeof(UpdateException)) + { + var inner = (UpdateException)ex.InnerException; + + + throw new ScpException(ResultCode.Exception, "0000", ex.ToString()); + } + else + { + if (ex.InnerException != null) throw ex.InnerException; + } + } + catch (Exception e) + { + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + _ret.ErrorList.Add(e); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_TA_LANGUAGE_CONTROLLER), "Del_TA_LANGUAGE", e.Message); throw e; + } + return _ret; + } + + public static ResultObject Del_TA_LANGUAGE1(string _ls,string _ls1) + { + ResultObject _ret = new ResultObject(); + try + { + using (ScpEntities db = EntitiesFactory.CreateScpInstance()) + { + + + var _entity = db.TA_Appliance.Where(p => p.PartNumber == _ls&&p.VendID== _ls1).FirstOrDefault(); + + db.TA_Appliance.Remove(_entity); + if (db.SaveChanges() != -1) + { + _ret.State = ReturnStatus.Succeed; + _ret.Result = true; + } + else + { + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + } + } + } + catch (System.Data.Entity.Validation.DbEntityValidationException dbEx)//捕获实体验证异常 + { + var sb = new StringBuilder(); + + foreach (var error in dbEx.EntityValidationErrors.ToList()) + { + + error.ValidationErrors.ToList().ForEach(i => + { + sb.AppendFormat("表:{0},字段:{1},信息:{2}\r\n", error.Entry.Entity.GetType().Name, i.PropertyName, i.ErrorMessage); + }); + } + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + _ret.ErrorList.Add(dbEx); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_TA_LANGUAGE_CONTROLLER), "Del_TA_LANGUAGE", sb.ToString()); + throw new ScpException(ResultCode.DbEntityValidationException, sb.ToString(), "字段验证失败" + sb.ToString()); + } + catch (OptimisticConcurrencyException ex)//并发冲突异常 + { + + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + _ret.ErrorList.Add(ex); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_TA_LANGUAGE_CONTROLLER), "Del_TA_LANGUAGE", ex.ToString()); + throw new ScpException(ResultCode.Exception, "9999", ex.ToString()); + } + catch (ScpException ex) + { + + + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + _ret.ErrorList.Add(ex); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_TA_LANGUAGE_CONTROLLER), "Del_TA_LANGUAGE", ex.ToString()); + + if (ex.InnerException != null && ex.InnerException.GetType() == typeof(UpdateException)) + { + var inner = (UpdateException)ex.InnerException; + + + throw new ScpException(ResultCode.Exception, "0000", ex.ToString()); + } + else + { + if (ex.InnerException != null) throw ex.InnerException; + } + } + catch (Exception e) + { + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + _ret.ErrorList.Add(e); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_TA_LANGUAGE_CONTROLLER), "Del_TA_LANGUAGE1", e.Message); throw e; + } + return _ret; + } + public static ResultObject Del_TA_Storage(string _ls) + { + ResultObject _ret = new ResultObject(); + try + { + using (ScpEntities db = EntitiesFactory.CreateScpInstance()) + { + + + var _entity = db.TA_StorageLocation.Where(p => p.StLocation == _ls ).FirstOrDefault(); + + db.TA_StorageLocation.Remove(_entity); + if (db.SaveChanges() != -1) + { + _ret.State = ReturnStatus.Succeed; + _ret.Result = true; + } + else + { + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + } + } + } + catch (System.Data.Entity.Validation.DbEntityValidationException dbEx)//捕获实体验证异常 + { + var sb = new StringBuilder(); + + foreach (var error in dbEx.EntityValidationErrors.ToList()) + { + + error.ValidationErrors.ToList().ForEach(i => + { + sb.AppendFormat("表:{0},字段:{1},信息:{2}\r\n", error.Entry.Entity.GetType().Name, i.PropertyName, i.ErrorMessage); + }); + } + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + _ret.ErrorList.Add(dbEx); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_TA_LANGUAGE_CONTROLLER), "Del_TA_LANGUAGE", sb.ToString()); + throw new ScpException(ResultCode.DbEntityValidationException, sb.ToString(), "字段验证失败" + sb.ToString()); + } + catch (OptimisticConcurrencyException ex)//并发冲突异常 + { + + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + _ret.ErrorList.Add(ex); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_TA_LANGUAGE_CONTROLLER), "Del_TA_LANGUAGE", ex.ToString()); + throw new ScpException(ResultCode.Exception, "9999", ex.ToString()); + } + catch (ScpException ex) + { + + + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + _ret.ErrorList.Add(ex); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_TA_LANGUAGE_CONTROLLER), "Del_TA_LANGUAGE", ex.ToString()); + + if (ex.InnerException != null && ex.InnerException.GetType() == typeof(UpdateException)) + { + var inner = (UpdateException)ex.InnerException; + + + throw new ScpException(ResultCode.Exception, "0000", ex.ToString()); + } + else + { + if (ex.InnerException != null) throw ex.InnerException; + } + } + catch (Exception e) + { + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + _ret.ErrorList.Add(e); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_TA_LANGUAGE_CONTROLLER), "Del_TA_LANGUAGE1", e.Message); throw e; + } + return _ret; + } + public static ResultObject Del_TA_BoxType(string _ls) + { + ResultObject _ret = new ResultObject(); + try + { + using (ScpEntities db = EntitiesFactory.CreateScpInstance()) + { + + + var _entity = db.TA_BOXTYPE.Where(p => p.BoxType == _ls).FirstOrDefault(); + + db.TA_BOXTYPE.Remove(_entity); + if (db.SaveChanges() != -1) + { + _ret.State = ReturnStatus.Succeed; + _ret.Result = true; + } + else + { + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + } + } + } + catch (System.Data.Entity.Validation.DbEntityValidationException dbEx)//捕获实体验证异常 + { + var sb = new StringBuilder(); + + foreach (var error in dbEx.EntityValidationErrors.ToList()) + { + + error.ValidationErrors.ToList().ForEach(i => + { + sb.AppendFormat("表:{0},字段:{1},信息:{2}\r\n", error.Entry.Entity.GetType().Name, i.PropertyName, i.ErrorMessage); + }); + } + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + _ret.ErrorList.Add(dbEx); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_TA_LANGUAGE_CONTROLLER), "Del_TA_BoxType", sb.ToString()); + throw new ScpException(ResultCode.DbEntityValidationException, sb.ToString(), "字段验证失败" + sb.ToString()); + } + catch (OptimisticConcurrencyException ex)//并发冲突异常 + { + + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + _ret.ErrorList.Add(ex); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_TA_LANGUAGE_CONTROLLER), "Del_TA_BoxType", ex.ToString()); + throw new ScpException(ResultCode.Exception, "9999", ex.ToString()); + } + catch (ScpException ex) + { + + + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + _ret.ErrorList.Add(ex); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_TA_LANGUAGE_CONTROLLER), "Del_TA_BoxType", ex.ToString()); + + if (ex.InnerException != null && ex.InnerException.GetType() == typeof(UpdateException)) + { + var inner = (UpdateException)ex.InnerException; + + + throw new ScpException(ResultCode.Exception, "0000", ex.ToString()); + } + else + { + if (ex.InnerException != null) throw ex.InnerException; + } + } + catch (Exception e) + { + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + _ret.ErrorList.Add(e); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_TA_LANGUAGE_CONTROLLER), "Del_TA_LANGUAGE1", e.Message); throw e; + } + return _ret; + } + public static ResultObject Del_TA_PinFan(string _ls) + { + ResultObject _ret = new ResultObject(); + try + { + using (ScpEntities db = EntitiesFactory.CreateScpInstance()) + { + + + var _entity = db.TA_PinFan.Where(p => p.PartCode == _ls).FirstOrDefault(); + + db.TA_PinFan.Remove(_entity); + if (db.SaveChanges() != -1) + { + _ret.State = ReturnStatus.Succeed; + _ret.Result = true; + } + else + { + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + } + } + } + catch (System.Data.Entity.Validation.DbEntityValidationException dbEx)//捕获实体验证异常 + { + var sb = new StringBuilder(); + + foreach (var error in dbEx.EntityValidationErrors.ToList()) + { + + error.ValidationErrors.ToList().ForEach(i => + { + sb.AppendFormat("表:{0},字段:{1},信息:{2}\r\n", error.Entry.Entity.GetType().Name, i.PropertyName, i.ErrorMessage); + }); + } + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + _ret.ErrorList.Add(dbEx); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_TA_LANGUAGE_CONTROLLER), "Del_TA_PinFan", sb.ToString()); + throw new ScpException(ResultCode.DbEntityValidationException, sb.ToString(), "字段验证失败" + sb.ToString()); + } + catch (OptimisticConcurrencyException ex)//并发冲突异常 + { + + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + _ret.ErrorList.Add(ex); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_TA_LANGUAGE_CONTROLLER), "Del_TA_PinFan", ex.ToString()); + throw new ScpException(ResultCode.Exception, "9999", ex.ToString()); + } + catch (ScpException ex) + { + + + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + _ret.ErrorList.Add(ex); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_TA_LANGUAGE_CONTROLLER), "Del_TA_PinFan", ex.ToString()); + + if (ex.InnerException != null && ex.InnerException.GetType() == typeof(UpdateException)) + { + var inner = (UpdateException)ex.InnerException; + + + throw new ScpException(ResultCode.Exception, "0000", ex.ToString()); + } + else + { + if (ex.InnerException != null) throw ex.InnerException; + } + } + catch (Exception e) + { + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + _ret.ErrorList.Add(e); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_TA_LANGUAGE_CONTROLLER), "Del_TA_PinFan", e.Message); throw e; + } + return _ret; + } + public static ResultObject Del_TA_Model(string _Model) + { + ResultObject _ret = new ResultObject(); + try + { + using (ScpEntities db = EntitiesFactory.CreateScpInstance()) + { + + + var _entity = db.TA_CarModel.Where(p => p.Model == _Model).FirstOrDefault(); + + db.TA_CarModel.Remove(_entity); + if (db.SaveChanges() != -1) + { + _ret.State = ReturnStatus.Succeed; + _ret.Result = true; + } + else + { + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + } + } + } + catch (System.Data.Entity.Validation.DbEntityValidationException dbEx)//捕获实体验证异常 + { + var sb = new StringBuilder(); + + foreach (var error in dbEx.EntityValidationErrors.ToList()) + { + + error.ValidationErrors.ToList().ForEach(i => + { + sb.AppendFormat("表:{0},字段:{1},信息:{2}\r\n", error.Entry.Entity.GetType().Name, i.PropertyName, i.ErrorMessage); + }); + } + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + _ret.ErrorList.Add(dbEx); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_TA_LANGUAGE_CONTROLLER), "Del_TA_Model", sb.ToString()); + throw new ScpException(ResultCode.DbEntityValidationException, sb.ToString(), "字段验证失败" + sb.ToString()); + } + catch (OptimisticConcurrencyException ex)//并发冲突异常 + { + + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + _ret.ErrorList.Add(ex); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_TA_LANGUAGE_CONTROLLER), "Del_TA_Model", ex.ToString()); + throw new ScpException(ResultCode.Exception, "9999", ex.ToString()); + } + catch (ScpException ex) + { + + + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + _ret.ErrorList.Add(ex); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_TA_LANGUAGE_CONTROLLER), "Del_TA_Model", ex.ToString()); + + if (ex.InnerException != null && ex.InnerException.GetType() == typeof(UpdateException)) + { + var inner = (UpdateException)ex.InnerException; + + + throw new ScpException(ResultCode.Exception, "0000", ex.ToString()); + } + else + { + if (ex.InnerException != null) throw ex.InnerException; + } + } + catch (Exception e) + { + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + _ret.ErrorList.Add(e); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_TA_LANGUAGE_CONTROLLER), "Del_TA_Model", e.Message); throw e; + } + return _ret; + } + public static ResultObject Add_TA_Model(string _Model) + { + ResultObject _ret = new ResultObject(); + try + { + using (ScpEntities db = EntitiesFactory.CreateScpInstance()) + { + + + var _entity = db.TA_CarModel.Where(p => p.Model == _Model).FirstOrDefault(); + if (_entity == null) + { + TA_CarModel Car = new TA_CarModel(); + Car.Model = _Model; + db.TA_CarModel.AddOrUpdate(Car); + } + + + if (db.SaveChanges() != -1) + { + _ret.State = ReturnStatus.Succeed; + _ret.Result = true; + } + else + { + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + } + } + } + catch (System.Data.Entity.Validation.DbEntityValidationException dbEx)//捕获实体验证异常 + { + var sb = new StringBuilder(); + + foreach (var error in dbEx.EntityValidationErrors.ToList()) + { + + error.ValidationErrors.ToList().ForEach(i => + { + sb.AppendFormat("表:{0},字段:{1},信息:{2}\r\n", error.Entry.Entity.GetType().Name, i.PropertyName, i.ErrorMessage); + }); + } + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + _ret.ErrorList.Add(dbEx); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_TA_LANGUAGE_CONTROLLER), "Add_TA_Model", sb.ToString()); + throw new ScpException(ResultCode.DbEntityValidationException, sb.ToString(), "字段验证失败" + sb.ToString()); + } + catch (OptimisticConcurrencyException ex)//并发冲突异常 + { + + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + _ret.ErrorList.Add(ex); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_TA_LANGUAGE_CONTROLLER), "Add_TA_Model", ex.ToString()); + throw new ScpException(ResultCode.Exception, "9999", ex.ToString()); + } + catch (ScpException ex) + { + + + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + _ret.ErrorList.Add(ex); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_TA_LANGUAGE_CONTROLLER), "Add_TA_Model", ex.ToString()); + + if (ex.InnerException != null && ex.InnerException.GetType() == typeof(UpdateException)) + { + var inner = (UpdateException)ex.InnerException; + + + throw new ScpException(ResultCode.Exception, "0000", ex.ToString()); + } + else + { + if (ex.InnerException != null) throw ex.InnerException; + } + } + catch (Exception e) + { + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + _ret.ErrorList.Add(e); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_TA_LANGUAGE_CONTROLLER), "Add_TA_Model", e.Message); throw e; + } + return _ret; + } + public static ResultObject Del_TA_LANGUAGE2(string _ls) + { + ResultObject _ret = new ResultObject(); + try + { + using (ScpEntities db = EntitiesFactory.CreateScpInstance()) + { + + + var _entity = db.TA_PurchasGroup.Where(p => p.PurchasingGroup==_ls).FirstOrDefault(); + + db.TA_PurchasGroup.Remove(_entity); + if (db.SaveChanges() != -1) + { + _ret.State = ReturnStatus.Succeed; + _ret.Result = true; + } + else + { + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + } + } + } + catch (System.Data.Entity.Validation.DbEntityValidationException dbEx)//捕获实体验证异常 + { + var sb = new StringBuilder(); + + foreach (var error in dbEx.EntityValidationErrors.ToList()) + { + + error.ValidationErrors.ToList().ForEach(i => + { + sb.AppendFormat("表:{0},字段:{1},信息:{2}\r\n", error.Entry.Entity.GetType().Name, i.PropertyName, i.ErrorMessage); + }); + } + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + _ret.ErrorList.Add(dbEx); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_TA_LANGUAGE_CONTROLLER), "Del_TA_LANGUAGE", sb.ToString()); + throw new ScpException(ResultCode.DbEntityValidationException, sb.ToString(), "字段验证失败" + sb.ToString()); + } + catch (OptimisticConcurrencyException ex)//并发冲突异常 + { + + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + _ret.ErrorList.Add(ex); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_TA_LANGUAGE_CONTROLLER), "Del_TA_LANGUAGE", ex.ToString()); + throw new ScpException(ResultCode.Exception, "9999", ex.ToString()); + } + catch (ScpException ex) + { + + + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + _ret.ErrorList.Add(ex); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_TA_LANGUAGE_CONTROLLER), "Del_TA_LANGUAGE", ex.ToString()); + + if (ex.InnerException != null && ex.InnerException.GetType() == typeof(UpdateException)) + { + var inner = (UpdateException)ex.InnerException; + + + throw new ScpException(ResultCode.Exception, "0000", ex.ToString()); + } + else + { + if (ex.InnerException != null) throw ex.InnerException; + } + } + catch (Exception e) + { + _ret.State = ReturnStatus.Failed; + _ret.Result = false; + _ret.ErrorList.Add(e); + LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_TA_LANGUAGE_CONTROLLER), "Del_TA_LANGUAGE1", e.Message); throw e; + } + return _ret; + } + + + } + + + +} + + + \ No newline at end of file diff --git a/Controller/SCP_TB_VENDER_CONTROLLER.cs b/Controller/SCP_TB_VENDER_CONTROLLER.cs index 68621a1..d06c084 100644 --- a/Controller/SCP_TB_VENDER_CONTROLLER.cs +++ b/Controller/SCP_TB_VENDER_CONTROLLER.cs @@ -28,7 +28,6 @@ namespace CK.SCP.Controller return db.TA_VENDER.ToList(); } } - public static List Getlist(List lsVenderID ) { using (ScpEntities db = EntitiesFactory.CreateScpInstance()) @@ -36,7 +35,7 @@ namespace CK.SCP.Controller var query = db.TA_VENDER.Where(p => lsVenderID.Contains(p.VendId)); return query.ToList(); } - } + } public static List Getlist(string p_site) { using (ScpEntities db = EntitiesFactory.CreateScpInstance()) @@ -45,6 +44,7 @@ namespace CK.SCP.Controller return db.TA_VENDER.Where(p => p.Site==p_site ).ToList(); } } + public static List GetVenderList(List p_list) { using (ScpEntities db = EntitiesFactory.CreateScpInstance()) @@ -69,7 +69,13 @@ namespace CK.SCP.Controller return db.TA_VENDER.Where(p => p.VendId==p_VenderID && p.Site==p_Site).FirstOrDefault(); } } - + public static TB_ASN Save_ASN_Asn(string ls) + { + using (ScpEntities db = EntitiesFactory.CreateScpInstance()) + { + return db.TB_ASN.Where(p => p.AsnBillNum == ls).FirstOrDefault(); + } + } public static List GetVendNameList(List p_list, string p_site) { List _ls = new List(); diff --git a/Controller/SCP_TS_BARCODE_CONTROLLER.cs b/Controller/SCP_TS_BARCODE_CONTROLLER.cs index 3875031..6234fda 100644 --- a/Controller/SCP_TS_BARCODE_CONTROLLER.cs +++ b/Controller/SCP_TS_BARCODE_CONTROLLER.cs @@ -107,6 +107,10 @@ namespace CK.SCP.Controller { q = q.Where(p => p.PartName.Contains(p_entity.PartName)); } + if (!string.IsNullOrEmpty(p_entity.Extend16)) + { + q = q.Where(p => p.Extend16==p_entity.Extend16); + } _ret.State = ReturnStatus.Succeed; _ret.Result = q; p_action(_ret); diff --git a/Controller/UniApiController.cs b/Controller/UniApiController.cs index b7e1171..1dec096 100644 --- a/Controller/UniApiController.cs +++ b/Controller/UniApiController.cs @@ -116,7 +116,7 @@ namespace CK.SCP.Controller WmsTableName tableName; switch (uniApiType) { - case UniApiType.PO: + case UniApiType.Pobillnum: tableName = WmsTableName.TS_UNI_API;//中间表的名字 break; case UniApiType.Receive: @@ -235,9 +235,9 @@ namespace CK.SCP.Controller case "xxwms_rc_det": sql = "select * from xxwms_rc_det a inner join xxwms_ctrl b on a.xxwms_rc_seq = b.xxwms_seq where xxwms_domain = '{1}' and (xxwms_rc_nbr in ({0}) order by xxwms_rc_nbr, b.xxwms_seq"; break; - case "xxscm_tx_mstr": - sql = "select * from xxscm_tx_mstr a inner join xxscm_ctrl b on a.xxscm_tx_seq = b.xxscm_seq where xxscm_domain = '{1}' and xxscm_tx_nbr in ({0}) order by xxscm_tx_nbr, b.xxscm_seq"; - break; + //case "xxscm_tx_mstr": + // sql = "select * from xxscm_tx_mstr a inner join xxscm_ctrl b on a.xxscm_tx_seq = b.xxscm_seq where xxscm_domain = '{1}' and xxscm_tx_nbr in ({0}) order by xxscm_tx_nbr, b.xxscm_seq"; + // break; case "xxscm_inv_det": sql = "select * from xxscm_inv_det a inner join xxscm_ctrl b on a.xxscm_inv_seq = b.xxscm_seq where xxscm_domain = '{1}' and xxscm_inv_nbr IN({0}) order by xxscm_inv_nbr,b.xxscm_seq"; break; @@ -290,13 +290,58 @@ namespace CK.SCP.Controller apiData.VendId = bill.VendId; apiData.BillType = (int)BillType.PuchaseOrder; apiData.SubBillType = 0; - apiData.ValidDate = (DateTime)detail.ProduceDate; + apiData.ValidDate = bill.EndTime; apiData.ErpBillNum = bill.PoBillNum; apiData.ErpLineNum = detail.PoLine; - - if (bill.Site == "BJCIAI") + apiData.ModType= detail.UpdateInfo; + apiData.Barcode = ""; + var ts = db.TS_UNI_API.Count(p => p.ErpLineNum == detail.PoLine && p.ErpBillNum == bill.PoBillNum); + string str = "000"; + string st = bill.PoBillNum.Substring(0,4); + if (ts == 0) + { + string str1= detail.PoLine.ToString(); + + apiData.Extend3 = str1; + } + else + { + if (ts == 1) + { + var ts1 = db.TB_PO_DETAIL.Where(p => p.PoLine == detail.PoLine && p.PoBillNum == bill.PoBillNum).Select(r => r.PoLine).Max(); + int ts2 = ts1 + 50; + string str2 = ts2.ToString(); + + apiData.Extend3 = str2; + } + else if (ts == 2) + { + var ts1 = db.TB_PO_DETAIL.Where(p => p.PoLine == detail.PoLine && p.PoBillNum == bill.PoBillNum).Select(r => r.PoLine).Max(); + int ts2 = ts1 + 60; + string str3 = ts2.ToString(); + + apiData.Extend3 = str3; + } + else if (ts == 3) + { + var ts1 = db.TB_PO_DETAIL.Where(p => p.PoLine == detail.PoLine && p.PoBillNum == bill.PoBillNum).Select(r => r.PoLine).Max(); + int ts2 = ts1 + 70; + string str4 = ts2.ToString(); + + apiData.Extend3 = str4; + } + else + { + var ts3 = db.TS_UNI_API.Where(p => p.ErpLineNum == detail.PoLine && p.ErpBillNum == bill.PoBillNum).Select(r => r.Extend3).Max(); + int ts4 = int.Parse(ts3) + 10; + string str5 = ts4.ToString(); + + apiData.Extend3 = str5; + } + } + if (bill.SubSite == "W21") { - apiData.VendBatch = detail.Batch; + apiData.VendBatch = detail.UpdateUser; } else { @@ -311,7 +356,7 @@ namespace CK.SCP.Controller apiData.Buyer = bill.Buyer; apiData.BuyerPhone = bill.BuyerPhone; apiData.Domain = bill.Site; - apiData.Site = bill.SubSite; + apiData.Site = bill.SubSite ==null ? bill.Site : bill.SubSite; apiData.Extend1 = Utils.JsonHelper.GetJson(bill); apiData.Extend2 = Utils.JsonHelper.GetJson(detail); diff --git a/Controller/Web References/BomList/JsonService.disco b/Controller/Web References/BomList/JsonService.disco new file mode 100644 index 0000000..c63eb0d --- /dev/null +++ b/Controller/Web References/BomList/JsonService.disco @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/Controller/Web References/BomList/JsonService.wsdl b/Controller/Web References/BomList/JsonService.wsdl new file mode 100644 index 0000000..28912cc --- /dev/null +++ b/Controller/Web References/BomList/JsonService.wsdl @@ -0,0 +1,2062 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Controller/Web References/BomList/Reference.cs b/Controller/Web References/BomList/Reference.cs new file mode 100644 index 0000000..597d2cf --- /dev/null +++ b/Controller/Web References/BomList/Reference.cs @@ -0,0 +1,1610 @@ +//------------------------------------------------------------------------------ +// +// 此代码由工具生成。 +// 运行时版本:4.0.30319.42000 +// +// 对此文件的更改可能会导致不正确的行为,并且如果 +// 重新生成代码,这些更改将会丢失。 +// +//------------------------------------------------------------------------------ + +// +// 此源代码是由 Microsoft.VSDesigner 4.0.30319.42000 版自动生成。 +// +#pragma warning disable 1591 + +namespace CK.SCP.Controller.BomList { + using System; + using System.Web.Services; + using System.Diagnostics; + using System.Web.Services.Protocols; + using System.Xml.Serialization; + using System.ComponentModel; + + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name="JsonServiceSoap", Namespace="http://tempuri.org/")] + public partial class JsonService : System.Web.Services.Protocols.SoapHttpClientProtocol { + + private System.Threading.SendOrPostCallback GetVerOperationCompleted; + + private System.Threading.SendOrPostCallback WriteLogOperationCompleted; + + private System.Threading.SendOrPostCallback LoginOperationCompleted; + + private System.Threading.SendOrPostCallback NewLoginOperationCompleted; + + private System.Threading.SendOrPostCallback LogoutOperationCompleted; + + private System.Threading.SendOrPostCallback ModifyPasswordOperationCompleted; + + private System.Threading.SendOrPostCallback GetServerTimeOperationCompleted; + + private System.Threading.SendOrPostCallback DecryptOperationCompleted; + + private System.Threading.SendOrPostCallback EncryptOperationCompleted; + + private System.Threading.SendOrPostCallback GetCountOperationCompleted; + + private System.Threading.SendOrPostCallback GetDataOperationCompleted; + + private System.Threading.SendOrPostCallback AddDataOperationCompleted; + + private System.Threading.SendOrPostCallback GetBomVersionOperationCompleted; + + private System.Threading.SendOrPostCallback GetBomsByVerOperationCompleted; + + private System.Threading.SendOrPostCallback GetBomOperationCompleted; + + private System.Threading.SendOrPostCallback UpdateDataOperationCompleted; + + private System.Threading.SendOrPostCallback SaveSeqencingOperationCompleted; + + private System.Threading.SendOrPostCallback AddMutualDataOperationCompleted; + + private System.Threading.SendOrPostCallback ReceiveProductsOperationCompleted; + + private System.Threading.SendOrPostCallback ContainerReceiveOperationCompleted; + + private System.Threading.SendOrPostCallback ContainerOutOperationCompleted; + + private System.Threading.SendOrPostCallback CheckComesbackOperationCompleted; + + private System.Threading.SendOrPostCallback CreateBillMAOperationCompleted; + + private System.Threading.SendOrPostCallback AddMesFGFinOperationCompleted; + + private System.Threading.SendOrPostCallback UpdateBillStateOperationCompleted; + + private bool useDefaultCredentialsSetExplicitly; + + /// + public JsonService() { + this.Url = global::CK.SCP.Controller.Properties.Settings.Default.CK_SCP_Controller_BomList_JsonService; + if ((this.IsLocalFileSystemWebService(this.Url) == true)) { + this.UseDefaultCredentials = true; + this.useDefaultCredentialsSetExplicitly = false; + } + else { + this.useDefaultCredentialsSetExplicitly = true; + } + } + + public new string Url { + get { + return base.Url; + } + set { + if ((((this.IsLocalFileSystemWebService(base.Url) == true) + && (this.useDefaultCredentialsSetExplicitly == false)) + && (this.IsLocalFileSystemWebService(value) == false))) { + base.UseDefaultCredentials = false; + } + base.Url = value; + } + } + + public new bool UseDefaultCredentials { + get { + return base.UseDefaultCredentials; + } + set { + base.UseDefaultCredentials = value; + this.useDefaultCredentialsSetExplicitly = true; + } + } + + /// + public event GetVerCompletedEventHandler GetVerCompleted; + + /// + public event WriteLogCompletedEventHandler WriteLogCompleted; + + /// + public event LoginCompletedEventHandler LoginCompleted; + + /// + public event NewLoginCompletedEventHandler NewLoginCompleted; + + /// + public event LogoutCompletedEventHandler LogoutCompleted; + + /// + public event ModifyPasswordCompletedEventHandler ModifyPasswordCompleted; + + /// + public event GetServerTimeCompletedEventHandler GetServerTimeCompleted; + + /// + public event DecryptCompletedEventHandler DecryptCompleted; + + /// + public event EncryptCompletedEventHandler EncryptCompleted; + + /// + public event GetCountCompletedEventHandler GetCountCompleted; + + /// + public event GetDataCompletedEventHandler GetDataCompleted; + + /// + public event AddDataCompletedEventHandler AddDataCompleted; + + /// + public event GetBomVersionCompletedEventHandler GetBomVersionCompleted; + + /// + public event GetBomsByVerCompletedEventHandler GetBomsByVerCompleted; + + /// + public event GetBomCompletedEventHandler GetBomCompleted; + + /// + public event UpdateDataCompletedEventHandler UpdateDataCompleted; + + /// + public event SaveSeqencingCompletedEventHandler SaveSeqencingCompleted; + + /// + public event AddMutualDataCompletedEventHandler AddMutualDataCompleted; + + /// + public event ReceiveProductsCompletedEventHandler ReceiveProductsCompleted; + + /// + public event ContainerReceiveCompletedEventHandler ContainerReceiveCompleted; + + /// + public event ContainerOutCompletedEventHandler ContainerOutCompleted; + + /// + public event CheckComesbackCompletedEventHandler CheckComesbackCompleted; + + /// + public event CreateBillMACompletedEventHandler CreateBillMACompleted; + + /// + public event AddMesFGFinCompletedEventHandler AddMesFGFinCompleted; + + /// + public event UpdateBillStateCompletedEventHandler UpdateBillStateCompleted; + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/GetVer", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public string GetVer() { + object[] results = this.Invoke("GetVer", new object[0]); + return ((string)(results[0])); + } + + /// + public void GetVerAsync() { + this.GetVerAsync(null); + } + + /// + public void GetVerAsync(object userState) { + if ((this.GetVerOperationCompleted == null)) { + this.GetVerOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetVerOperationCompleted); + } + this.InvokeAsync("GetVer", new object[0], this.GetVerOperationCompleted, userState); + } + + private void OnGetVerOperationCompleted(object arg) { + if ((this.GetVerCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.GetVerCompleted(this, new GetVerCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/WriteLog", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public string WriteLog(string operCode, string function, string message) { + object[] results = this.Invoke("WriteLog", new object[] { + operCode, + function, + message}); + return ((string)(results[0])); + } + + /// + public void WriteLogAsync(string operCode, string function, string message) { + this.WriteLogAsync(operCode, function, message, null); + } + + /// + public void WriteLogAsync(string operCode, string function, string message, object userState) { + if ((this.WriteLogOperationCompleted == null)) { + this.WriteLogOperationCompleted = new System.Threading.SendOrPostCallback(this.OnWriteLogOperationCompleted); + } + this.InvokeAsync("WriteLog", new object[] { + operCode, + function, + message}, this.WriteLogOperationCompleted, userState); + } + + private void OnWriteLogOperationCompleted(object arg) { + if ((this.WriteLogCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.WriteLogCompleted(this, new WriteLogCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/Login", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public string Login(string operCode, string password) { + object[] results = this.Invoke("Login", new object[] { + operCode, + password}); + return ((string)(results[0])); + } + + /// + public void LoginAsync(string operCode, string password) { + this.LoginAsync(operCode, password, null); + } + + /// + public void LoginAsync(string operCode, string password, object userState) { + if ((this.LoginOperationCompleted == null)) { + this.LoginOperationCompleted = new System.Threading.SendOrPostCallback(this.OnLoginOperationCompleted); + } + this.InvokeAsync("Login", new object[] { + operCode, + password}, this.LoginOperationCompleted, userState); + } + + private void OnLoginOperationCompleted(object arg) { + if ((this.LoginCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.LoginCompleted(this, new LoginCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/NewLogin", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public string NewLogin(string operCode, string password) { + object[] results = this.Invoke("NewLogin", new object[] { + operCode, + password}); + return ((string)(results[0])); + } + + /// + public void NewLoginAsync(string operCode, string password) { + this.NewLoginAsync(operCode, password, null); + } + + /// + public void NewLoginAsync(string operCode, string password, object userState) { + if ((this.NewLoginOperationCompleted == null)) { + this.NewLoginOperationCompleted = new System.Threading.SendOrPostCallback(this.OnNewLoginOperationCompleted); + } + this.InvokeAsync("NewLogin", new object[] { + operCode, + password}, this.NewLoginOperationCompleted, userState); + } + + private void OnNewLoginOperationCompleted(object arg) { + if ((this.NewLoginCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.NewLoginCompleted(this, new NewLoginCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/Logout", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public string Logout(string operCode) { + object[] results = this.Invoke("Logout", new object[] { + operCode}); + return ((string)(results[0])); + } + + /// + public void LogoutAsync(string operCode) { + this.LogoutAsync(operCode, null); + } + + /// + public void LogoutAsync(string operCode, object userState) { + if ((this.LogoutOperationCompleted == null)) { + this.LogoutOperationCompleted = new System.Threading.SendOrPostCallback(this.OnLogoutOperationCompleted); + } + this.InvokeAsync("Logout", new object[] { + operCode}, this.LogoutOperationCompleted, userState); + } + + private void OnLogoutOperationCompleted(object arg) { + if ((this.LogoutCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.LogoutCompleted(this, new LogoutCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/ModifyPassword", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public string ModifyPassword(string operCode, string oldPass, string newPass) { + object[] results = this.Invoke("ModifyPassword", new object[] { + operCode, + oldPass, + newPass}); + return ((string)(results[0])); + } + + /// + public void ModifyPasswordAsync(string operCode, string oldPass, string newPass) { + this.ModifyPasswordAsync(operCode, oldPass, newPass, null); + } + + /// + public void ModifyPasswordAsync(string operCode, string oldPass, string newPass, object userState) { + if ((this.ModifyPasswordOperationCompleted == null)) { + this.ModifyPasswordOperationCompleted = new System.Threading.SendOrPostCallback(this.OnModifyPasswordOperationCompleted); + } + this.InvokeAsync("ModifyPassword", new object[] { + operCode, + oldPass, + newPass}, this.ModifyPasswordOperationCompleted, userState); + } + + private void OnModifyPasswordOperationCompleted(object arg) { + if ((this.ModifyPasswordCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.ModifyPasswordCompleted(this, new ModifyPasswordCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/GetServerTime", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public System.DateTime GetServerTime() { + object[] results = this.Invoke("GetServerTime", new object[0]); + return ((System.DateTime)(results[0])); + } + + /// + public void GetServerTimeAsync() { + this.GetServerTimeAsync(null); + } + + /// + public void GetServerTimeAsync(object userState) { + if ((this.GetServerTimeOperationCompleted == null)) { + this.GetServerTimeOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetServerTimeOperationCompleted); + } + this.InvokeAsync("GetServerTime", new object[0], this.GetServerTimeOperationCompleted, userState); + } + + private void OnGetServerTimeOperationCompleted(object arg) { + if ((this.GetServerTimeCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.GetServerTimeCompleted(this, new GetServerTimeCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/Decrypt", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public string Decrypt(string str) { + object[] results = this.Invoke("Decrypt", new object[] { + str}); + return ((string)(results[0])); + } + + /// + public void DecryptAsync(string str) { + this.DecryptAsync(str, null); + } + + /// + public void DecryptAsync(string str, object userState) { + if ((this.DecryptOperationCompleted == null)) { + this.DecryptOperationCompleted = new System.Threading.SendOrPostCallback(this.OnDecryptOperationCompleted); + } + this.InvokeAsync("Decrypt", new object[] { + str}, this.DecryptOperationCompleted, userState); + } + + private void OnDecryptOperationCompleted(object arg) { + if ((this.DecryptCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.DecryptCompleted(this, new DecryptCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/Encrypt", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public string Encrypt(string str) { + object[] results = this.Invoke("Encrypt", new object[] { + str}); + return ((string)(results[0])); + } + + /// + public void EncryptAsync(string str) { + this.EncryptAsync(str, null); + } + + /// + public void EncryptAsync(string str, object userState) { + if ((this.EncryptOperationCompleted == null)) { + this.EncryptOperationCompleted = new System.Threading.SendOrPostCallback(this.OnEncryptOperationCompleted); + } + this.InvokeAsync("Encrypt", new object[] { + str}, this.EncryptOperationCompleted, userState); + } + + private void OnEncryptOperationCompleted(object arg) { + if ((this.EncryptCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.EncryptCompleted(this, new EncryptCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/GetCount", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public int GetCount(string jsonParam) { + object[] results = this.Invoke("GetCount", new object[] { + jsonParam}); + return ((int)(results[0])); + } + + /// + public void GetCountAsync(string jsonParam) { + this.GetCountAsync(jsonParam, null); + } + + /// + public void GetCountAsync(string jsonParam, object userState) { + if ((this.GetCountOperationCompleted == null)) { + this.GetCountOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetCountOperationCompleted); + } + this.InvokeAsync("GetCount", new object[] { + jsonParam}, this.GetCountOperationCompleted, userState); + } + + private void OnGetCountOperationCompleted(object arg) { + if ((this.GetCountCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.GetCountCompleted(this, new GetCountCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/GetData", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public string GetData(string jsonParam) { + object[] results = this.Invoke("GetData", new object[] { + jsonParam}); + return ((string)(results[0])); + } + + /// + public void GetDataAsync(string jsonParam) { + this.GetDataAsync(jsonParam, null); + } + + /// + public void GetDataAsync(string jsonParam, object userState) { + if ((this.GetDataOperationCompleted == null)) { + this.GetDataOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetDataOperationCompleted); + } + this.InvokeAsync("GetData", new object[] { + jsonParam}, this.GetDataOperationCompleted, userState); + } + + private void OnGetDataOperationCompleted(object arg) { + if ((this.GetDataCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.GetDataCompleted(this, new GetDataCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/AddData", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public string AddData(string jsonParam, string strJson) { + object[] results = this.Invoke("AddData", new object[] { + jsonParam, + strJson}); + return ((string)(results[0])); + } + + /// + public void AddDataAsync(string jsonParam, string strJson) { + this.AddDataAsync(jsonParam, strJson, null); + } + + /// + public void AddDataAsync(string jsonParam, string strJson, object userState) { + if ((this.AddDataOperationCompleted == null)) { + this.AddDataOperationCompleted = new System.Threading.SendOrPostCallback(this.OnAddDataOperationCompleted); + } + this.InvokeAsync("AddData", new object[] { + jsonParam, + strJson}, this.AddDataOperationCompleted, userState); + } + + private void OnAddDataOperationCompleted(object arg) { + if ((this.AddDataCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.AddDataCompleted(this, new AddDataCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/GetBomVersion", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public string GetBomVersion(string ParentPartCode, string SubPartCode) { + object[] results = this.Invoke("GetBomVersion", new object[] { + ParentPartCode, + SubPartCode}); + return ((string)(results[0])); + } + + /// + public void GetBomVersionAsync(string ParentPartCode, string SubPartCode) { + this.GetBomVersionAsync(ParentPartCode, SubPartCode, null); + } + + /// + public void GetBomVersionAsync(string ParentPartCode, string SubPartCode, object userState) { + if ((this.GetBomVersionOperationCompleted == null)) { + this.GetBomVersionOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetBomVersionOperationCompleted); + } + this.InvokeAsync("GetBomVersion", new object[] { + ParentPartCode, + SubPartCode}, this.GetBomVersionOperationCompleted, userState); + } + + private void OnGetBomVersionOperationCompleted(object arg) { + if ((this.GetBomVersionCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.GetBomVersionCompleted(this, new GetBomVersionCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/GetBomsByVer", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public string GetBomsByVer(string parentPart, string bomVer) { + object[] results = this.Invoke("GetBomsByVer", new object[] { + parentPart, + bomVer}); + return ((string)(results[0])); + } + + /// + public void GetBomsByVerAsync(string parentPart, string bomVer) { + this.GetBomsByVerAsync(parentPart, bomVer, null); + } + + /// + public void GetBomsByVerAsync(string parentPart, string bomVer, object userState) { + if ((this.GetBomsByVerOperationCompleted == null)) { + this.GetBomsByVerOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetBomsByVerOperationCompleted); + } + this.InvokeAsync("GetBomsByVer", new object[] { + parentPart, + bomVer}, this.GetBomsByVerOperationCompleted, userState); + } + + private void OnGetBomsByVerOperationCompleted(object arg) { + if ((this.GetBomsByVerCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.GetBomsByVerCompleted(this, new GetBomsByVerCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/GetBom", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public string GetBom(string pcode, string scode) { + object[] results = this.Invoke("GetBom", new object[] { + pcode, + scode}); + return ((string)(results[0])); + } + + /// + public void GetBomAsync(string pcode, string scode) { + this.GetBomAsync(pcode, scode, null); + } + + /// + public void GetBomAsync(string pcode, string scode, object userState) { + if ((this.GetBomOperationCompleted == null)) { + this.GetBomOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetBomOperationCompleted); + } + this.InvokeAsync("GetBom", new object[] { + pcode, + scode}, this.GetBomOperationCompleted, userState); + } + + private void OnGetBomOperationCompleted(object arg) { + if ((this.GetBomCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.GetBomCompleted(this, new GetBomCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/UpdateData", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public string UpdateData(string jsonParam, string strJson) { + object[] results = this.Invoke("UpdateData", new object[] { + jsonParam, + strJson}); + return ((string)(results[0])); + } + + /// + public void UpdateDataAsync(string jsonParam, string strJson) { + this.UpdateDataAsync(jsonParam, strJson, null); + } + + /// + public void UpdateDataAsync(string jsonParam, string strJson, object userState) { + if ((this.UpdateDataOperationCompleted == null)) { + this.UpdateDataOperationCompleted = new System.Threading.SendOrPostCallback(this.OnUpdateDataOperationCompleted); + } + this.InvokeAsync("UpdateData", new object[] { + jsonParam, + strJson}, this.UpdateDataOperationCompleted, userState); + } + + private void OnUpdateDataOperationCompleted(object arg) { + if ((this.UpdateDataCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.UpdateDataCompleted(this, new UpdateDataCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/SaveSeqencing", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public string SaveSeqencing(string strJson) { + object[] results = this.Invoke("SaveSeqencing", new object[] { + strJson}); + return ((string)(results[0])); + } + + /// + public void SaveSeqencingAsync(string strJson) { + this.SaveSeqencingAsync(strJson, null); + } + + /// + public void SaveSeqencingAsync(string strJson, object userState) { + if ((this.SaveSeqencingOperationCompleted == null)) { + this.SaveSeqencingOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSaveSeqencingOperationCompleted); + } + this.InvokeAsync("SaveSeqencing", new object[] { + strJson}, this.SaveSeqencingOperationCompleted, userState); + } + + private void OnSaveSeqencingOperationCompleted(object arg) { + if ((this.SaveSeqencingCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.SaveSeqencingCompleted(this, new SaveSeqencingCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/AddMutualData", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public string AddMutualData(string jsonParam, string strJson) { + object[] results = this.Invoke("AddMutualData", new object[] { + jsonParam, + strJson}); + return ((string)(results[0])); + } + + /// + public void AddMutualDataAsync(string jsonParam, string strJson) { + this.AddMutualDataAsync(jsonParam, strJson, null); + } + + /// + public void AddMutualDataAsync(string jsonParam, string strJson, object userState) { + if ((this.AddMutualDataOperationCompleted == null)) { + this.AddMutualDataOperationCompleted = new System.Threading.SendOrPostCallback(this.OnAddMutualDataOperationCompleted); + } + this.InvokeAsync("AddMutualData", new object[] { + jsonParam, + strJson}, this.AddMutualDataOperationCompleted, userState); + } + + private void OnAddMutualDataOperationCompleted(object arg) { + if ((this.AddMutualDataCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.AddMutualDataCompleted(this, new AddMutualDataCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/ReceiveProducts", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public string ReceiveProducts(string jsonParam) { + object[] results = this.Invoke("ReceiveProducts", new object[] { + jsonParam}); + return ((string)(results[0])); + } + + /// + public void ReceiveProductsAsync(string jsonParam) { + this.ReceiveProductsAsync(jsonParam, null); + } + + /// + public void ReceiveProductsAsync(string jsonParam, object userState) { + if ((this.ReceiveProductsOperationCompleted == null)) { + this.ReceiveProductsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnReceiveProductsOperationCompleted); + } + this.InvokeAsync("ReceiveProducts", new object[] { + jsonParam}, this.ReceiveProductsOperationCompleted, userState); + } + + private void OnReceiveProductsOperationCompleted(object arg) { + if ((this.ReceiveProductsCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.ReceiveProductsCompleted(this, new ReceiveProductsCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/ContainerReceive", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public string ContainerReceive(string strJson) { + object[] results = this.Invoke("ContainerReceive", new object[] { + strJson}); + return ((string)(results[0])); + } + + /// + public void ContainerReceiveAsync(string strJson) { + this.ContainerReceiveAsync(strJson, null); + } + + /// + public void ContainerReceiveAsync(string strJson, object userState) { + if ((this.ContainerReceiveOperationCompleted == null)) { + this.ContainerReceiveOperationCompleted = new System.Threading.SendOrPostCallback(this.OnContainerReceiveOperationCompleted); + } + this.InvokeAsync("ContainerReceive", new object[] { + strJson}, this.ContainerReceiveOperationCompleted, userState); + } + + private void OnContainerReceiveOperationCompleted(object arg) { + if ((this.ContainerReceiveCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.ContainerReceiveCompleted(this, new ContainerReceiveCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/ContainerOut", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public string ContainerOut(string strJson) { + object[] results = this.Invoke("ContainerOut", new object[] { + strJson}); + return ((string)(results[0])); + } + + /// + public void ContainerOutAsync(string strJson) { + this.ContainerOutAsync(strJson, null); + } + + /// + public void ContainerOutAsync(string strJson, object userState) { + if ((this.ContainerOutOperationCompleted == null)) { + this.ContainerOutOperationCompleted = new System.Threading.SendOrPostCallback(this.OnContainerOutOperationCompleted); + } + this.InvokeAsync("ContainerOut", new object[] { + strJson}, this.ContainerOutOperationCompleted, userState); + } + + private void OnContainerOutOperationCompleted(object arg) { + if ((this.ContainerOutCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.ContainerOutCompleted(this, new ContainerOutCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/CheckComesback", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public string CheckComesback(string strJson) { + object[] results = this.Invoke("CheckComesback", new object[] { + strJson}); + return ((string)(results[0])); + } + + /// + public void CheckComesbackAsync(string strJson) { + this.CheckComesbackAsync(strJson, null); + } + + /// + public void CheckComesbackAsync(string strJson, object userState) { + if ((this.CheckComesbackOperationCompleted == null)) { + this.CheckComesbackOperationCompleted = new System.Threading.SendOrPostCallback(this.OnCheckComesbackOperationCompleted); + } + this.InvokeAsync("CheckComesback", new object[] { + strJson}, this.CheckComesbackOperationCompleted, userState); + } + + private void OnCheckComesbackOperationCompleted(object arg) { + if ((this.CheckComesbackCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.CheckComesbackCompleted(this, new CheckComesbackCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/CreateBillMA", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public string CreateBillMA(string strJson) { + object[] results = this.Invoke("CreateBillMA", new object[] { + strJson}); + return ((string)(results[0])); + } + + /// + public void CreateBillMAAsync(string strJson) { + this.CreateBillMAAsync(strJson, null); + } + + /// + public void CreateBillMAAsync(string strJson, object userState) { + if ((this.CreateBillMAOperationCompleted == null)) { + this.CreateBillMAOperationCompleted = new System.Threading.SendOrPostCallback(this.OnCreateBillMAOperationCompleted); + } + this.InvokeAsync("CreateBillMA", new object[] { + strJson}, this.CreateBillMAOperationCompleted, userState); + } + + private void OnCreateBillMAOperationCompleted(object arg) { + if ((this.CreateBillMACompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.CreateBillMACompleted(this, new CreateBillMACompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/AddMesFGFin", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public string AddMesFGFin(string strJson) { + object[] results = this.Invoke("AddMesFGFin", new object[] { + strJson}); + return ((string)(results[0])); + } + + /// + public void AddMesFGFinAsync(string strJson) { + this.AddMesFGFinAsync(strJson, null); + } + + /// + public void AddMesFGFinAsync(string strJson, object userState) { + if ((this.AddMesFGFinOperationCompleted == null)) { + this.AddMesFGFinOperationCompleted = new System.Threading.SendOrPostCallback(this.OnAddMesFGFinOperationCompleted); + } + this.InvokeAsync("AddMesFGFin", new object[] { + strJson}, this.AddMesFGFinOperationCompleted, userState); + } + + private void OnAddMesFGFinOperationCompleted(object arg) { + if ((this.AddMesFGFinCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.AddMesFGFinCompleted(this, new AddMesFGFinCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/UpdateBillState", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public string UpdateBillState(string strJson) { + object[] results = this.Invoke("UpdateBillState", new object[] { + strJson}); + return ((string)(results[0])); + } + + /// + public void UpdateBillStateAsync(string strJson) { + this.UpdateBillStateAsync(strJson, null); + } + + /// + public void UpdateBillStateAsync(string strJson, object userState) { + if ((this.UpdateBillStateOperationCompleted == null)) { + this.UpdateBillStateOperationCompleted = new System.Threading.SendOrPostCallback(this.OnUpdateBillStateOperationCompleted); + } + this.InvokeAsync("UpdateBillState", new object[] { + strJson}, this.UpdateBillStateOperationCompleted, userState); + } + + private void OnUpdateBillStateOperationCompleted(object arg) { + if ((this.UpdateBillStateCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.UpdateBillStateCompleted(this, new UpdateBillStateCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + public new void CancelAsync(object userState) { + base.CancelAsync(userState); + } + + private bool IsLocalFileSystemWebService(string url) { + if (((url == null) + || (url == string.Empty))) { + return false; + } + System.Uri wsUri = new System.Uri(url); + if (((wsUri.Port >= 1024) + && (string.Compare(wsUri.Host, "localHost", System.StringComparison.OrdinalIgnoreCase) == 0))) { + return true; + } + return false; + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + public delegate void GetVerCompletedEventHandler(object sender, GetVerCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class GetVerCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal GetVerCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public string Result { + get { + this.RaiseExceptionIfNecessary(); + return ((string)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + public delegate void WriteLogCompletedEventHandler(object sender, WriteLogCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class WriteLogCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal WriteLogCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public string Result { + get { + this.RaiseExceptionIfNecessary(); + return ((string)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + public delegate void LoginCompletedEventHandler(object sender, LoginCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class LoginCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal LoginCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public string Result { + get { + this.RaiseExceptionIfNecessary(); + return ((string)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + public delegate void NewLoginCompletedEventHandler(object sender, NewLoginCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class NewLoginCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal NewLoginCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public string Result { + get { + this.RaiseExceptionIfNecessary(); + return ((string)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + public delegate void LogoutCompletedEventHandler(object sender, LogoutCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class LogoutCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal LogoutCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public string Result { + get { + this.RaiseExceptionIfNecessary(); + return ((string)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + public delegate void ModifyPasswordCompletedEventHandler(object sender, ModifyPasswordCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class ModifyPasswordCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal ModifyPasswordCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public string Result { + get { + this.RaiseExceptionIfNecessary(); + return ((string)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + public delegate void GetServerTimeCompletedEventHandler(object sender, GetServerTimeCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class GetServerTimeCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal GetServerTimeCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public System.DateTime Result { + get { + this.RaiseExceptionIfNecessary(); + return ((System.DateTime)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + public delegate void DecryptCompletedEventHandler(object sender, DecryptCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class DecryptCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal DecryptCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public string Result { + get { + this.RaiseExceptionIfNecessary(); + return ((string)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + public delegate void EncryptCompletedEventHandler(object sender, EncryptCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class EncryptCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal EncryptCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public string Result { + get { + this.RaiseExceptionIfNecessary(); + return ((string)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + public delegate void GetCountCompletedEventHandler(object sender, GetCountCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class GetCountCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal GetCountCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public int Result { + get { + this.RaiseExceptionIfNecessary(); + return ((int)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + public delegate void GetDataCompletedEventHandler(object sender, GetDataCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class GetDataCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal GetDataCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public string Result { + get { + this.RaiseExceptionIfNecessary(); + return ((string)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + public delegate void AddDataCompletedEventHandler(object sender, AddDataCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class AddDataCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal AddDataCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public string Result { + get { + this.RaiseExceptionIfNecessary(); + return ((string)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + public delegate void GetBomVersionCompletedEventHandler(object sender, GetBomVersionCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class GetBomVersionCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal GetBomVersionCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public string Result { + get { + this.RaiseExceptionIfNecessary(); + return ((string)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + public delegate void GetBomsByVerCompletedEventHandler(object sender, GetBomsByVerCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class GetBomsByVerCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal GetBomsByVerCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public string Result { + get { + this.RaiseExceptionIfNecessary(); + return ((string)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + public delegate void GetBomCompletedEventHandler(object sender, GetBomCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class GetBomCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal GetBomCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public string Result { + get { + this.RaiseExceptionIfNecessary(); + return ((string)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + public delegate void UpdateDataCompletedEventHandler(object sender, UpdateDataCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class UpdateDataCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal UpdateDataCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public string Result { + get { + this.RaiseExceptionIfNecessary(); + return ((string)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + public delegate void SaveSeqencingCompletedEventHandler(object sender, SaveSeqencingCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class SaveSeqencingCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal SaveSeqencingCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public string Result { + get { + this.RaiseExceptionIfNecessary(); + return ((string)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + public delegate void AddMutualDataCompletedEventHandler(object sender, AddMutualDataCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class AddMutualDataCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal AddMutualDataCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public string Result { + get { + this.RaiseExceptionIfNecessary(); + return ((string)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + public delegate void ReceiveProductsCompletedEventHandler(object sender, ReceiveProductsCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class ReceiveProductsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal ReceiveProductsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public string Result { + get { + this.RaiseExceptionIfNecessary(); + return ((string)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + public delegate void ContainerReceiveCompletedEventHandler(object sender, ContainerReceiveCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class ContainerReceiveCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal ContainerReceiveCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public string Result { + get { + this.RaiseExceptionIfNecessary(); + return ((string)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + public delegate void ContainerOutCompletedEventHandler(object sender, ContainerOutCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class ContainerOutCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal ContainerOutCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public string Result { + get { + this.RaiseExceptionIfNecessary(); + return ((string)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + public delegate void CheckComesbackCompletedEventHandler(object sender, CheckComesbackCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class CheckComesbackCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal CheckComesbackCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public string Result { + get { + this.RaiseExceptionIfNecessary(); + return ((string)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + public delegate void CreateBillMACompletedEventHandler(object sender, CreateBillMACompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class CreateBillMACompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal CreateBillMACompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public string Result { + get { + this.RaiseExceptionIfNecessary(); + return ((string)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + public delegate void AddMesFGFinCompletedEventHandler(object sender, AddMesFGFinCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class AddMesFGFinCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal AddMesFGFinCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public string Result { + get { + this.RaiseExceptionIfNecessary(); + return ((string)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + public delegate void UpdateBillStateCompletedEventHandler(object sender, UpdateBillStateCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class UpdateBillStateCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal UpdateBillStateCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public string Result { + get { + this.RaiseExceptionIfNecessary(); + return ((string)(this.results[0])); + } + } + } +} + +#pragma warning restore 1591 \ No newline at end of file diff --git a/Controller/Web References/BomList/Reference.map b/Controller/Web References/BomList/Reference.map new file mode 100644 index 0000000..fc9fb38 --- /dev/null +++ b/Controller/Web References/BomList/Reference.map @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/Controller/Web References/BomList1/JsonService.disco b/Controller/Web References/BomList1/JsonService.disco new file mode 100644 index 0000000..b7c36dc --- /dev/null +++ b/Controller/Web References/BomList1/JsonService.disco @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/Controller/Web References/BomList1/JsonService.wsdl b/Controller/Web References/BomList1/JsonService.wsdl new file mode 100644 index 0000000..91b67eb --- /dev/null +++ b/Controller/Web References/BomList1/JsonService.wsdl @@ -0,0 +1,2062 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Controller/Web References/BomList1/Reference.cs b/Controller/Web References/BomList1/Reference.cs new file mode 100644 index 0000000..0c740ab --- /dev/null +++ b/Controller/Web References/BomList1/Reference.cs @@ -0,0 +1,1610 @@ +//------------------------------------------------------------------------------ +// +// 此代码由工具生成。 +// 运行时版本:4.0.30319.42000 +// +// 对此文件的更改可能会导致不正确的行为,并且如果 +// 重新生成代码,这些更改将会丢失。 +// +//------------------------------------------------------------------------------ + +// +// 此源代码是由 Microsoft.VSDesigner 4.0.30319.42000 版自动生成。 +// +#pragma warning disable 1591 + +namespace CK.SCP.Controller.BomList1 { + using System; + using System.Web.Services; + using System.Diagnostics; + using System.Web.Services.Protocols; + using System.Xml.Serialization; + using System.ComponentModel; + + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name="JsonServiceSoap", Namespace="http://tempuri.org/")] + public partial class JsonService : System.Web.Services.Protocols.SoapHttpClientProtocol { + + private System.Threading.SendOrPostCallback GetVerOperationCompleted; + + private System.Threading.SendOrPostCallback WriteLogOperationCompleted; + + private System.Threading.SendOrPostCallback LoginOperationCompleted; + + private System.Threading.SendOrPostCallback NewLoginOperationCompleted; + + private System.Threading.SendOrPostCallback LogoutOperationCompleted; + + private System.Threading.SendOrPostCallback ModifyPasswordOperationCompleted; + + private System.Threading.SendOrPostCallback GetServerTimeOperationCompleted; + + private System.Threading.SendOrPostCallback DecryptOperationCompleted; + + private System.Threading.SendOrPostCallback EncryptOperationCompleted; + + private System.Threading.SendOrPostCallback GetCountOperationCompleted; + + private System.Threading.SendOrPostCallback GetDataOperationCompleted; + + private System.Threading.SendOrPostCallback AddDataOperationCompleted; + + private System.Threading.SendOrPostCallback GetBomVersionOperationCompleted; + + private System.Threading.SendOrPostCallback GetBomsByVerOperationCompleted; + + private System.Threading.SendOrPostCallback GetBomOperationCompleted; + + private System.Threading.SendOrPostCallback UpdateDataOperationCompleted; + + private System.Threading.SendOrPostCallback SaveSeqencingOperationCompleted; + + private System.Threading.SendOrPostCallback AddMutualDataOperationCompleted; + + private System.Threading.SendOrPostCallback ReceiveProductsOperationCompleted; + + private System.Threading.SendOrPostCallback ContainerReceiveOperationCompleted; + + private System.Threading.SendOrPostCallback ContainerOutOperationCompleted; + + private System.Threading.SendOrPostCallback CheckComesbackOperationCompleted; + + private System.Threading.SendOrPostCallback CreateBillMAOperationCompleted; + + private System.Threading.SendOrPostCallback AddMesFGFinOperationCompleted; + + private System.Threading.SendOrPostCallback UpdateBillStateOperationCompleted; + + private bool useDefaultCredentialsSetExplicitly; + + /// + public JsonService() { + this.Url = global::CK.SCP.Controller.Properties.Settings.Default.CK_SCP_Controller_BomList1_JsonService; + if ((this.IsLocalFileSystemWebService(this.Url) == true)) { + this.UseDefaultCredentials = true; + this.useDefaultCredentialsSetExplicitly = false; + } + else { + this.useDefaultCredentialsSetExplicitly = true; + } + } + + public new string Url { + get { + return base.Url; + } + set { + if ((((this.IsLocalFileSystemWebService(base.Url) == true) + && (this.useDefaultCredentialsSetExplicitly == false)) + && (this.IsLocalFileSystemWebService(value) == false))) { + base.UseDefaultCredentials = false; + } + base.Url = value; + } + } + + public new bool UseDefaultCredentials { + get { + return base.UseDefaultCredentials; + } + set { + base.UseDefaultCredentials = value; + this.useDefaultCredentialsSetExplicitly = true; + } + } + + /// + public event GetVerCompletedEventHandler GetVerCompleted; + + /// + public event WriteLogCompletedEventHandler WriteLogCompleted; + + /// + public event LoginCompletedEventHandler LoginCompleted; + + /// + public event NewLoginCompletedEventHandler NewLoginCompleted; + + /// + public event LogoutCompletedEventHandler LogoutCompleted; + + /// + public event ModifyPasswordCompletedEventHandler ModifyPasswordCompleted; + + /// + public event GetServerTimeCompletedEventHandler GetServerTimeCompleted; + + /// + public event DecryptCompletedEventHandler DecryptCompleted; + + /// + public event EncryptCompletedEventHandler EncryptCompleted; + + /// + public event GetCountCompletedEventHandler GetCountCompleted; + + /// + public event GetDataCompletedEventHandler GetDataCompleted; + + /// + public event AddDataCompletedEventHandler AddDataCompleted; + + /// + public event GetBomVersionCompletedEventHandler GetBomVersionCompleted; + + /// + public event GetBomsByVerCompletedEventHandler GetBomsByVerCompleted; + + /// + public event GetBomCompletedEventHandler GetBomCompleted; + + /// + public event UpdateDataCompletedEventHandler UpdateDataCompleted; + + /// + public event SaveSeqencingCompletedEventHandler SaveSeqencingCompleted; + + /// + public event AddMutualDataCompletedEventHandler AddMutualDataCompleted; + + /// + public event ReceiveProductsCompletedEventHandler ReceiveProductsCompleted; + + /// + public event ContainerReceiveCompletedEventHandler ContainerReceiveCompleted; + + /// + public event ContainerOutCompletedEventHandler ContainerOutCompleted; + + /// + public event CheckComesbackCompletedEventHandler CheckComesbackCompleted; + + /// + public event CreateBillMACompletedEventHandler CreateBillMACompleted; + + /// + public event AddMesFGFinCompletedEventHandler AddMesFGFinCompleted; + + /// + public event UpdateBillStateCompletedEventHandler UpdateBillStateCompleted; + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/GetVer", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public string GetVer() { + object[] results = this.Invoke("GetVer", new object[0]); + return ((string)(results[0])); + } + + /// + public void GetVerAsync() { + this.GetVerAsync(null); + } + + /// + public void GetVerAsync(object userState) { + if ((this.GetVerOperationCompleted == null)) { + this.GetVerOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetVerOperationCompleted); + } + this.InvokeAsync("GetVer", new object[0], this.GetVerOperationCompleted, userState); + } + + private void OnGetVerOperationCompleted(object arg) { + if ((this.GetVerCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.GetVerCompleted(this, new GetVerCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/WriteLog", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public string WriteLog(string operCode, string function, string message) { + object[] results = this.Invoke("WriteLog", new object[] { + operCode, + function, + message}); + return ((string)(results[0])); + } + + /// + public void WriteLogAsync(string operCode, string function, string message) { + this.WriteLogAsync(operCode, function, message, null); + } + + /// + public void WriteLogAsync(string operCode, string function, string message, object userState) { + if ((this.WriteLogOperationCompleted == null)) { + this.WriteLogOperationCompleted = new System.Threading.SendOrPostCallback(this.OnWriteLogOperationCompleted); + } + this.InvokeAsync("WriteLog", new object[] { + operCode, + function, + message}, this.WriteLogOperationCompleted, userState); + } + + private void OnWriteLogOperationCompleted(object arg) { + if ((this.WriteLogCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.WriteLogCompleted(this, new WriteLogCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/Login", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public string Login(string operCode, string password) { + object[] results = this.Invoke("Login", new object[] { + operCode, + password}); + return ((string)(results[0])); + } + + /// + public void LoginAsync(string operCode, string password) { + this.LoginAsync(operCode, password, null); + } + + /// + public void LoginAsync(string operCode, string password, object userState) { + if ((this.LoginOperationCompleted == null)) { + this.LoginOperationCompleted = new System.Threading.SendOrPostCallback(this.OnLoginOperationCompleted); + } + this.InvokeAsync("Login", new object[] { + operCode, + password}, this.LoginOperationCompleted, userState); + } + + private void OnLoginOperationCompleted(object arg) { + if ((this.LoginCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.LoginCompleted(this, new LoginCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/NewLogin", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public string NewLogin(string operCode, string password) { + object[] results = this.Invoke("NewLogin", new object[] { + operCode, + password}); + return ((string)(results[0])); + } + + /// + public void NewLoginAsync(string operCode, string password) { + this.NewLoginAsync(operCode, password, null); + } + + /// + public void NewLoginAsync(string operCode, string password, object userState) { + if ((this.NewLoginOperationCompleted == null)) { + this.NewLoginOperationCompleted = new System.Threading.SendOrPostCallback(this.OnNewLoginOperationCompleted); + } + this.InvokeAsync("NewLogin", new object[] { + operCode, + password}, this.NewLoginOperationCompleted, userState); + } + + private void OnNewLoginOperationCompleted(object arg) { + if ((this.NewLoginCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.NewLoginCompleted(this, new NewLoginCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/Logout", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public string Logout(string operCode) { + object[] results = this.Invoke("Logout", new object[] { + operCode}); + return ((string)(results[0])); + } + + /// + public void LogoutAsync(string operCode) { + this.LogoutAsync(operCode, null); + } + + /// + public void LogoutAsync(string operCode, object userState) { + if ((this.LogoutOperationCompleted == null)) { + this.LogoutOperationCompleted = new System.Threading.SendOrPostCallback(this.OnLogoutOperationCompleted); + } + this.InvokeAsync("Logout", new object[] { + operCode}, this.LogoutOperationCompleted, userState); + } + + private void OnLogoutOperationCompleted(object arg) { + if ((this.LogoutCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.LogoutCompleted(this, new LogoutCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/ModifyPassword", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public string ModifyPassword(string operCode, string oldPass, string newPass) { + object[] results = this.Invoke("ModifyPassword", new object[] { + operCode, + oldPass, + newPass}); + return ((string)(results[0])); + } + + /// + public void ModifyPasswordAsync(string operCode, string oldPass, string newPass) { + this.ModifyPasswordAsync(operCode, oldPass, newPass, null); + } + + /// + public void ModifyPasswordAsync(string operCode, string oldPass, string newPass, object userState) { + if ((this.ModifyPasswordOperationCompleted == null)) { + this.ModifyPasswordOperationCompleted = new System.Threading.SendOrPostCallback(this.OnModifyPasswordOperationCompleted); + } + this.InvokeAsync("ModifyPassword", new object[] { + operCode, + oldPass, + newPass}, this.ModifyPasswordOperationCompleted, userState); + } + + private void OnModifyPasswordOperationCompleted(object arg) { + if ((this.ModifyPasswordCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.ModifyPasswordCompleted(this, new ModifyPasswordCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/GetServerTime", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public System.DateTime GetServerTime() { + object[] results = this.Invoke("GetServerTime", new object[0]); + return ((System.DateTime)(results[0])); + } + + /// + public void GetServerTimeAsync() { + this.GetServerTimeAsync(null); + } + + /// + public void GetServerTimeAsync(object userState) { + if ((this.GetServerTimeOperationCompleted == null)) { + this.GetServerTimeOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetServerTimeOperationCompleted); + } + this.InvokeAsync("GetServerTime", new object[0], this.GetServerTimeOperationCompleted, userState); + } + + private void OnGetServerTimeOperationCompleted(object arg) { + if ((this.GetServerTimeCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.GetServerTimeCompleted(this, new GetServerTimeCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/Decrypt", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public string Decrypt(string str) { + object[] results = this.Invoke("Decrypt", new object[] { + str}); + return ((string)(results[0])); + } + + /// + public void DecryptAsync(string str) { + this.DecryptAsync(str, null); + } + + /// + public void DecryptAsync(string str, object userState) { + if ((this.DecryptOperationCompleted == null)) { + this.DecryptOperationCompleted = new System.Threading.SendOrPostCallback(this.OnDecryptOperationCompleted); + } + this.InvokeAsync("Decrypt", new object[] { + str}, this.DecryptOperationCompleted, userState); + } + + private void OnDecryptOperationCompleted(object arg) { + if ((this.DecryptCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.DecryptCompleted(this, new DecryptCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/Encrypt", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public string Encrypt(string str) { + object[] results = this.Invoke("Encrypt", new object[] { + str}); + return ((string)(results[0])); + } + + /// + public void EncryptAsync(string str) { + this.EncryptAsync(str, null); + } + + /// + public void EncryptAsync(string str, object userState) { + if ((this.EncryptOperationCompleted == null)) { + this.EncryptOperationCompleted = new System.Threading.SendOrPostCallback(this.OnEncryptOperationCompleted); + } + this.InvokeAsync("Encrypt", new object[] { + str}, this.EncryptOperationCompleted, userState); + } + + private void OnEncryptOperationCompleted(object arg) { + if ((this.EncryptCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.EncryptCompleted(this, new EncryptCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/GetCount", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public int GetCount(string jsonParam) { + object[] results = this.Invoke("GetCount", new object[] { + jsonParam}); + return ((int)(results[0])); + } + + /// + public void GetCountAsync(string jsonParam) { + this.GetCountAsync(jsonParam, null); + } + + /// + public void GetCountAsync(string jsonParam, object userState) { + if ((this.GetCountOperationCompleted == null)) { + this.GetCountOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetCountOperationCompleted); + } + this.InvokeAsync("GetCount", new object[] { + jsonParam}, this.GetCountOperationCompleted, userState); + } + + private void OnGetCountOperationCompleted(object arg) { + if ((this.GetCountCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.GetCountCompleted(this, new GetCountCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/GetData", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public string GetData(string jsonParam) { + object[] results = this.Invoke("GetData", new object[] { + jsonParam}); + return ((string)(results[0])); + } + + /// + public void GetDataAsync(string jsonParam) { + this.GetDataAsync(jsonParam, null); + } + + /// + public void GetDataAsync(string jsonParam, object userState) { + if ((this.GetDataOperationCompleted == null)) { + this.GetDataOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetDataOperationCompleted); + } + this.InvokeAsync("GetData", new object[] { + jsonParam}, this.GetDataOperationCompleted, userState); + } + + private void OnGetDataOperationCompleted(object arg) { + if ((this.GetDataCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.GetDataCompleted(this, new GetDataCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/AddData", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public string AddData(string jsonParam, string strJson) { + object[] results = this.Invoke("AddData", new object[] { + jsonParam, + strJson}); + return ((string)(results[0])); + } + + /// + public void AddDataAsync(string jsonParam, string strJson) { + this.AddDataAsync(jsonParam, strJson, null); + } + + /// + public void AddDataAsync(string jsonParam, string strJson, object userState) { + if ((this.AddDataOperationCompleted == null)) { + this.AddDataOperationCompleted = new System.Threading.SendOrPostCallback(this.OnAddDataOperationCompleted); + } + this.InvokeAsync("AddData", new object[] { + jsonParam, + strJson}, this.AddDataOperationCompleted, userState); + } + + private void OnAddDataOperationCompleted(object arg) { + if ((this.AddDataCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.AddDataCompleted(this, new AddDataCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/GetBomVersion", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public string GetBomVersion(string ParentPartCode, string SubPartCode) { + object[] results = this.Invoke("GetBomVersion", new object[] { + ParentPartCode, + SubPartCode}); + return ((string)(results[0])); + } + + /// + public void GetBomVersionAsync(string ParentPartCode, string SubPartCode) { + this.GetBomVersionAsync(ParentPartCode, SubPartCode, null); + } + + /// + public void GetBomVersionAsync(string ParentPartCode, string SubPartCode, object userState) { + if ((this.GetBomVersionOperationCompleted == null)) { + this.GetBomVersionOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetBomVersionOperationCompleted); + } + this.InvokeAsync("GetBomVersion", new object[] { + ParentPartCode, + SubPartCode}, this.GetBomVersionOperationCompleted, userState); + } + + private void OnGetBomVersionOperationCompleted(object arg) { + if ((this.GetBomVersionCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.GetBomVersionCompleted(this, new GetBomVersionCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/GetBomsByVer", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public string GetBomsByVer(string parentPart, string bomVer) { + object[] results = this.Invoke("GetBomsByVer", new object[] { + parentPart, + bomVer}); + return ((string)(results[0])); + } + + /// + public void GetBomsByVerAsync(string parentPart, string bomVer) { + this.GetBomsByVerAsync(parentPart, bomVer, null); + } + + /// + public void GetBomsByVerAsync(string parentPart, string bomVer, object userState) { + if ((this.GetBomsByVerOperationCompleted == null)) { + this.GetBomsByVerOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetBomsByVerOperationCompleted); + } + this.InvokeAsync("GetBomsByVer", new object[] { + parentPart, + bomVer}, this.GetBomsByVerOperationCompleted, userState); + } + + private void OnGetBomsByVerOperationCompleted(object arg) { + if ((this.GetBomsByVerCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.GetBomsByVerCompleted(this, new GetBomsByVerCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/GetBom", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public string GetBom(string pcode, string scode) { + object[] results = this.Invoke("GetBom", new object[] { + pcode, + scode}); + return ((string)(results[0])); + } + + /// + public void GetBomAsync(string pcode, string scode) { + this.GetBomAsync(pcode, scode, null); + } + + /// + public void GetBomAsync(string pcode, string scode, object userState) { + if ((this.GetBomOperationCompleted == null)) { + this.GetBomOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetBomOperationCompleted); + } + this.InvokeAsync("GetBom", new object[] { + pcode, + scode}, this.GetBomOperationCompleted, userState); + } + + private void OnGetBomOperationCompleted(object arg) { + if ((this.GetBomCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.GetBomCompleted(this, new GetBomCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/UpdateData", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public string UpdateData(string jsonParam, string strJson) { + object[] results = this.Invoke("UpdateData", new object[] { + jsonParam, + strJson}); + return ((string)(results[0])); + } + + /// + public void UpdateDataAsync(string jsonParam, string strJson) { + this.UpdateDataAsync(jsonParam, strJson, null); + } + + /// + public void UpdateDataAsync(string jsonParam, string strJson, object userState) { + if ((this.UpdateDataOperationCompleted == null)) { + this.UpdateDataOperationCompleted = new System.Threading.SendOrPostCallback(this.OnUpdateDataOperationCompleted); + } + this.InvokeAsync("UpdateData", new object[] { + jsonParam, + strJson}, this.UpdateDataOperationCompleted, userState); + } + + private void OnUpdateDataOperationCompleted(object arg) { + if ((this.UpdateDataCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.UpdateDataCompleted(this, new UpdateDataCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/SaveSeqencing", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public string SaveSeqencing(string strJson) { + object[] results = this.Invoke("SaveSeqencing", new object[] { + strJson}); + return ((string)(results[0])); + } + + /// + public void SaveSeqencingAsync(string strJson) { + this.SaveSeqencingAsync(strJson, null); + } + + /// + public void SaveSeqencingAsync(string strJson, object userState) { + if ((this.SaveSeqencingOperationCompleted == null)) { + this.SaveSeqencingOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSaveSeqencingOperationCompleted); + } + this.InvokeAsync("SaveSeqencing", new object[] { + strJson}, this.SaveSeqencingOperationCompleted, userState); + } + + private void OnSaveSeqencingOperationCompleted(object arg) { + if ((this.SaveSeqencingCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.SaveSeqencingCompleted(this, new SaveSeqencingCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/AddMutualData", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public string AddMutualData(string jsonParam, string strJson) { + object[] results = this.Invoke("AddMutualData", new object[] { + jsonParam, + strJson}); + return ((string)(results[0])); + } + + /// + public void AddMutualDataAsync(string jsonParam, string strJson) { + this.AddMutualDataAsync(jsonParam, strJson, null); + } + + /// + public void AddMutualDataAsync(string jsonParam, string strJson, object userState) { + if ((this.AddMutualDataOperationCompleted == null)) { + this.AddMutualDataOperationCompleted = new System.Threading.SendOrPostCallback(this.OnAddMutualDataOperationCompleted); + } + this.InvokeAsync("AddMutualData", new object[] { + jsonParam, + strJson}, this.AddMutualDataOperationCompleted, userState); + } + + private void OnAddMutualDataOperationCompleted(object arg) { + if ((this.AddMutualDataCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.AddMutualDataCompleted(this, new AddMutualDataCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/ReceiveProducts", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public string ReceiveProducts(string jsonParam) { + object[] results = this.Invoke("ReceiveProducts", new object[] { + jsonParam}); + return ((string)(results[0])); + } + + /// + public void ReceiveProductsAsync(string jsonParam) { + this.ReceiveProductsAsync(jsonParam, null); + } + + /// + public void ReceiveProductsAsync(string jsonParam, object userState) { + if ((this.ReceiveProductsOperationCompleted == null)) { + this.ReceiveProductsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnReceiveProductsOperationCompleted); + } + this.InvokeAsync("ReceiveProducts", new object[] { + jsonParam}, this.ReceiveProductsOperationCompleted, userState); + } + + private void OnReceiveProductsOperationCompleted(object arg) { + if ((this.ReceiveProductsCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.ReceiveProductsCompleted(this, new ReceiveProductsCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/ContainerReceive", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public string ContainerReceive(string strJson) { + object[] results = this.Invoke("ContainerReceive", new object[] { + strJson}); + return ((string)(results[0])); + } + + /// + public void ContainerReceiveAsync(string strJson) { + this.ContainerReceiveAsync(strJson, null); + } + + /// + public void ContainerReceiveAsync(string strJson, object userState) { + if ((this.ContainerReceiveOperationCompleted == null)) { + this.ContainerReceiveOperationCompleted = new System.Threading.SendOrPostCallback(this.OnContainerReceiveOperationCompleted); + } + this.InvokeAsync("ContainerReceive", new object[] { + strJson}, this.ContainerReceiveOperationCompleted, userState); + } + + private void OnContainerReceiveOperationCompleted(object arg) { + if ((this.ContainerReceiveCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.ContainerReceiveCompleted(this, new ContainerReceiveCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/ContainerOut", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public string ContainerOut(string strJson) { + object[] results = this.Invoke("ContainerOut", new object[] { + strJson}); + return ((string)(results[0])); + } + + /// + public void ContainerOutAsync(string strJson) { + this.ContainerOutAsync(strJson, null); + } + + /// + public void ContainerOutAsync(string strJson, object userState) { + if ((this.ContainerOutOperationCompleted == null)) { + this.ContainerOutOperationCompleted = new System.Threading.SendOrPostCallback(this.OnContainerOutOperationCompleted); + } + this.InvokeAsync("ContainerOut", new object[] { + strJson}, this.ContainerOutOperationCompleted, userState); + } + + private void OnContainerOutOperationCompleted(object arg) { + if ((this.ContainerOutCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.ContainerOutCompleted(this, new ContainerOutCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/CheckComesback", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public string CheckComesback(string strJson) { + object[] results = this.Invoke("CheckComesback", new object[] { + strJson}); + return ((string)(results[0])); + } + + /// + public void CheckComesbackAsync(string strJson) { + this.CheckComesbackAsync(strJson, null); + } + + /// + public void CheckComesbackAsync(string strJson, object userState) { + if ((this.CheckComesbackOperationCompleted == null)) { + this.CheckComesbackOperationCompleted = new System.Threading.SendOrPostCallback(this.OnCheckComesbackOperationCompleted); + } + this.InvokeAsync("CheckComesback", new object[] { + strJson}, this.CheckComesbackOperationCompleted, userState); + } + + private void OnCheckComesbackOperationCompleted(object arg) { + if ((this.CheckComesbackCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.CheckComesbackCompleted(this, new CheckComesbackCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/CreateBillMA", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public string CreateBillMA(string strJson) { + object[] results = this.Invoke("CreateBillMA", new object[] { + strJson}); + return ((string)(results[0])); + } + + /// + public void CreateBillMAAsync(string strJson) { + this.CreateBillMAAsync(strJson, null); + } + + /// + public void CreateBillMAAsync(string strJson, object userState) { + if ((this.CreateBillMAOperationCompleted == null)) { + this.CreateBillMAOperationCompleted = new System.Threading.SendOrPostCallback(this.OnCreateBillMAOperationCompleted); + } + this.InvokeAsync("CreateBillMA", new object[] { + strJson}, this.CreateBillMAOperationCompleted, userState); + } + + private void OnCreateBillMAOperationCompleted(object arg) { + if ((this.CreateBillMACompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.CreateBillMACompleted(this, new CreateBillMACompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/AddMesFGFin", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public string AddMesFGFin(string strJson) { + object[] results = this.Invoke("AddMesFGFin", new object[] { + strJson}); + return ((string)(results[0])); + } + + /// + public void AddMesFGFinAsync(string strJson) { + this.AddMesFGFinAsync(strJson, null); + } + + /// + public void AddMesFGFinAsync(string strJson, object userState) { + if ((this.AddMesFGFinOperationCompleted == null)) { + this.AddMesFGFinOperationCompleted = new System.Threading.SendOrPostCallback(this.OnAddMesFGFinOperationCompleted); + } + this.InvokeAsync("AddMesFGFin", new object[] { + strJson}, this.AddMesFGFinOperationCompleted, userState); + } + + private void OnAddMesFGFinOperationCompleted(object arg) { + if ((this.AddMesFGFinCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.AddMesFGFinCompleted(this, new AddMesFGFinCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/UpdateBillState", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public string UpdateBillState(string strJson) { + object[] results = this.Invoke("UpdateBillState", new object[] { + strJson}); + return ((string)(results[0])); + } + + /// + public void UpdateBillStateAsync(string strJson) { + this.UpdateBillStateAsync(strJson, null); + } + + /// + public void UpdateBillStateAsync(string strJson, object userState) { + if ((this.UpdateBillStateOperationCompleted == null)) { + this.UpdateBillStateOperationCompleted = new System.Threading.SendOrPostCallback(this.OnUpdateBillStateOperationCompleted); + } + this.InvokeAsync("UpdateBillState", new object[] { + strJson}, this.UpdateBillStateOperationCompleted, userState); + } + + private void OnUpdateBillStateOperationCompleted(object arg) { + if ((this.UpdateBillStateCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.UpdateBillStateCompleted(this, new UpdateBillStateCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + public new void CancelAsync(object userState) { + base.CancelAsync(userState); + } + + private bool IsLocalFileSystemWebService(string url) { + if (((url == null) + || (url == string.Empty))) { + return false; + } + System.Uri wsUri = new System.Uri(url); + if (((wsUri.Port >= 1024) + && (string.Compare(wsUri.Host, "localHost", System.StringComparison.OrdinalIgnoreCase) == 0))) { + return true; + } + return false; + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + public delegate void GetVerCompletedEventHandler(object sender, GetVerCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class GetVerCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal GetVerCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public string Result { + get { + this.RaiseExceptionIfNecessary(); + return ((string)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + public delegate void WriteLogCompletedEventHandler(object sender, WriteLogCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class WriteLogCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal WriteLogCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public string Result { + get { + this.RaiseExceptionIfNecessary(); + return ((string)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + public delegate void LoginCompletedEventHandler(object sender, LoginCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class LoginCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal LoginCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public string Result { + get { + this.RaiseExceptionIfNecessary(); + return ((string)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + public delegate void NewLoginCompletedEventHandler(object sender, NewLoginCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class NewLoginCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal NewLoginCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public string Result { + get { + this.RaiseExceptionIfNecessary(); + return ((string)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + public delegate void LogoutCompletedEventHandler(object sender, LogoutCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class LogoutCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal LogoutCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public string Result { + get { + this.RaiseExceptionIfNecessary(); + return ((string)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + public delegate void ModifyPasswordCompletedEventHandler(object sender, ModifyPasswordCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class ModifyPasswordCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal ModifyPasswordCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public string Result { + get { + this.RaiseExceptionIfNecessary(); + return ((string)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + public delegate void GetServerTimeCompletedEventHandler(object sender, GetServerTimeCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class GetServerTimeCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal GetServerTimeCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public System.DateTime Result { + get { + this.RaiseExceptionIfNecessary(); + return ((System.DateTime)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + public delegate void DecryptCompletedEventHandler(object sender, DecryptCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class DecryptCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal DecryptCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public string Result { + get { + this.RaiseExceptionIfNecessary(); + return ((string)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + public delegate void EncryptCompletedEventHandler(object sender, EncryptCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class EncryptCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal EncryptCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public string Result { + get { + this.RaiseExceptionIfNecessary(); + return ((string)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + public delegate void GetCountCompletedEventHandler(object sender, GetCountCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class GetCountCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal GetCountCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public int Result { + get { + this.RaiseExceptionIfNecessary(); + return ((int)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + public delegate void GetDataCompletedEventHandler(object sender, GetDataCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class GetDataCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal GetDataCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public string Result { + get { + this.RaiseExceptionIfNecessary(); + return ((string)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + public delegate void AddDataCompletedEventHandler(object sender, AddDataCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class AddDataCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal AddDataCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public string Result { + get { + this.RaiseExceptionIfNecessary(); + return ((string)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + public delegate void GetBomVersionCompletedEventHandler(object sender, GetBomVersionCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class GetBomVersionCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal GetBomVersionCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public string Result { + get { + this.RaiseExceptionIfNecessary(); + return ((string)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + public delegate void GetBomsByVerCompletedEventHandler(object sender, GetBomsByVerCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class GetBomsByVerCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal GetBomsByVerCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public string Result { + get { + this.RaiseExceptionIfNecessary(); + return ((string)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + public delegate void GetBomCompletedEventHandler(object sender, GetBomCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class GetBomCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal GetBomCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public string Result { + get { + this.RaiseExceptionIfNecessary(); + return ((string)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + public delegate void UpdateDataCompletedEventHandler(object sender, UpdateDataCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class UpdateDataCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal UpdateDataCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public string Result { + get { + this.RaiseExceptionIfNecessary(); + return ((string)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + public delegate void SaveSeqencingCompletedEventHandler(object sender, SaveSeqencingCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class SaveSeqencingCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal SaveSeqencingCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public string Result { + get { + this.RaiseExceptionIfNecessary(); + return ((string)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + public delegate void AddMutualDataCompletedEventHandler(object sender, AddMutualDataCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class AddMutualDataCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal AddMutualDataCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public string Result { + get { + this.RaiseExceptionIfNecessary(); + return ((string)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + public delegate void ReceiveProductsCompletedEventHandler(object sender, ReceiveProductsCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class ReceiveProductsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal ReceiveProductsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public string Result { + get { + this.RaiseExceptionIfNecessary(); + return ((string)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + public delegate void ContainerReceiveCompletedEventHandler(object sender, ContainerReceiveCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class ContainerReceiveCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal ContainerReceiveCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public string Result { + get { + this.RaiseExceptionIfNecessary(); + return ((string)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + public delegate void ContainerOutCompletedEventHandler(object sender, ContainerOutCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class ContainerOutCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal ContainerOutCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public string Result { + get { + this.RaiseExceptionIfNecessary(); + return ((string)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + public delegate void CheckComesbackCompletedEventHandler(object sender, CheckComesbackCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class CheckComesbackCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal CheckComesbackCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public string Result { + get { + this.RaiseExceptionIfNecessary(); + return ((string)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + public delegate void CreateBillMACompletedEventHandler(object sender, CreateBillMACompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class CreateBillMACompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal CreateBillMACompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public string Result { + get { + this.RaiseExceptionIfNecessary(); + return ((string)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + public delegate void AddMesFGFinCompletedEventHandler(object sender, AddMesFGFinCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class AddMesFGFinCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal AddMesFGFinCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public string Result { + get { + this.RaiseExceptionIfNecessary(); + return ((string)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + public delegate void UpdateBillStateCompletedEventHandler(object sender, UpdateBillStateCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class UpdateBillStateCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal UpdateBillStateCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public string Result { + get { + this.RaiseExceptionIfNecessary(); + return ((string)(this.results[0])); + } + } + } +} + +#pragma warning restore 1591 \ No newline at end of file diff --git a/Controller/Web References/BomList1/Reference.map b/Controller/Web References/BomList1/Reference.map new file mode 100644 index 0000000..169d3db --- /dev/null +++ b/Controller/Web References/BomList1/Reference.map @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/Controller/Web References/BomListcompany/JsonService.disco b/Controller/Web References/BomListcompany/JsonService.disco new file mode 100644 index 0000000..ed053f9 --- /dev/null +++ b/Controller/Web References/BomListcompany/JsonService.disco @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/Controller/Web References/BomListcompany/JsonService.wsdl b/Controller/Web References/BomListcompany/JsonService.wsdl new file mode 100644 index 0000000..f03c3e8 --- /dev/null +++ b/Controller/Web References/BomListcompany/JsonService.wsdl @@ -0,0 +1,2062 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Controller/Web References/BomListcompany/Reference.cs b/Controller/Web References/BomListcompany/Reference.cs new file mode 100644 index 0000000..ab2b525 --- /dev/null +++ b/Controller/Web References/BomListcompany/Reference.cs @@ -0,0 +1,1610 @@ +//------------------------------------------------------------------------------ +// +// 此代码由工具生成。 +// 运行时版本:4.0.30319.42000 +// +// 对此文件的更改可能会导致不正确的行为,并且如果 +// 重新生成代码,这些更改将会丢失。 +// +//------------------------------------------------------------------------------ + +// +// 此源代码是由 Microsoft.VSDesigner 4.0.30319.42000 版自动生成。 +// +#pragma warning disable 1591 + +namespace CK.SCP.Controller.BomListcompany { + using System; + using System.Web.Services; + using System.Diagnostics; + using System.Web.Services.Protocols; + using System.Xml.Serialization; + using System.ComponentModel; + + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name="JsonServiceSoap", Namespace="http://tempuri.org/")] + public partial class JsonService : System.Web.Services.Protocols.SoapHttpClientProtocol { + + private System.Threading.SendOrPostCallback GetVerOperationCompleted; + + private System.Threading.SendOrPostCallback WriteLogOperationCompleted; + + private System.Threading.SendOrPostCallback LoginOperationCompleted; + + private System.Threading.SendOrPostCallback NewLoginOperationCompleted; + + private System.Threading.SendOrPostCallback LogoutOperationCompleted; + + private System.Threading.SendOrPostCallback ModifyPasswordOperationCompleted; + + private System.Threading.SendOrPostCallback GetServerTimeOperationCompleted; + + private System.Threading.SendOrPostCallback DecryptOperationCompleted; + + private System.Threading.SendOrPostCallback EncryptOperationCompleted; + + private System.Threading.SendOrPostCallback GetCountOperationCompleted; + + private System.Threading.SendOrPostCallback GetDataOperationCompleted; + + private System.Threading.SendOrPostCallback AddDataOperationCompleted; + + private System.Threading.SendOrPostCallback GetBomVersionOperationCompleted; + + private System.Threading.SendOrPostCallback GetBomsByVerOperationCompleted; + + private System.Threading.SendOrPostCallback GetBomOperationCompleted; + + private System.Threading.SendOrPostCallback UpdateDataOperationCompleted; + + private System.Threading.SendOrPostCallback SaveSeqencingOperationCompleted; + + private System.Threading.SendOrPostCallback AddMutualDataOperationCompleted; + + private System.Threading.SendOrPostCallback ReceiveProductsOperationCompleted; + + private System.Threading.SendOrPostCallback ContainerReceiveOperationCompleted; + + private System.Threading.SendOrPostCallback ContainerOutOperationCompleted; + + private System.Threading.SendOrPostCallback CheckComesbackOperationCompleted; + + private System.Threading.SendOrPostCallback CreateBillMAOperationCompleted; + + private System.Threading.SendOrPostCallback AddMesFGFinOperationCompleted; + + private System.Threading.SendOrPostCallback UpdateBillStateOperationCompleted; + + private bool useDefaultCredentialsSetExplicitly; + + /// + public JsonService() { + this.Url = global::CK.SCP.Controller.Properties.Settings.Default.CK_SCP_Controller_BomListcompany_JsonService; + if ((this.IsLocalFileSystemWebService(this.Url) == true)) { + this.UseDefaultCredentials = true; + this.useDefaultCredentialsSetExplicitly = false; + } + else { + this.useDefaultCredentialsSetExplicitly = true; + } + } + + public new string Url { + get { + return base.Url; + } + set { + if ((((this.IsLocalFileSystemWebService(base.Url) == true) + && (this.useDefaultCredentialsSetExplicitly == false)) + && (this.IsLocalFileSystemWebService(value) == false))) { + base.UseDefaultCredentials = false; + } + base.Url = value; + } + } + + public new bool UseDefaultCredentials { + get { + return base.UseDefaultCredentials; + } + set { + base.UseDefaultCredentials = value; + this.useDefaultCredentialsSetExplicitly = true; + } + } + + /// + public event GetVerCompletedEventHandler GetVerCompleted; + + /// + public event WriteLogCompletedEventHandler WriteLogCompleted; + + /// + public event LoginCompletedEventHandler LoginCompleted; + + /// + public event NewLoginCompletedEventHandler NewLoginCompleted; + + /// + public event LogoutCompletedEventHandler LogoutCompleted; + + /// + public event ModifyPasswordCompletedEventHandler ModifyPasswordCompleted; + + /// + public event GetServerTimeCompletedEventHandler GetServerTimeCompleted; + + /// + public event DecryptCompletedEventHandler DecryptCompleted; + + /// + public event EncryptCompletedEventHandler EncryptCompleted; + + /// + public event GetCountCompletedEventHandler GetCountCompleted; + + /// + public event GetDataCompletedEventHandler GetDataCompleted; + + /// + public event AddDataCompletedEventHandler AddDataCompleted; + + /// + public event GetBomVersionCompletedEventHandler GetBomVersionCompleted; + + /// + public event GetBomsByVerCompletedEventHandler GetBomsByVerCompleted; + + /// + public event GetBomCompletedEventHandler GetBomCompleted; + + /// + public event UpdateDataCompletedEventHandler UpdateDataCompleted; + + /// + public event SaveSeqencingCompletedEventHandler SaveSeqencingCompleted; + + /// + public event AddMutualDataCompletedEventHandler AddMutualDataCompleted; + + /// + public event ReceiveProductsCompletedEventHandler ReceiveProductsCompleted; + + /// + public event ContainerReceiveCompletedEventHandler ContainerReceiveCompleted; + + /// + public event ContainerOutCompletedEventHandler ContainerOutCompleted; + + /// + public event CheckComesbackCompletedEventHandler CheckComesbackCompleted; + + /// + public event CreateBillMACompletedEventHandler CreateBillMACompleted; + + /// + public event AddMesFGFinCompletedEventHandler AddMesFGFinCompleted; + + /// + public event UpdateBillStateCompletedEventHandler UpdateBillStateCompleted; + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/GetVer", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public string GetVer() { + object[] results = this.Invoke("GetVer", new object[0]); + return ((string)(results[0])); + } + + /// + public void GetVerAsync() { + this.GetVerAsync(null); + } + + /// + public void GetVerAsync(object userState) { + if ((this.GetVerOperationCompleted == null)) { + this.GetVerOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetVerOperationCompleted); + } + this.InvokeAsync("GetVer", new object[0], this.GetVerOperationCompleted, userState); + } + + private void OnGetVerOperationCompleted(object arg) { + if ((this.GetVerCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.GetVerCompleted(this, new GetVerCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/WriteLog", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public string WriteLog(string operCode, string function, string message) { + object[] results = this.Invoke("WriteLog", new object[] { + operCode, + function, + message}); + return ((string)(results[0])); + } + + /// + public void WriteLogAsync(string operCode, string function, string message) { + this.WriteLogAsync(operCode, function, message, null); + } + + /// + public void WriteLogAsync(string operCode, string function, string message, object userState) { + if ((this.WriteLogOperationCompleted == null)) { + this.WriteLogOperationCompleted = new System.Threading.SendOrPostCallback(this.OnWriteLogOperationCompleted); + } + this.InvokeAsync("WriteLog", new object[] { + operCode, + function, + message}, this.WriteLogOperationCompleted, userState); + } + + private void OnWriteLogOperationCompleted(object arg) { + if ((this.WriteLogCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.WriteLogCompleted(this, new WriteLogCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/Login", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public string Login(string operCode, string password) { + object[] results = this.Invoke("Login", new object[] { + operCode, + password}); + return ((string)(results[0])); + } + + /// + public void LoginAsync(string operCode, string password) { + this.LoginAsync(operCode, password, null); + } + + /// + public void LoginAsync(string operCode, string password, object userState) { + if ((this.LoginOperationCompleted == null)) { + this.LoginOperationCompleted = new System.Threading.SendOrPostCallback(this.OnLoginOperationCompleted); + } + this.InvokeAsync("Login", new object[] { + operCode, + password}, this.LoginOperationCompleted, userState); + } + + private void OnLoginOperationCompleted(object arg) { + if ((this.LoginCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.LoginCompleted(this, new LoginCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/NewLogin", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public string NewLogin(string operCode, string password) { + object[] results = this.Invoke("NewLogin", new object[] { + operCode, + password}); + return ((string)(results[0])); + } + + /// + public void NewLoginAsync(string operCode, string password) { + this.NewLoginAsync(operCode, password, null); + } + + /// + public void NewLoginAsync(string operCode, string password, object userState) { + if ((this.NewLoginOperationCompleted == null)) { + this.NewLoginOperationCompleted = new System.Threading.SendOrPostCallback(this.OnNewLoginOperationCompleted); + } + this.InvokeAsync("NewLogin", new object[] { + operCode, + password}, this.NewLoginOperationCompleted, userState); + } + + private void OnNewLoginOperationCompleted(object arg) { + if ((this.NewLoginCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.NewLoginCompleted(this, new NewLoginCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/Logout", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public string Logout(string operCode) { + object[] results = this.Invoke("Logout", new object[] { + operCode}); + return ((string)(results[0])); + } + + /// + public void LogoutAsync(string operCode) { + this.LogoutAsync(operCode, null); + } + + /// + public void LogoutAsync(string operCode, object userState) { + if ((this.LogoutOperationCompleted == null)) { + this.LogoutOperationCompleted = new System.Threading.SendOrPostCallback(this.OnLogoutOperationCompleted); + } + this.InvokeAsync("Logout", new object[] { + operCode}, this.LogoutOperationCompleted, userState); + } + + private void OnLogoutOperationCompleted(object arg) { + if ((this.LogoutCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.LogoutCompleted(this, new LogoutCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/ModifyPassword", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public string ModifyPassword(string operCode, string oldPass, string newPass) { + object[] results = this.Invoke("ModifyPassword", new object[] { + operCode, + oldPass, + newPass}); + return ((string)(results[0])); + } + + /// + public void ModifyPasswordAsync(string operCode, string oldPass, string newPass) { + this.ModifyPasswordAsync(operCode, oldPass, newPass, null); + } + + /// + public void ModifyPasswordAsync(string operCode, string oldPass, string newPass, object userState) { + if ((this.ModifyPasswordOperationCompleted == null)) { + this.ModifyPasswordOperationCompleted = new System.Threading.SendOrPostCallback(this.OnModifyPasswordOperationCompleted); + } + this.InvokeAsync("ModifyPassword", new object[] { + operCode, + oldPass, + newPass}, this.ModifyPasswordOperationCompleted, userState); + } + + private void OnModifyPasswordOperationCompleted(object arg) { + if ((this.ModifyPasswordCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.ModifyPasswordCompleted(this, new ModifyPasswordCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/GetServerTime", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public System.DateTime GetServerTime() { + object[] results = this.Invoke("GetServerTime", new object[0]); + return ((System.DateTime)(results[0])); + } + + /// + public void GetServerTimeAsync() { + this.GetServerTimeAsync(null); + } + + /// + public void GetServerTimeAsync(object userState) { + if ((this.GetServerTimeOperationCompleted == null)) { + this.GetServerTimeOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetServerTimeOperationCompleted); + } + this.InvokeAsync("GetServerTime", new object[0], this.GetServerTimeOperationCompleted, userState); + } + + private void OnGetServerTimeOperationCompleted(object arg) { + if ((this.GetServerTimeCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.GetServerTimeCompleted(this, new GetServerTimeCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/Decrypt", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public string Decrypt(string str) { + object[] results = this.Invoke("Decrypt", new object[] { + str}); + return ((string)(results[0])); + } + + /// + public void DecryptAsync(string str) { + this.DecryptAsync(str, null); + } + + /// + public void DecryptAsync(string str, object userState) { + if ((this.DecryptOperationCompleted == null)) { + this.DecryptOperationCompleted = new System.Threading.SendOrPostCallback(this.OnDecryptOperationCompleted); + } + this.InvokeAsync("Decrypt", new object[] { + str}, this.DecryptOperationCompleted, userState); + } + + private void OnDecryptOperationCompleted(object arg) { + if ((this.DecryptCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.DecryptCompleted(this, new DecryptCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/Encrypt", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public string Encrypt(string str) { + object[] results = this.Invoke("Encrypt", new object[] { + str}); + return ((string)(results[0])); + } + + /// + public void EncryptAsync(string str) { + this.EncryptAsync(str, null); + } + + /// + public void EncryptAsync(string str, object userState) { + if ((this.EncryptOperationCompleted == null)) { + this.EncryptOperationCompleted = new System.Threading.SendOrPostCallback(this.OnEncryptOperationCompleted); + } + this.InvokeAsync("Encrypt", new object[] { + str}, this.EncryptOperationCompleted, userState); + } + + private void OnEncryptOperationCompleted(object arg) { + if ((this.EncryptCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.EncryptCompleted(this, new EncryptCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/GetCount", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public int GetCount(string jsonParam) { + object[] results = this.Invoke("GetCount", new object[] { + jsonParam}); + return ((int)(results[0])); + } + + /// + public void GetCountAsync(string jsonParam) { + this.GetCountAsync(jsonParam, null); + } + + /// + public void GetCountAsync(string jsonParam, object userState) { + if ((this.GetCountOperationCompleted == null)) { + this.GetCountOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetCountOperationCompleted); + } + this.InvokeAsync("GetCount", new object[] { + jsonParam}, this.GetCountOperationCompleted, userState); + } + + private void OnGetCountOperationCompleted(object arg) { + if ((this.GetCountCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.GetCountCompleted(this, new GetCountCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/GetData", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public string GetData(string jsonParam) { + object[] results = this.Invoke("GetData", new object[] { + jsonParam}); + return ((string)(results[0])); + } + + /// + public void GetDataAsync(string jsonParam) { + this.GetDataAsync(jsonParam, null); + } + + /// + public void GetDataAsync(string jsonParam, object userState) { + if ((this.GetDataOperationCompleted == null)) { + this.GetDataOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetDataOperationCompleted); + } + this.InvokeAsync("GetData", new object[] { + jsonParam}, this.GetDataOperationCompleted, userState); + } + + private void OnGetDataOperationCompleted(object arg) { + if ((this.GetDataCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.GetDataCompleted(this, new GetDataCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/AddData", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public string AddData(string jsonParam, string strJson) { + object[] results = this.Invoke("AddData", new object[] { + jsonParam, + strJson}); + return ((string)(results[0])); + } + + /// + public void AddDataAsync(string jsonParam, string strJson) { + this.AddDataAsync(jsonParam, strJson, null); + } + + /// + public void AddDataAsync(string jsonParam, string strJson, object userState) { + if ((this.AddDataOperationCompleted == null)) { + this.AddDataOperationCompleted = new System.Threading.SendOrPostCallback(this.OnAddDataOperationCompleted); + } + this.InvokeAsync("AddData", new object[] { + jsonParam, + strJson}, this.AddDataOperationCompleted, userState); + } + + private void OnAddDataOperationCompleted(object arg) { + if ((this.AddDataCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.AddDataCompleted(this, new AddDataCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/GetBomVersion", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public string GetBomVersion(string ParentPartCode, string SubPartCode) { + object[] results = this.Invoke("GetBomVersion", new object[] { + ParentPartCode, + SubPartCode}); + return ((string)(results[0])); + } + + /// + public void GetBomVersionAsync(string ParentPartCode, string SubPartCode) { + this.GetBomVersionAsync(ParentPartCode, SubPartCode, null); + } + + /// + public void GetBomVersionAsync(string ParentPartCode, string SubPartCode, object userState) { + if ((this.GetBomVersionOperationCompleted == null)) { + this.GetBomVersionOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetBomVersionOperationCompleted); + } + this.InvokeAsync("GetBomVersion", new object[] { + ParentPartCode, + SubPartCode}, this.GetBomVersionOperationCompleted, userState); + } + + private void OnGetBomVersionOperationCompleted(object arg) { + if ((this.GetBomVersionCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.GetBomVersionCompleted(this, new GetBomVersionCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/GetBomsByVer", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public string GetBomsByVer(string parentPart, string bomVer) { + object[] results = this.Invoke("GetBomsByVer", new object[] { + parentPart, + bomVer}); + return ((string)(results[0])); + } + + /// + public void GetBomsByVerAsync(string parentPart, string bomVer) { + this.GetBomsByVerAsync(parentPart, bomVer, null); + } + + /// + public void GetBomsByVerAsync(string parentPart, string bomVer, object userState) { + if ((this.GetBomsByVerOperationCompleted == null)) { + this.GetBomsByVerOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetBomsByVerOperationCompleted); + } + this.InvokeAsync("GetBomsByVer", new object[] { + parentPart, + bomVer}, this.GetBomsByVerOperationCompleted, userState); + } + + private void OnGetBomsByVerOperationCompleted(object arg) { + if ((this.GetBomsByVerCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.GetBomsByVerCompleted(this, new GetBomsByVerCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/GetBom", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public string GetBom(string pcode, string scode) { + object[] results = this.Invoke("GetBom", new object[] { + pcode, + scode}); + return ((string)(results[0])); + } + + /// + public void GetBomAsync(string pcode, string scode) { + this.GetBomAsync(pcode, scode, null); + } + + /// + public void GetBomAsync(string pcode, string scode, object userState) { + if ((this.GetBomOperationCompleted == null)) { + this.GetBomOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetBomOperationCompleted); + } + this.InvokeAsync("GetBom", new object[] { + pcode, + scode}, this.GetBomOperationCompleted, userState); + } + + private void OnGetBomOperationCompleted(object arg) { + if ((this.GetBomCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.GetBomCompleted(this, new GetBomCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/UpdateData", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public string UpdateData(string jsonParam, string strJson) { + object[] results = this.Invoke("UpdateData", new object[] { + jsonParam, + strJson}); + return ((string)(results[0])); + } + + /// + public void UpdateDataAsync(string jsonParam, string strJson) { + this.UpdateDataAsync(jsonParam, strJson, null); + } + + /// + public void UpdateDataAsync(string jsonParam, string strJson, object userState) { + if ((this.UpdateDataOperationCompleted == null)) { + this.UpdateDataOperationCompleted = new System.Threading.SendOrPostCallback(this.OnUpdateDataOperationCompleted); + } + this.InvokeAsync("UpdateData", new object[] { + jsonParam, + strJson}, this.UpdateDataOperationCompleted, userState); + } + + private void OnUpdateDataOperationCompleted(object arg) { + if ((this.UpdateDataCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.UpdateDataCompleted(this, new UpdateDataCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/SaveSeqencing", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public string SaveSeqencing(string strJson) { + object[] results = this.Invoke("SaveSeqencing", new object[] { + strJson}); + return ((string)(results[0])); + } + + /// + public void SaveSeqencingAsync(string strJson) { + this.SaveSeqencingAsync(strJson, null); + } + + /// + public void SaveSeqencingAsync(string strJson, object userState) { + if ((this.SaveSeqencingOperationCompleted == null)) { + this.SaveSeqencingOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSaveSeqencingOperationCompleted); + } + this.InvokeAsync("SaveSeqencing", new object[] { + strJson}, this.SaveSeqencingOperationCompleted, userState); + } + + private void OnSaveSeqencingOperationCompleted(object arg) { + if ((this.SaveSeqencingCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.SaveSeqencingCompleted(this, new SaveSeqencingCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/AddMutualData", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public string AddMutualData(string jsonParam, string strJson) { + object[] results = this.Invoke("AddMutualData", new object[] { + jsonParam, + strJson}); + return ((string)(results[0])); + } + + /// + public void AddMutualDataAsync(string jsonParam, string strJson) { + this.AddMutualDataAsync(jsonParam, strJson, null); + } + + /// + public void AddMutualDataAsync(string jsonParam, string strJson, object userState) { + if ((this.AddMutualDataOperationCompleted == null)) { + this.AddMutualDataOperationCompleted = new System.Threading.SendOrPostCallback(this.OnAddMutualDataOperationCompleted); + } + this.InvokeAsync("AddMutualData", new object[] { + jsonParam, + strJson}, this.AddMutualDataOperationCompleted, userState); + } + + private void OnAddMutualDataOperationCompleted(object arg) { + if ((this.AddMutualDataCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.AddMutualDataCompleted(this, new AddMutualDataCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/ReceiveProducts", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public string ReceiveProducts(string jsonParam) { + object[] results = this.Invoke("ReceiveProducts", new object[] { + jsonParam}); + return ((string)(results[0])); + } + + /// + public void ReceiveProductsAsync(string jsonParam) { + this.ReceiveProductsAsync(jsonParam, null); + } + + /// + public void ReceiveProductsAsync(string jsonParam, object userState) { + if ((this.ReceiveProductsOperationCompleted == null)) { + this.ReceiveProductsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnReceiveProductsOperationCompleted); + } + this.InvokeAsync("ReceiveProducts", new object[] { + jsonParam}, this.ReceiveProductsOperationCompleted, userState); + } + + private void OnReceiveProductsOperationCompleted(object arg) { + if ((this.ReceiveProductsCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.ReceiveProductsCompleted(this, new ReceiveProductsCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/ContainerReceive", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public string ContainerReceive(string strJson) { + object[] results = this.Invoke("ContainerReceive", new object[] { + strJson}); + return ((string)(results[0])); + } + + /// + public void ContainerReceiveAsync(string strJson) { + this.ContainerReceiveAsync(strJson, null); + } + + /// + public void ContainerReceiveAsync(string strJson, object userState) { + if ((this.ContainerReceiveOperationCompleted == null)) { + this.ContainerReceiveOperationCompleted = new System.Threading.SendOrPostCallback(this.OnContainerReceiveOperationCompleted); + } + this.InvokeAsync("ContainerReceive", new object[] { + strJson}, this.ContainerReceiveOperationCompleted, userState); + } + + private void OnContainerReceiveOperationCompleted(object arg) { + if ((this.ContainerReceiveCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.ContainerReceiveCompleted(this, new ContainerReceiveCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/ContainerOut", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public string ContainerOut(string strJson) { + object[] results = this.Invoke("ContainerOut", new object[] { + strJson}); + return ((string)(results[0])); + } + + /// + public void ContainerOutAsync(string strJson) { + this.ContainerOutAsync(strJson, null); + } + + /// + public void ContainerOutAsync(string strJson, object userState) { + if ((this.ContainerOutOperationCompleted == null)) { + this.ContainerOutOperationCompleted = new System.Threading.SendOrPostCallback(this.OnContainerOutOperationCompleted); + } + this.InvokeAsync("ContainerOut", new object[] { + strJson}, this.ContainerOutOperationCompleted, userState); + } + + private void OnContainerOutOperationCompleted(object arg) { + if ((this.ContainerOutCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.ContainerOutCompleted(this, new ContainerOutCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/CheckComesback", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public string CheckComesback(string strJson) { + object[] results = this.Invoke("CheckComesback", new object[] { + strJson}); + return ((string)(results[0])); + } + + /// + public void CheckComesbackAsync(string strJson) { + this.CheckComesbackAsync(strJson, null); + } + + /// + public void CheckComesbackAsync(string strJson, object userState) { + if ((this.CheckComesbackOperationCompleted == null)) { + this.CheckComesbackOperationCompleted = new System.Threading.SendOrPostCallback(this.OnCheckComesbackOperationCompleted); + } + this.InvokeAsync("CheckComesback", new object[] { + strJson}, this.CheckComesbackOperationCompleted, userState); + } + + private void OnCheckComesbackOperationCompleted(object arg) { + if ((this.CheckComesbackCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.CheckComesbackCompleted(this, new CheckComesbackCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/CreateBillMA", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public string CreateBillMA(string strJson) { + object[] results = this.Invoke("CreateBillMA", new object[] { + strJson}); + return ((string)(results[0])); + } + + /// + public void CreateBillMAAsync(string strJson) { + this.CreateBillMAAsync(strJson, null); + } + + /// + public void CreateBillMAAsync(string strJson, object userState) { + if ((this.CreateBillMAOperationCompleted == null)) { + this.CreateBillMAOperationCompleted = new System.Threading.SendOrPostCallback(this.OnCreateBillMAOperationCompleted); + } + this.InvokeAsync("CreateBillMA", new object[] { + strJson}, this.CreateBillMAOperationCompleted, userState); + } + + private void OnCreateBillMAOperationCompleted(object arg) { + if ((this.CreateBillMACompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.CreateBillMACompleted(this, new CreateBillMACompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/AddMesFGFin", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public string AddMesFGFin(string strJson) { + object[] results = this.Invoke("AddMesFGFin", new object[] { + strJson}); + return ((string)(results[0])); + } + + /// + public void AddMesFGFinAsync(string strJson) { + this.AddMesFGFinAsync(strJson, null); + } + + /// + public void AddMesFGFinAsync(string strJson, object userState) { + if ((this.AddMesFGFinOperationCompleted == null)) { + this.AddMesFGFinOperationCompleted = new System.Threading.SendOrPostCallback(this.OnAddMesFGFinOperationCompleted); + } + this.InvokeAsync("AddMesFGFin", new object[] { + strJson}, this.AddMesFGFinOperationCompleted, userState); + } + + private void OnAddMesFGFinOperationCompleted(object arg) { + if ((this.AddMesFGFinCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.AddMesFGFinCompleted(this, new AddMesFGFinCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/UpdateBillState", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public string UpdateBillState(string strJson) { + object[] results = this.Invoke("UpdateBillState", new object[] { + strJson}); + return ((string)(results[0])); + } + + /// + public void UpdateBillStateAsync(string strJson) { + this.UpdateBillStateAsync(strJson, null); + } + + /// + public void UpdateBillStateAsync(string strJson, object userState) { + if ((this.UpdateBillStateOperationCompleted == null)) { + this.UpdateBillStateOperationCompleted = new System.Threading.SendOrPostCallback(this.OnUpdateBillStateOperationCompleted); + } + this.InvokeAsync("UpdateBillState", new object[] { + strJson}, this.UpdateBillStateOperationCompleted, userState); + } + + private void OnUpdateBillStateOperationCompleted(object arg) { + if ((this.UpdateBillStateCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.UpdateBillStateCompleted(this, new UpdateBillStateCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + public new void CancelAsync(object userState) { + base.CancelAsync(userState); + } + + private bool IsLocalFileSystemWebService(string url) { + if (((url == null) + || (url == string.Empty))) { + return false; + } + System.Uri wsUri = new System.Uri(url); + if (((wsUri.Port >= 1024) + && (string.Compare(wsUri.Host, "localHost", System.StringComparison.OrdinalIgnoreCase) == 0))) { + return true; + } + return false; + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + public delegate void GetVerCompletedEventHandler(object sender, GetVerCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class GetVerCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal GetVerCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public string Result { + get { + this.RaiseExceptionIfNecessary(); + return ((string)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + public delegate void WriteLogCompletedEventHandler(object sender, WriteLogCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class WriteLogCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal WriteLogCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public string Result { + get { + this.RaiseExceptionIfNecessary(); + return ((string)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + public delegate void LoginCompletedEventHandler(object sender, LoginCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class LoginCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal LoginCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public string Result { + get { + this.RaiseExceptionIfNecessary(); + return ((string)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + public delegate void NewLoginCompletedEventHandler(object sender, NewLoginCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class NewLoginCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal NewLoginCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public string Result { + get { + this.RaiseExceptionIfNecessary(); + return ((string)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + public delegate void LogoutCompletedEventHandler(object sender, LogoutCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class LogoutCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal LogoutCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public string Result { + get { + this.RaiseExceptionIfNecessary(); + return ((string)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + public delegate void ModifyPasswordCompletedEventHandler(object sender, ModifyPasswordCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class ModifyPasswordCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal ModifyPasswordCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public string Result { + get { + this.RaiseExceptionIfNecessary(); + return ((string)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + public delegate void GetServerTimeCompletedEventHandler(object sender, GetServerTimeCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class GetServerTimeCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal GetServerTimeCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public System.DateTime Result { + get { + this.RaiseExceptionIfNecessary(); + return ((System.DateTime)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + public delegate void DecryptCompletedEventHandler(object sender, DecryptCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class DecryptCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal DecryptCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public string Result { + get { + this.RaiseExceptionIfNecessary(); + return ((string)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + public delegate void EncryptCompletedEventHandler(object sender, EncryptCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class EncryptCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal EncryptCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public string Result { + get { + this.RaiseExceptionIfNecessary(); + return ((string)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + public delegate void GetCountCompletedEventHandler(object sender, GetCountCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class GetCountCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal GetCountCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public int Result { + get { + this.RaiseExceptionIfNecessary(); + return ((int)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + public delegate void GetDataCompletedEventHandler(object sender, GetDataCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class GetDataCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal GetDataCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public string Result { + get { + this.RaiseExceptionIfNecessary(); + return ((string)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + public delegate void AddDataCompletedEventHandler(object sender, AddDataCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class AddDataCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal AddDataCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public string Result { + get { + this.RaiseExceptionIfNecessary(); + return ((string)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + public delegate void GetBomVersionCompletedEventHandler(object sender, GetBomVersionCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class GetBomVersionCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal GetBomVersionCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public string Result { + get { + this.RaiseExceptionIfNecessary(); + return ((string)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + public delegate void GetBomsByVerCompletedEventHandler(object sender, GetBomsByVerCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class GetBomsByVerCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal GetBomsByVerCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public string Result { + get { + this.RaiseExceptionIfNecessary(); + return ((string)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + public delegate void GetBomCompletedEventHandler(object sender, GetBomCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class GetBomCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal GetBomCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public string Result { + get { + this.RaiseExceptionIfNecessary(); + return ((string)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + public delegate void UpdateDataCompletedEventHandler(object sender, UpdateDataCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class UpdateDataCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal UpdateDataCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public string Result { + get { + this.RaiseExceptionIfNecessary(); + return ((string)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + public delegate void SaveSeqencingCompletedEventHandler(object sender, SaveSeqencingCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class SaveSeqencingCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal SaveSeqencingCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public string Result { + get { + this.RaiseExceptionIfNecessary(); + return ((string)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + public delegate void AddMutualDataCompletedEventHandler(object sender, AddMutualDataCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class AddMutualDataCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal AddMutualDataCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public string Result { + get { + this.RaiseExceptionIfNecessary(); + return ((string)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + public delegate void ReceiveProductsCompletedEventHandler(object sender, ReceiveProductsCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class ReceiveProductsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal ReceiveProductsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public string Result { + get { + this.RaiseExceptionIfNecessary(); + return ((string)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + public delegate void ContainerReceiveCompletedEventHandler(object sender, ContainerReceiveCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class ContainerReceiveCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal ContainerReceiveCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public string Result { + get { + this.RaiseExceptionIfNecessary(); + return ((string)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + public delegate void ContainerOutCompletedEventHandler(object sender, ContainerOutCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class ContainerOutCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal ContainerOutCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public string Result { + get { + this.RaiseExceptionIfNecessary(); + return ((string)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + public delegate void CheckComesbackCompletedEventHandler(object sender, CheckComesbackCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class CheckComesbackCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal CheckComesbackCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public string Result { + get { + this.RaiseExceptionIfNecessary(); + return ((string)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + public delegate void CreateBillMACompletedEventHandler(object sender, CreateBillMACompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class CreateBillMACompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal CreateBillMACompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public string Result { + get { + this.RaiseExceptionIfNecessary(); + return ((string)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + public delegate void AddMesFGFinCompletedEventHandler(object sender, AddMesFGFinCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class AddMesFGFinCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal AddMesFGFinCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public string Result { + get { + this.RaiseExceptionIfNecessary(); + return ((string)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + public delegate void UpdateBillStateCompletedEventHandler(object sender, UpdateBillStateCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class UpdateBillStateCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal UpdateBillStateCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public string Result { + get { + this.RaiseExceptionIfNecessary(); + return ((string)(this.results[0])); + } + } + } +} + +#pragma warning restore 1591 \ No newline at end of file diff --git a/Controller/Web References/BomListcompany/Reference.map b/Controller/Web References/BomListcompany/Reference.map new file mode 100644 index 0000000..70e59f1 --- /dev/null +++ b/Controller/Web References/BomListcompany/Reference.map @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/Controller/Web References/BomVersion/JsonService.disco b/Controller/Web References/BomVersion/JsonService.disco new file mode 100644 index 0000000..b7c36dc --- /dev/null +++ b/Controller/Web References/BomVersion/JsonService.disco @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/Controller/Web References/BomVersion/JsonService.wsdl b/Controller/Web References/BomVersion/JsonService.wsdl new file mode 100644 index 0000000..c2e5a6d --- /dev/null +++ b/Controller/Web References/BomVersion/JsonService.wsdl @@ -0,0 +1,1333 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Controller/Web References/BomVersion/Reference.cs b/Controller/Web References/BomVersion/Reference.cs new file mode 100644 index 0000000..1999923 --- /dev/null +++ b/Controller/Web References/BomVersion/Reference.cs @@ -0,0 +1,1064 @@ +//------------------------------------------------------------------------------ +// +// 此代码由工具生成。 +// 运行时版本:4.0.30319.42000 +// +// 对此文件的更改可能会导致不正确的行为,并且如果 +// 重新生成代码,这些更改将会丢失。 +// +//------------------------------------------------------------------------------ + +// +// 此源代码是由 Microsoft.VSDesigner 4.0.30319.42000 版自动生成。 +// +#pragma warning disable 1591 + +namespace CK.SCP.Controller.BomVersion { + using System; + using System.Web.Services; + using System.Diagnostics; + using System.Web.Services.Protocols; + using System.Xml.Serialization; + using System.ComponentModel; + + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name="JsonServiceSoap", Namespace="http://tempuri.org/")] + public partial class JsonService : System.Web.Services.Protocols.SoapHttpClientProtocol { + + private System.Threading.SendOrPostCallback GetVerOperationCompleted; + + private System.Threading.SendOrPostCallback WriteLogOperationCompleted; + + private System.Threading.SendOrPostCallback LoginOperationCompleted; + + private System.Threading.SendOrPostCallback LogoutOperationCompleted; + + private System.Threading.SendOrPostCallback ModifyPasswordOperationCompleted; + + private System.Threading.SendOrPostCallback GetServerTimeOperationCompleted; + + private System.Threading.SendOrPostCallback DecryptOperationCompleted; + + private System.Threading.SendOrPostCallback EncryptOperationCompleted; + + private System.Threading.SendOrPostCallback GetCountOperationCompleted; + + private System.Threading.SendOrPostCallback GetDataOperationCompleted; + + private System.Threading.SendOrPostCallback AddDataOperationCompleted; + + private System.Threading.SendOrPostCallback GetBomVersionOperationCompleted; + + private System.Threading.SendOrPostCallback UpdateDataOperationCompleted; + + private System.Threading.SendOrPostCallback SaveSeqencingOperationCompleted; + + private System.Threading.SendOrPostCallback AddMutualDataOperationCompleted; + + private System.Threading.SendOrPostCallback ReceiveProductsOperationCompleted; + + private bool useDefaultCredentialsSetExplicitly; + + /// + public JsonService() { + this.Url = global::CK.SCP.Controller.Properties.Settings.Default.CK_SCP_Controller_BomVersion_JsonService; + if ((this.IsLocalFileSystemWebService(this.Url) == true)) { + this.UseDefaultCredentials = true; + this.useDefaultCredentialsSetExplicitly = false; + } + else { + this.useDefaultCredentialsSetExplicitly = true; + } + } + + public new string Url { + get { + return base.Url; + } + set { + if ((((this.IsLocalFileSystemWebService(base.Url) == true) + && (this.useDefaultCredentialsSetExplicitly == false)) + && (this.IsLocalFileSystemWebService(value) == false))) { + base.UseDefaultCredentials = false; + } + base.Url = value; + } + } + + public new bool UseDefaultCredentials { + get { + return base.UseDefaultCredentials; + } + set { + base.UseDefaultCredentials = value; + this.useDefaultCredentialsSetExplicitly = true; + } + } + + /// + public event GetVerCompletedEventHandler GetVerCompleted; + + /// + public event WriteLogCompletedEventHandler WriteLogCompleted; + + /// + public event LoginCompletedEventHandler LoginCompleted; + + /// + public event LogoutCompletedEventHandler LogoutCompleted; + + /// + public event ModifyPasswordCompletedEventHandler ModifyPasswordCompleted; + + /// + public event GetServerTimeCompletedEventHandler GetServerTimeCompleted; + + /// + public event DecryptCompletedEventHandler DecryptCompleted; + + /// + public event EncryptCompletedEventHandler EncryptCompleted; + + /// + public event GetCountCompletedEventHandler GetCountCompleted; + + /// + public event GetDataCompletedEventHandler GetDataCompleted; + + /// + public event AddDataCompletedEventHandler AddDataCompleted; + + /// + public event GetBomVersionCompletedEventHandler GetBomVersionCompleted; + + /// + public event UpdateDataCompletedEventHandler UpdateDataCompleted; + + /// + public event SaveSeqencingCompletedEventHandler SaveSeqencingCompleted; + + /// + public event AddMutualDataCompletedEventHandler AddMutualDataCompleted; + + /// + public event ReceiveProductsCompletedEventHandler ReceiveProductsCompleted; + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/GetVer", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public string GetVer() { + object[] results = this.Invoke("GetVer", new object[0]); + return ((string)(results[0])); + } + + /// + public void GetVerAsync() { + this.GetVerAsync(null); + } + + /// + public void GetVerAsync(object userState) { + if ((this.GetVerOperationCompleted == null)) { + this.GetVerOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetVerOperationCompleted); + } + this.InvokeAsync("GetVer", new object[0], this.GetVerOperationCompleted, userState); + } + + private void OnGetVerOperationCompleted(object arg) { + if ((this.GetVerCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.GetVerCompleted(this, new GetVerCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/WriteLog", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public string WriteLog(string operCode, string function, string message) { + object[] results = this.Invoke("WriteLog", new object[] { + operCode, + function, + message}); + return ((string)(results[0])); + } + + /// + public void WriteLogAsync(string operCode, string function, string message) { + this.WriteLogAsync(operCode, function, message, null); + } + + /// + public void WriteLogAsync(string operCode, string function, string message, object userState) { + if ((this.WriteLogOperationCompleted == null)) { + this.WriteLogOperationCompleted = new System.Threading.SendOrPostCallback(this.OnWriteLogOperationCompleted); + } + this.InvokeAsync("WriteLog", new object[] { + operCode, + function, + message}, this.WriteLogOperationCompleted, userState); + } + + private void OnWriteLogOperationCompleted(object arg) { + if ((this.WriteLogCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.WriteLogCompleted(this, new WriteLogCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/Login", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public string Login(string operCode, string password) { + object[] results = this.Invoke("Login", new object[] { + operCode, + password}); + return ((string)(results[0])); + } + + /// + public void LoginAsync(string operCode, string password) { + this.LoginAsync(operCode, password, null); + } + + /// + public void LoginAsync(string operCode, string password, object userState) { + if ((this.LoginOperationCompleted == null)) { + this.LoginOperationCompleted = new System.Threading.SendOrPostCallback(this.OnLoginOperationCompleted); + } + this.InvokeAsync("Login", new object[] { + operCode, + password}, this.LoginOperationCompleted, userState); + } + + private void OnLoginOperationCompleted(object arg) { + if ((this.LoginCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.LoginCompleted(this, new LoginCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/Logout", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public string Logout(string operCode) { + object[] results = this.Invoke("Logout", new object[] { + operCode}); + return ((string)(results[0])); + } + + /// + public void LogoutAsync(string operCode) { + this.LogoutAsync(operCode, null); + } + + /// + public void LogoutAsync(string operCode, object userState) { + if ((this.LogoutOperationCompleted == null)) { + this.LogoutOperationCompleted = new System.Threading.SendOrPostCallback(this.OnLogoutOperationCompleted); + } + this.InvokeAsync("Logout", new object[] { + operCode}, this.LogoutOperationCompleted, userState); + } + + private void OnLogoutOperationCompleted(object arg) { + if ((this.LogoutCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.LogoutCompleted(this, new LogoutCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/ModifyPassword", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public string ModifyPassword(string operCode, string oldPass, string newPass) { + object[] results = this.Invoke("ModifyPassword", new object[] { + operCode, + oldPass, + newPass}); + return ((string)(results[0])); + } + + /// + public void ModifyPasswordAsync(string operCode, string oldPass, string newPass) { + this.ModifyPasswordAsync(operCode, oldPass, newPass, null); + } + + /// + public void ModifyPasswordAsync(string operCode, string oldPass, string newPass, object userState) { + if ((this.ModifyPasswordOperationCompleted == null)) { + this.ModifyPasswordOperationCompleted = new System.Threading.SendOrPostCallback(this.OnModifyPasswordOperationCompleted); + } + this.InvokeAsync("ModifyPassword", new object[] { + operCode, + oldPass, + newPass}, this.ModifyPasswordOperationCompleted, userState); + } + + private void OnModifyPasswordOperationCompleted(object arg) { + if ((this.ModifyPasswordCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.ModifyPasswordCompleted(this, new ModifyPasswordCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/GetServerTime", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public System.DateTime GetServerTime() { + object[] results = this.Invoke("GetServerTime", new object[0]); + return ((System.DateTime)(results[0])); + } + + /// + public void GetServerTimeAsync() { + this.GetServerTimeAsync(null); + } + + /// + public void GetServerTimeAsync(object userState) { + if ((this.GetServerTimeOperationCompleted == null)) { + this.GetServerTimeOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetServerTimeOperationCompleted); + } + this.InvokeAsync("GetServerTime", new object[0], this.GetServerTimeOperationCompleted, userState); + } + + private void OnGetServerTimeOperationCompleted(object arg) { + if ((this.GetServerTimeCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.GetServerTimeCompleted(this, new GetServerTimeCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/Decrypt", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public string Decrypt(string str) { + object[] results = this.Invoke("Decrypt", new object[] { + str}); + return ((string)(results[0])); + } + + /// + public void DecryptAsync(string str) { + this.DecryptAsync(str, null); + } + + /// + public void DecryptAsync(string str, object userState) { + if ((this.DecryptOperationCompleted == null)) { + this.DecryptOperationCompleted = new System.Threading.SendOrPostCallback(this.OnDecryptOperationCompleted); + } + this.InvokeAsync("Decrypt", new object[] { + str}, this.DecryptOperationCompleted, userState); + } + + private void OnDecryptOperationCompleted(object arg) { + if ((this.DecryptCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.DecryptCompleted(this, new DecryptCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/Encrypt", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public string Encrypt(string str) { + object[] results = this.Invoke("Encrypt", new object[] { + str}); + return ((string)(results[0])); + } + + /// + public void EncryptAsync(string str) { + this.EncryptAsync(str, null); + } + + /// + public void EncryptAsync(string str, object userState) { + if ((this.EncryptOperationCompleted == null)) { + this.EncryptOperationCompleted = new System.Threading.SendOrPostCallback(this.OnEncryptOperationCompleted); + } + this.InvokeAsync("Encrypt", new object[] { + str}, this.EncryptOperationCompleted, userState); + } + + private void OnEncryptOperationCompleted(object arg) { + if ((this.EncryptCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.EncryptCompleted(this, new EncryptCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/GetCount", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public int GetCount(string jsonParam) { + object[] results = this.Invoke("GetCount", new object[] { + jsonParam}); + return ((int)(results[0])); + } + + /// + public void GetCountAsync(string jsonParam) { + this.GetCountAsync(jsonParam, null); + } + + /// + public void GetCountAsync(string jsonParam, object userState) { + if ((this.GetCountOperationCompleted == null)) { + this.GetCountOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetCountOperationCompleted); + } + this.InvokeAsync("GetCount", new object[] { + jsonParam}, this.GetCountOperationCompleted, userState); + } + + private void OnGetCountOperationCompleted(object arg) { + if ((this.GetCountCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.GetCountCompleted(this, new GetCountCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/GetData", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public string GetData(string jsonParam) { + object[] results = this.Invoke("GetData", new object[] { + jsonParam}); + return ((string)(results[0])); + } + + /// + public void GetDataAsync(string jsonParam) { + this.GetDataAsync(jsonParam, null); + } + + /// + public void GetDataAsync(string jsonParam, object userState) { + if ((this.GetDataOperationCompleted == null)) { + this.GetDataOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetDataOperationCompleted); + } + this.InvokeAsync("GetData", new object[] { + jsonParam}, this.GetDataOperationCompleted, userState); + } + + private void OnGetDataOperationCompleted(object arg) { + if ((this.GetDataCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.GetDataCompleted(this, new GetDataCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/AddData", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public string AddData(string jsonParam, string strJson) { + object[] results = this.Invoke("AddData", new object[] { + jsonParam, + strJson}); + return ((string)(results[0])); + } + + /// + public void AddDataAsync(string jsonParam, string strJson) { + this.AddDataAsync(jsonParam, strJson, null); + } + + /// + public void AddDataAsync(string jsonParam, string strJson, object userState) { + if ((this.AddDataOperationCompleted == null)) { + this.AddDataOperationCompleted = new System.Threading.SendOrPostCallback(this.OnAddDataOperationCompleted); + } + this.InvokeAsync("AddData", new object[] { + jsonParam, + strJson}, this.AddDataOperationCompleted, userState); + } + + private void OnAddDataOperationCompleted(object arg) { + if ((this.AddDataCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.AddDataCompleted(this, new AddDataCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/GetBomVersion", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public string GetBomVersion(string ParentPartCode, string SubPartCode) { + object[] results = this.Invoke("GetBomVersion", new object[] { + ParentPartCode, + SubPartCode}); + return ((string)(results[0])); + } + + /// + public void GetBomVersionAsync(string ParentPartCode, string SubPartCode) { + this.GetBomVersionAsync(ParentPartCode, SubPartCode, null); + } + + /// + public void GetBomVersionAsync(string ParentPartCode, string SubPartCode, object userState) { + if ((this.GetBomVersionOperationCompleted == null)) { + this.GetBomVersionOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetBomVersionOperationCompleted); + } + this.InvokeAsync("GetBomVersion", new object[] { + ParentPartCode, + SubPartCode}, this.GetBomVersionOperationCompleted, userState); + } + + private void OnGetBomVersionOperationCompleted(object arg) { + if ((this.GetBomVersionCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.GetBomVersionCompleted(this, new GetBomVersionCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/UpdateData", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public string UpdateData(string jsonParam, string strJson) { + object[] results = this.Invoke("UpdateData", new object[] { + jsonParam, + strJson}); + return ((string)(results[0])); + } + + /// + public void UpdateDataAsync(string jsonParam, string strJson) { + this.UpdateDataAsync(jsonParam, strJson, null); + } + + /// + public void UpdateDataAsync(string jsonParam, string strJson, object userState) { + if ((this.UpdateDataOperationCompleted == null)) { + this.UpdateDataOperationCompleted = new System.Threading.SendOrPostCallback(this.OnUpdateDataOperationCompleted); + } + this.InvokeAsync("UpdateData", new object[] { + jsonParam, + strJson}, this.UpdateDataOperationCompleted, userState); + } + + private void OnUpdateDataOperationCompleted(object arg) { + if ((this.UpdateDataCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.UpdateDataCompleted(this, new UpdateDataCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/SaveSeqencing", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public string SaveSeqencing(string strJson) { + object[] results = this.Invoke("SaveSeqencing", new object[] { + strJson}); + return ((string)(results[0])); + } + + /// + public void SaveSeqencingAsync(string strJson) { + this.SaveSeqencingAsync(strJson, null); + } + + /// + public void SaveSeqencingAsync(string strJson, object userState) { + if ((this.SaveSeqencingOperationCompleted == null)) { + this.SaveSeqencingOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSaveSeqencingOperationCompleted); + } + this.InvokeAsync("SaveSeqencing", new object[] { + strJson}, this.SaveSeqencingOperationCompleted, userState); + } + + private void OnSaveSeqencingOperationCompleted(object arg) { + if ((this.SaveSeqencingCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.SaveSeqencingCompleted(this, new SaveSeqencingCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/AddMutualData", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public string AddMutualData(string jsonParam, string strJson) { + object[] results = this.Invoke("AddMutualData", new object[] { + jsonParam, + strJson}); + return ((string)(results[0])); + } + + /// + public void AddMutualDataAsync(string jsonParam, string strJson) { + this.AddMutualDataAsync(jsonParam, strJson, null); + } + + /// + public void AddMutualDataAsync(string jsonParam, string strJson, object userState) { + if ((this.AddMutualDataOperationCompleted == null)) { + this.AddMutualDataOperationCompleted = new System.Threading.SendOrPostCallback(this.OnAddMutualDataOperationCompleted); + } + this.InvokeAsync("AddMutualData", new object[] { + jsonParam, + strJson}, this.AddMutualDataOperationCompleted, userState); + } + + private void OnAddMutualDataOperationCompleted(object arg) { + if ((this.AddMutualDataCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.AddMutualDataCompleted(this, new AddMutualDataCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/ReceiveProducts", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public string ReceiveProducts(string jsonParam) { + object[] results = this.Invoke("ReceiveProducts", new object[] { + jsonParam}); + return ((string)(results[0])); + } + + /// + public void ReceiveProductsAsync(string jsonParam) { + this.ReceiveProductsAsync(jsonParam, null); + } + + /// + public void ReceiveProductsAsync(string jsonParam, object userState) { + if ((this.ReceiveProductsOperationCompleted == null)) { + this.ReceiveProductsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnReceiveProductsOperationCompleted); + } + this.InvokeAsync("ReceiveProducts", new object[] { + jsonParam}, this.ReceiveProductsOperationCompleted, userState); + } + + private void OnReceiveProductsOperationCompleted(object arg) { + if ((this.ReceiveProductsCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.ReceiveProductsCompleted(this, new ReceiveProductsCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + public new void CancelAsync(object userState) { + base.CancelAsync(userState); + } + + private bool IsLocalFileSystemWebService(string url) { + if (((url == null) + || (url == string.Empty))) { + return false; + } + System.Uri wsUri = new System.Uri(url); + if (((wsUri.Port >= 1024) + && (string.Compare(wsUri.Host, "localHost", System.StringComparison.OrdinalIgnoreCase) == 0))) { + return true; + } + return false; + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + public delegate void GetVerCompletedEventHandler(object sender, GetVerCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class GetVerCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal GetVerCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public string Result { + get { + this.RaiseExceptionIfNecessary(); + return ((string)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + public delegate void WriteLogCompletedEventHandler(object sender, WriteLogCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class WriteLogCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal WriteLogCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public string Result { + get { + this.RaiseExceptionIfNecessary(); + return ((string)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + public delegate void LoginCompletedEventHandler(object sender, LoginCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class LoginCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal LoginCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public string Result { + get { + this.RaiseExceptionIfNecessary(); + return ((string)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + public delegate void LogoutCompletedEventHandler(object sender, LogoutCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class LogoutCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal LogoutCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public string Result { + get { + this.RaiseExceptionIfNecessary(); + return ((string)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + public delegate void ModifyPasswordCompletedEventHandler(object sender, ModifyPasswordCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class ModifyPasswordCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal ModifyPasswordCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public string Result { + get { + this.RaiseExceptionIfNecessary(); + return ((string)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + public delegate void GetServerTimeCompletedEventHandler(object sender, GetServerTimeCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class GetServerTimeCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal GetServerTimeCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public System.DateTime Result { + get { + this.RaiseExceptionIfNecessary(); + return ((System.DateTime)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + public delegate void DecryptCompletedEventHandler(object sender, DecryptCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class DecryptCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal DecryptCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public string Result { + get { + this.RaiseExceptionIfNecessary(); + return ((string)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + public delegate void EncryptCompletedEventHandler(object sender, EncryptCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class EncryptCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal EncryptCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public string Result { + get { + this.RaiseExceptionIfNecessary(); + return ((string)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + public delegate void GetCountCompletedEventHandler(object sender, GetCountCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class GetCountCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal GetCountCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public int Result { + get { + this.RaiseExceptionIfNecessary(); + return ((int)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + public delegate void GetDataCompletedEventHandler(object sender, GetDataCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class GetDataCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal GetDataCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public string Result { + get { + this.RaiseExceptionIfNecessary(); + return ((string)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + public delegate void AddDataCompletedEventHandler(object sender, AddDataCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class AddDataCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal AddDataCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public string Result { + get { + this.RaiseExceptionIfNecessary(); + return ((string)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + public delegate void GetBomVersionCompletedEventHandler(object sender, GetBomVersionCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class GetBomVersionCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal GetBomVersionCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public string Result { + get { + this.RaiseExceptionIfNecessary(); + return ((string)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + public delegate void UpdateDataCompletedEventHandler(object sender, UpdateDataCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class UpdateDataCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal UpdateDataCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public string Result { + get { + this.RaiseExceptionIfNecessary(); + return ((string)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + public delegate void SaveSeqencingCompletedEventHandler(object sender, SaveSeqencingCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class SaveSeqencingCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal SaveSeqencingCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public string Result { + get { + this.RaiseExceptionIfNecessary(); + return ((string)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + public delegate void AddMutualDataCompletedEventHandler(object sender, AddMutualDataCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class AddMutualDataCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal AddMutualDataCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public string Result { + get { + this.RaiseExceptionIfNecessary(); + return ((string)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + public delegate void ReceiveProductsCompletedEventHandler(object sender, ReceiveProductsCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class ReceiveProductsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal ReceiveProductsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public string Result { + get { + this.RaiseExceptionIfNecessary(); + return ((string)(this.results[0])); + } + } + } +} + +#pragma warning restore 1591 \ No newline at end of file diff --git a/Controller/Web References/BomVersion/Reference.map b/Controller/Web References/BomVersion/Reference.map new file mode 100644 index 0000000..169d3db --- /dev/null +++ b/Controller/Web References/BomVersion/Reference.map @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/Controller/Web References/BomVersion1/JsonService.disco b/Controller/Web References/BomVersion1/JsonService.disco new file mode 100644 index 0000000..9e8e3a5 --- /dev/null +++ b/Controller/Web References/BomVersion1/JsonService.disco @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/Controller/Web References/BomVersion1/JsonService.wsdl b/Controller/Web References/BomVersion1/JsonService.wsdl new file mode 100644 index 0000000..ee8f7fb --- /dev/null +++ b/Controller/Web References/BomVersion1/JsonService.wsdl @@ -0,0 +1,1816 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Controller/Web References/BomVersion1/Reference.cs b/Controller/Web References/BomVersion1/Reference.cs new file mode 100644 index 0000000..220393c --- /dev/null +++ b/Controller/Web References/BomVersion1/Reference.cs @@ -0,0 +1,1426 @@ +//------------------------------------------------------------------------------ +// +// 此代码由工具生成。 +// 运行时版本:4.0.30319.42000 +// +// 对此文件的更改可能会导致不正确的行为,并且如果 +// 重新生成代码,这些更改将会丢失。 +// +//------------------------------------------------------------------------------ + +// +// 此源代码是由 Microsoft.VSDesigner 4.0.30319.42000 版自动生成。 +// +#pragma warning disable 1591 + +namespace CK.SCP.Controller.BomVersion1 { + using System; + using System.Web.Services; + using System.Diagnostics; + using System.Web.Services.Protocols; + using System.Xml.Serialization; + using System.ComponentModel; + + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name="JsonServiceSoap", Namespace="http://tempuri.org/")] + public partial class JsonService : System.Web.Services.Protocols.SoapHttpClientProtocol { + + private System.Threading.SendOrPostCallback GetVerOperationCompleted; + + private System.Threading.SendOrPostCallback WriteLogOperationCompleted; + + private System.Threading.SendOrPostCallback LoginOperationCompleted; + + private System.Threading.SendOrPostCallback NewLoginOperationCompleted; + + private System.Threading.SendOrPostCallback LogoutOperationCompleted; + + private System.Threading.SendOrPostCallback ModifyPasswordOperationCompleted; + + private System.Threading.SendOrPostCallback GetServerTimeOperationCompleted; + + private System.Threading.SendOrPostCallback DecryptOperationCompleted; + + private System.Threading.SendOrPostCallback EncryptOperationCompleted; + + private System.Threading.SendOrPostCallback GetCountOperationCompleted; + + private System.Threading.SendOrPostCallback GetDataOperationCompleted; + + private System.Threading.SendOrPostCallback AddDataOperationCompleted; + + private System.Threading.SendOrPostCallback GetBomVersionOperationCompleted; + + private System.Threading.SendOrPostCallback UpdateDataOperationCompleted; + + private System.Threading.SendOrPostCallback SaveSeqencingOperationCompleted; + + private System.Threading.SendOrPostCallback AddMutualDataOperationCompleted; + + private System.Threading.SendOrPostCallback ReceiveProductsOperationCompleted; + + private System.Threading.SendOrPostCallback ContainerReceiveOperationCompleted; + + private System.Threading.SendOrPostCallback ContainerOutOperationCompleted; + + private System.Threading.SendOrPostCallback CheckComesbackOperationCompleted; + + private System.Threading.SendOrPostCallback CreateBillMAOperationCompleted; + + private System.Threading.SendOrPostCallback AddMesFGFinOperationCompleted; + + private bool useDefaultCredentialsSetExplicitly; + + /// + public JsonService() { + this.Url = global::CK.SCP.Controller.Properties.Settings.Default.CK_SCP_Controller_BomVersion1_JsonService; + if ((this.IsLocalFileSystemWebService(this.Url) == true)) { + this.UseDefaultCredentials = true; + this.useDefaultCredentialsSetExplicitly = false; + } + else { + this.useDefaultCredentialsSetExplicitly = true; + } + } + + public new string Url { + get { + return base.Url; + } + set { + if ((((this.IsLocalFileSystemWebService(base.Url) == true) + && (this.useDefaultCredentialsSetExplicitly == false)) + && (this.IsLocalFileSystemWebService(value) == false))) { + base.UseDefaultCredentials = false; + } + base.Url = value; + } + } + + public new bool UseDefaultCredentials { + get { + return base.UseDefaultCredentials; + } + set { + base.UseDefaultCredentials = value; + this.useDefaultCredentialsSetExplicitly = true; + } + } + + /// + public event GetVerCompletedEventHandler GetVerCompleted; + + /// + public event WriteLogCompletedEventHandler WriteLogCompleted; + + /// + public event LoginCompletedEventHandler LoginCompleted; + + /// + public event NewLoginCompletedEventHandler NewLoginCompleted; + + /// + public event LogoutCompletedEventHandler LogoutCompleted; + + /// + public event ModifyPasswordCompletedEventHandler ModifyPasswordCompleted; + + /// + public event GetServerTimeCompletedEventHandler GetServerTimeCompleted; + + /// + public event DecryptCompletedEventHandler DecryptCompleted; + + /// + public event EncryptCompletedEventHandler EncryptCompleted; + + /// + public event GetCountCompletedEventHandler GetCountCompleted; + + /// + public event GetDataCompletedEventHandler GetDataCompleted; + + /// + public event AddDataCompletedEventHandler AddDataCompleted; + + /// + public event GetBomVersionCompletedEventHandler GetBomVersionCompleted; + + /// + public event UpdateDataCompletedEventHandler UpdateDataCompleted; + + /// + public event SaveSeqencingCompletedEventHandler SaveSeqencingCompleted; + + /// + public event AddMutualDataCompletedEventHandler AddMutualDataCompleted; + + /// + public event ReceiveProductsCompletedEventHandler ReceiveProductsCompleted; + + /// + public event ContainerReceiveCompletedEventHandler ContainerReceiveCompleted; + + /// + public event ContainerOutCompletedEventHandler ContainerOutCompleted; + + /// + public event CheckComesbackCompletedEventHandler CheckComesbackCompleted; + + /// + public event CreateBillMACompletedEventHandler CreateBillMACompleted; + + /// + public event AddMesFGFinCompletedEventHandler AddMesFGFinCompleted; + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/GetVer", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public string GetVer() { + object[] results = this.Invoke("GetVer", new object[0]); + return ((string)(results[0])); + } + + /// + public void GetVerAsync() { + this.GetVerAsync(null); + } + + /// + public void GetVerAsync(object userState) { + if ((this.GetVerOperationCompleted == null)) { + this.GetVerOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetVerOperationCompleted); + } + this.InvokeAsync("GetVer", new object[0], this.GetVerOperationCompleted, userState); + } + + private void OnGetVerOperationCompleted(object arg) { + if ((this.GetVerCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.GetVerCompleted(this, new GetVerCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/WriteLog", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public string WriteLog(string operCode, string function, string message) { + object[] results = this.Invoke("WriteLog", new object[] { + operCode, + function, + message}); + return ((string)(results[0])); + } + + /// + public void WriteLogAsync(string operCode, string function, string message) { + this.WriteLogAsync(operCode, function, message, null); + } + + /// + public void WriteLogAsync(string operCode, string function, string message, object userState) { + if ((this.WriteLogOperationCompleted == null)) { + this.WriteLogOperationCompleted = new System.Threading.SendOrPostCallback(this.OnWriteLogOperationCompleted); + } + this.InvokeAsync("WriteLog", new object[] { + operCode, + function, + message}, this.WriteLogOperationCompleted, userState); + } + + private void OnWriteLogOperationCompleted(object arg) { + if ((this.WriteLogCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.WriteLogCompleted(this, new WriteLogCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/Login", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public string Login(string operCode, string password) { + object[] results = this.Invoke("Login", new object[] { + operCode, + password}); + return ((string)(results[0])); + } + + /// + public void LoginAsync(string operCode, string password) { + this.LoginAsync(operCode, password, null); + } + + /// + public void LoginAsync(string operCode, string password, object userState) { + if ((this.LoginOperationCompleted == null)) { + this.LoginOperationCompleted = new System.Threading.SendOrPostCallback(this.OnLoginOperationCompleted); + } + this.InvokeAsync("Login", new object[] { + operCode, + password}, this.LoginOperationCompleted, userState); + } + + private void OnLoginOperationCompleted(object arg) { + if ((this.LoginCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.LoginCompleted(this, new LoginCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/NewLogin", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public string NewLogin(string operCode, string password) { + object[] results = this.Invoke("NewLogin", new object[] { + operCode, + password}); + return ((string)(results[0])); + } + + /// + public void NewLoginAsync(string operCode, string password) { + this.NewLoginAsync(operCode, password, null); + } + + /// + public void NewLoginAsync(string operCode, string password, object userState) { + if ((this.NewLoginOperationCompleted == null)) { + this.NewLoginOperationCompleted = new System.Threading.SendOrPostCallback(this.OnNewLoginOperationCompleted); + } + this.InvokeAsync("NewLogin", new object[] { + operCode, + password}, this.NewLoginOperationCompleted, userState); + } + + private void OnNewLoginOperationCompleted(object arg) { + if ((this.NewLoginCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.NewLoginCompleted(this, new NewLoginCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/Logout", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public string Logout(string operCode) { + object[] results = this.Invoke("Logout", new object[] { + operCode}); + return ((string)(results[0])); + } + + /// + public void LogoutAsync(string operCode) { + this.LogoutAsync(operCode, null); + } + + /// + public void LogoutAsync(string operCode, object userState) { + if ((this.LogoutOperationCompleted == null)) { + this.LogoutOperationCompleted = new System.Threading.SendOrPostCallback(this.OnLogoutOperationCompleted); + } + this.InvokeAsync("Logout", new object[] { + operCode}, this.LogoutOperationCompleted, userState); + } + + private void OnLogoutOperationCompleted(object arg) { + if ((this.LogoutCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.LogoutCompleted(this, new LogoutCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/ModifyPassword", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public string ModifyPassword(string operCode, string oldPass, string newPass) { + object[] results = this.Invoke("ModifyPassword", new object[] { + operCode, + oldPass, + newPass}); + return ((string)(results[0])); + } + + /// + public void ModifyPasswordAsync(string operCode, string oldPass, string newPass) { + this.ModifyPasswordAsync(operCode, oldPass, newPass, null); + } + + /// + public void ModifyPasswordAsync(string operCode, string oldPass, string newPass, object userState) { + if ((this.ModifyPasswordOperationCompleted == null)) { + this.ModifyPasswordOperationCompleted = new System.Threading.SendOrPostCallback(this.OnModifyPasswordOperationCompleted); + } + this.InvokeAsync("ModifyPassword", new object[] { + operCode, + oldPass, + newPass}, this.ModifyPasswordOperationCompleted, userState); + } + + private void OnModifyPasswordOperationCompleted(object arg) { + if ((this.ModifyPasswordCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.ModifyPasswordCompleted(this, new ModifyPasswordCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/GetServerTime", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public System.DateTime GetServerTime() { + object[] results = this.Invoke("GetServerTime", new object[0]); + return ((System.DateTime)(results[0])); + } + + /// + public void GetServerTimeAsync() { + this.GetServerTimeAsync(null); + } + + /// + public void GetServerTimeAsync(object userState) { + if ((this.GetServerTimeOperationCompleted == null)) { + this.GetServerTimeOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetServerTimeOperationCompleted); + } + this.InvokeAsync("GetServerTime", new object[0], this.GetServerTimeOperationCompleted, userState); + } + + private void OnGetServerTimeOperationCompleted(object arg) { + if ((this.GetServerTimeCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.GetServerTimeCompleted(this, new GetServerTimeCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/Decrypt", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public string Decrypt(string str) { + object[] results = this.Invoke("Decrypt", new object[] { + str}); + return ((string)(results[0])); + } + + /// + public void DecryptAsync(string str) { + this.DecryptAsync(str, null); + } + + /// + public void DecryptAsync(string str, object userState) { + if ((this.DecryptOperationCompleted == null)) { + this.DecryptOperationCompleted = new System.Threading.SendOrPostCallback(this.OnDecryptOperationCompleted); + } + this.InvokeAsync("Decrypt", new object[] { + str}, this.DecryptOperationCompleted, userState); + } + + private void OnDecryptOperationCompleted(object arg) { + if ((this.DecryptCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.DecryptCompleted(this, new DecryptCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/Encrypt", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public string Encrypt(string str) { + object[] results = this.Invoke("Encrypt", new object[] { + str}); + return ((string)(results[0])); + } + + /// + public void EncryptAsync(string str) { + this.EncryptAsync(str, null); + } + + /// + public void EncryptAsync(string str, object userState) { + if ((this.EncryptOperationCompleted == null)) { + this.EncryptOperationCompleted = new System.Threading.SendOrPostCallback(this.OnEncryptOperationCompleted); + } + this.InvokeAsync("Encrypt", new object[] { + str}, this.EncryptOperationCompleted, userState); + } + + private void OnEncryptOperationCompleted(object arg) { + if ((this.EncryptCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.EncryptCompleted(this, new EncryptCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/GetCount", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public int GetCount(string jsonParam) { + object[] results = this.Invoke("GetCount", new object[] { + jsonParam}); + return ((int)(results[0])); + } + + /// + public void GetCountAsync(string jsonParam) { + this.GetCountAsync(jsonParam, null); + } + + /// + public void GetCountAsync(string jsonParam, object userState) { + if ((this.GetCountOperationCompleted == null)) { + this.GetCountOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetCountOperationCompleted); + } + this.InvokeAsync("GetCount", new object[] { + jsonParam}, this.GetCountOperationCompleted, userState); + } + + private void OnGetCountOperationCompleted(object arg) { + if ((this.GetCountCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.GetCountCompleted(this, new GetCountCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/GetData", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public string GetData(string jsonParam) { + object[] results = this.Invoke("GetData", new object[] { + jsonParam}); + return ((string)(results[0])); + } + + /// + public void GetDataAsync(string jsonParam) { + this.GetDataAsync(jsonParam, null); + } + + /// + public void GetDataAsync(string jsonParam, object userState) { + if ((this.GetDataOperationCompleted == null)) { + this.GetDataOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetDataOperationCompleted); + } + this.InvokeAsync("GetData", new object[] { + jsonParam}, this.GetDataOperationCompleted, userState); + } + + private void OnGetDataOperationCompleted(object arg) { + if ((this.GetDataCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.GetDataCompleted(this, new GetDataCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/AddData", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public string AddData(string jsonParam, string strJson) { + object[] results = this.Invoke("AddData", new object[] { + jsonParam, + strJson}); + return ((string)(results[0])); + } + + /// + public void AddDataAsync(string jsonParam, string strJson) { + this.AddDataAsync(jsonParam, strJson, null); + } + + /// + public void AddDataAsync(string jsonParam, string strJson, object userState) { + if ((this.AddDataOperationCompleted == null)) { + this.AddDataOperationCompleted = new System.Threading.SendOrPostCallback(this.OnAddDataOperationCompleted); + } + this.InvokeAsync("AddData", new object[] { + jsonParam, + strJson}, this.AddDataOperationCompleted, userState); + } + + private void OnAddDataOperationCompleted(object arg) { + if ((this.AddDataCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.AddDataCompleted(this, new AddDataCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/GetBomVersion", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public string GetBomVersion(string ParentPartCode, string SubPartCode) { + object[] results = this.Invoke("GetBomVersion", new object[] { + ParentPartCode, + SubPartCode}); + return ((string)(results[0])); + } + + /// + public void GetBomVersionAsync(string ParentPartCode, string SubPartCode) { + this.GetBomVersionAsync(ParentPartCode, SubPartCode, null); + } + + /// + public void GetBomVersionAsync(string ParentPartCode, string SubPartCode, object userState) { + if ((this.GetBomVersionOperationCompleted == null)) { + this.GetBomVersionOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetBomVersionOperationCompleted); + } + this.InvokeAsync("GetBomVersion", new object[] { + ParentPartCode, + SubPartCode}, this.GetBomVersionOperationCompleted, userState); + } + + private void OnGetBomVersionOperationCompleted(object arg) { + if ((this.GetBomVersionCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.GetBomVersionCompleted(this, new GetBomVersionCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/UpdateData", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public string UpdateData(string jsonParam, string strJson) { + object[] results = this.Invoke("UpdateData", new object[] { + jsonParam, + strJson}); + return ((string)(results[0])); + } + + /// + public void UpdateDataAsync(string jsonParam, string strJson) { + this.UpdateDataAsync(jsonParam, strJson, null); + } + + /// + public void UpdateDataAsync(string jsonParam, string strJson, object userState) { + if ((this.UpdateDataOperationCompleted == null)) { + this.UpdateDataOperationCompleted = new System.Threading.SendOrPostCallback(this.OnUpdateDataOperationCompleted); + } + this.InvokeAsync("UpdateData", new object[] { + jsonParam, + strJson}, this.UpdateDataOperationCompleted, userState); + } + + private void OnUpdateDataOperationCompleted(object arg) { + if ((this.UpdateDataCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.UpdateDataCompleted(this, new UpdateDataCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/SaveSeqencing", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public string SaveSeqencing(string strJson) { + object[] results = this.Invoke("SaveSeqencing", new object[] { + strJson}); + return ((string)(results[0])); + } + + /// + public void SaveSeqencingAsync(string strJson) { + this.SaveSeqencingAsync(strJson, null); + } + + /// + public void SaveSeqencingAsync(string strJson, object userState) { + if ((this.SaveSeqencingOperationCompleted == null)) { + this.SaveSeqencingOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSaveSeqencingOperationCompleted); + } + this.InvokeAsync("SaveSeqencing", new object[] { + strJson}, this.SaveSeqencingOperationCompleted, userState); + } + + private void OnSaveSeqencingOperationCompleted(object arg) { + if ((this.SaveSeqencingCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.SaveSeqencingCompleted(this, new SaveSeqencingCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/AddMutualData", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public string AddMutualData(string jsonParam, string strJson) { + object[] results = this.Invoke("AddMutualData", new object[] { + jsonParam, + strJson}); + return ((string)(results[0])); + } + + /// + public void AddMutualDataAsync(string jsonParam, string strJson) { + this.AddMutualDataAsync(jsonParam, strJson, null); + } + + /// + public void AddMutualDataAsync(string jsonParam, string strJson, object userState) { + if ((this.AddMutualDataOperationCompleted == null)) { + this.AddMutualDataOperationCompleted = new System.Threading.SendOrPostCallback(this.OnAddMutualDataOperationCompleted); + } + this.InvokeAsync("AddMutualData", new object[] { + jsonParam, + strJson}, this.AddMutualDataOperationCompleted, userState); + } + + private void OnAddMutualDataOperationCompleted(object arg) { + if ((this.AddMutualDataCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.AddMutualDataCompleted(this, new AddMutualDataCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/ReceiveProducts", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public string ReceiveProducts(string jsonParam) { + object[] results = this.Invoke("ReceiveProducts", new object[] { + jsonParam}); + return ((string)(results[0])); + } + + /// + public void ReceiveProductsAsync(string jsonParam) { + this.ReceiveProductsAsync(jsonParam, null); + } + + /// + public void ReceiveProductsAsync(string jsonParam, object userState) { + if ((this.ReceiveProductsOperationCompleted == null)) { + this.ReceiveProductsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnReceiveProductsOperationCompleted); + } + this.InvokeAsync("ReceiveProducts", new object[] { + jsonParam}, this.ReceiveProductsOperationCompleted, userState); + } + + private void OnReceiveProductsOperationCompleted(object arg) { + if ((this.ReceiveProductsCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.ReceiveProductsCompleted(this, new ReceiveProductsCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/ContainerReceive", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public string ContainerReceive(string strJson) { + object[] results = this.Invoke("ContainerReceive", new object[] { + strJson}); + return ((string)(results[0])); + } + + /// + public void ContainerReceiveAsync(string strJson) { + this.ContainerReceiveAsync(strJson, null); + } + + /// + public void ContainerReceiveAsync(string strJson, object userState) { + if ((this.ContainerReceiveOperationCompleted == null)) { + this.ContainerReceiveOperationCompleted = new System.Threading.SendOrPostCallback(this.OnContainerReceiveOperationCompleted); + } + this.InvokeAsync("ContainerReceive", new object[] { + strJson}, this.ContainerReceiveOperationCompleted, userState); + } + + private void OnContainerReceiveOperationCompleted(object arg) { + if ((this.ContainerReceiveCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.ContainerReceiveCompleted(this, new ContainerReceiveCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/ContainerOut", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public string ContainerOut(string strJson) { + object[] results = this.Invoke("ContainerOut", new object[] { + strJson}); + return ((string)(results[0])); + } + + /// + public void ContainerOutAsync(string strJson) { + this.ContainerOutAsync(strJson, null); + } + + /// + public void ContainerOutAsync(string strJson, object userState) { + if ((this.ContainerOutOperationCompleted == null)) { + this.ContainerOutOperationCompleted = new System.Threading.SendOrPostCallback(this.OnContainerOutOperationCompleted); + } + this.InvokeAsync("ContainerOut", new object[] { + strJson}, this.ContainerOutOperationCompleted, userState); + } + + private void OnContainerOutOperationCompleted(object arg) { + if ((this.ContainerOutCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.ContainerOutCompleted(this, new ContainerOutCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/CheckComesback", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public string CheckComesback(string strJson) { + object[] results = this.Invoke("CheckComesback", new object[] { + strJson}); + return ((string)(results[0])); + } + + /// + public void CheckComesbackAsync(string strJson) { + this.CheckComesbackAsync(strJson, null); + } + + /// + public void CheckComesbackAsync(string strJson, object userState) { + if ((this.CheckComesbackOperationCompleted == null)) { + this.CheckComesbackOperationCompleted = new System.Threading.SendOrPostCallback(this.OnCheckComesbackOperationCompleted); + } + this.InvokeAsync("CheckComesback", new object[] { + strJson}, this.CheckComesbackOperationCompleted, userState); + } + + private void OnCheckComesbackOperationCompleted(object arg) { + if ((this.CheckComesbackCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.CheckComesbackCompleted(this, new CheckComesbackCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/CreateBillMA", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public string CreateBillMA(string strJson) { + object[] results = this.Invoke("CreateBillMA", new object[] { + strJson}); + return ((string)(results[0])); + } + + /// + public void CreateBillMAAsync(string strJson) { + this.CreateBillMAAsync(strJson, null); + } + + /// + public void CreateBillMAAsync(string strJson, object userState) { + if ((this.CreateBillMAOperationCompleted == null)) { + this.CreateBillMAOperationCompleted = new System.Threading.SendOrPostCallback(this.OnCreateBillMAOperationCompleted); + } + this.InvokeAsync("CreateBillMA", new object[] { + strJson}, this.CreateBillMAOperationCompleted, userState); + } + + private void OnCreateBillMAOperationCompleted(object arg) { + if ((this.CreateBillMACompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.CreateBillMACompleted(this, new CreateBillMACompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/AddMesFGFin", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public string AddMesFGFin(string strJson) { + object[] results = this.Invoke("AddMesFGFin", new object[] { + strJson}); + return ((string)(results[0])); + } + + /// + public void AddMesFGFinAsync(string strJson) { + this.AddMesFGFinAsync(strJson, null); + } + + /// + public void AddMesFGFinAsync(string strJson, object userState) { + if ((this.AddMesFGFinOperationCompleted == null)) { + this.AddMesFGFinOperationCompleted = new System.Threading.SendOrPostCallback(this.OnAddMesFGFinOperationCompleted); + } + this.InvokeAsync("AddMesFGFin", new object[] { + strJson}, this.AddMesFGFinOperationCompleted, userState); + } + + private void OnAddMesFGFinOperationCompleted(object arg) { + if ((this.AddMesFGFinCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.AddMesFGFinCompleted(this, new AddMesFGFinCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + public new void CancelAsync(object userState) { + base.CancelAsync(userState); + } + + private bool IsLocalFileSystemWebService(string url) { + if (((url == null) + || (url == string.Empty))) { + return false; + } + System.Uri wsUri = new System.Uri(url); + if (((wsUri.Port >= 1024) + && (string.Compare(wsUri.Host, "localHost", System.StringComparison.OrdinalIgnoreCase) == 0))) { + return true; + } + return false; + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + public delegate void GetVerCompletedEventHandler(object sender, GetVerCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class GetVerCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal GetVerCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public string Result { + get { + this.RaiseExceptionIfNecessary(); + return ((string)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + public delegate void WriteLogCompletedEventHandler(object sender, WriteLogCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class WriteLogCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal WriteLogCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public string Result { + get { + this.RaiseExceptionIfNecessary(); + return ((string)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + public delegate void LoginCompletedEventHandler(object sender, LoginCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class LoginCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal LoginCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public string Result { + get { + this.RaiseExceptionIfNecessary(); + return ((string)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + public delegate void NewLoginCompletedEventHandler(object sender, NewLoginCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class NewLoginCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal NewLoginCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public string Result { + get { + this.RaiseExceptionIfNecessary(); + return ((string)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + public delegate void LogoutCompletedEventHandler(object sender, LogoutCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class LogoutCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal LogoutCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public string Result { + get { + this.RaiseExceptionIfNecessary(); + return ((string)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + public delegate void ModifyPasswordCompletedEventHandler(object sender, ModifyPasswordCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class ModifyPasswordCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal ModifyPasswordCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public string Result { + get { + this.RaiseExceptionIfNecessary(); + return ((string)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + public delegate void GetServerTimeCompletedEventHandler(object sender, GetServerTimeCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class GetServerTimeCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal GetServerTimeCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public System.DateTime Result { + get { + this.RaiseExceptionIfNecessary(); + return ((System.DateTime)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + public delegate void DecryptCompletedEventHandler(object sender, DecryptCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class DecryptCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal DecryptCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public string Result { + get { + this.RaiseExceptionIfNecessary(); + return ((string)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + public delegate void EncryptCompletedEventHandler(object sender, EncryptCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class EncryptCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal EncryptCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public string Result { + get { + this.RaiseExceptionIfNecessary(); + return ((string)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + public delegate void GetCountCompletedEventHandler(object sender, GetCountCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class GetCountCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal GetCountCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public int Result { + get { + this.RaiseExceptionIfNecessary(); + return ((int)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + public delegate void GetDataCompletedEventHandler(object sender, GetDataCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class GetDataCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal GetDataCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public string Result { + get { + this.RaiseExceptionIfNecessary(); + return ((string)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + public delegate void AddDataCompletedEventHandler(object sender, AddDataCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class AddDataCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal AddDataCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public string Result { + get { + this.RaiseExceptionIfNecessary(); + return ((string)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + public delegate void GetBomVersionCompletedEventHandler(object sender, GetBomVersionCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class GetBomVersionCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal GetBomVersionCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public string Result { + get { + this.RaiseExceptionIfNecessary(); + return ((string)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + public delegate void UpdateDataCompletedEventHandler(object sender, UpdateDataCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class UpdateDataCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal UpdateDataCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public string Result { + get { + this.RaiseExceptionIfNecessary(); + return ((string)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + public delegate void SaveSeqencingCompletedEventHandler(object sender, SaveSeqencingCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class SaveSeqencingCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal SaveSeqencingCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public string Result { + get { + this.RaiseExceptionIfNecessary(); + return ((string)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + public delegate void AddMutualDataCompletedEventHandler(object sender, AddMutualDataCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class AddMutualDataCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal AddMutualDataCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public string Result { + get { + this.RaiseExceptionIfNecessary(); + return ((string)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + public delegate void ReceiveProductsCompletedEventHandler(object sender, ReceiveProductsCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class ReceiveProductsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal ReceiveProductsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public string Result { + get { + this.RaiseExceptionIfNecessary(); + return ((string)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + public delegate void ContainerReceiveCompletedEventHandler(object sender, ContainerReceiveCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class ContainerReceiveCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal ContainerReceiveCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public string Result { + get { + this.RaiseExceptionIfNecessary(); + return ((string)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + public delegate void ContainerOutCompletedEventHandler(object sender, ContainerOutCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class ContainerOutCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal ContainerOutCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public string Result { + get { + this.RaiseExceptionIfNecessary(); + return ((string)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + public delegate void CheckComesbackCompletedEventHandler(object sender, CheckComesbackCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class CheckComesbackCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal CheckComesbackCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public string Result { + get { + this.RaiseExceptionIfNecessary(); + return ((string)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + public delegate void CreateBillMACompletedEventHandler(object sender, CreateBillMACompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class CreateBillMACompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal CreateBillMACompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public string Result { + get { + this.RaiseExceptionIfNecessary(); + return ((string)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + public delegate void AddMesFGFinCompletedEventHandler(object sender, AddMesFGFinCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class AddMesFGFinCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal AddMesFGFinCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public string Result { + get { + this.RaiseExceptionIfNecessary(); + return ((string)(this.results[0])); + } + } + } +} + +#pragma warning restore 1591 \ No newline at end of file diff --git a/Controller/Web References/BomVersion1/Reference.map b/Controller/Web References/BomVersion1/Reference.map new file mode 100644 index 0000000..0cff30e --- /dev/null +++ b/Controller/Web References/BomVersion1/Reference.map @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/Controller/app.config b/Controller/app.config index 51be330..8f6c9da 100644 --- a/Controller/app.config +++ b/Controller/app.config @@ -1,29 +1,52 @@ - + -
+
+ +
+ - - + + - - + + - + - + - \ No newline at end of file + + + + http://10.89.25.69:8085/JsonService.asmx + + + http://10.62.144.124:8016/JsonService.asmx + + + http://192.168.0.228:7602/JsonService.asmx + + + http://10.62.144.124:8070/JsonService.asmx + + + + + + + + diff --git a/Models/AppBoxEntity/AppBoxContext.cs b/Models/AppBoxEntity/AppBoxContext.cs index 1b2df8a..8e2d4f4 100644 --- a/Models/AppBoxEntity/AppBoxContext.cs +++ b/Models/AppBoxEntity/AppBoxContext.cs @@ -27,7 +27,8 @@ namespace CK.SCP.Models.AppBoxEntity public DbSet TA_FACTORY { get; set; } public DbSet VenderUsers { get; set; } - public DbSet FactoryUsers { get; set; } + public DbSet FactoryUsers { get; set; } + public DbSet UserTokens { get; set; } protected override void OnModelCreating(DbModelBuilder modelBuilder) { base.OnModelCreating(modelBuilder); diff --git a/Models/AppBoxEntity/User.cs b/Models/AppBoxEntity/User.cs index 1278da1..1e1e0ce 100644 --- a/Models/AppBoxEntity/User.cs +++ b/Models/AppBoxEntity/User.cs @@ -77,6 +77,10 @@ namespace CK.SCP.Models.AppBoxEntity public DateTime? LastLoginTime { get; set; } public DateTime? CreateTime { get; set; } + public int ErrorCount { get; set; } + + public DateTime LastUpdatePasswordTime { get; set; } = DateTime.Now; + public virtual ICollection TA_FACTORY { get; set; } /* public virtual ICollection FACTORY_ADDRESS { get; set; } diff --git a/Models/AppBoxEntity/UserToken.cs b/Models/AppBoxEntity/UserToken.cs new file mode 100644 index 0000000..9c6e2f2 --- /dev/null +++ b/Models/AppBoxEntity/UserToken.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace CK.SCP.Models.AppBoxEntity +{ + public class UserToken : IKeyID + { + [Key] + public int ID { get; set; } + + [Required, StringLength(50)] + public string UserName { get; set; } + + [StringLength(500)] + public string Token { get; set; } + + public System.DateTime CreateTime { get; set; } + + [StringLength(50)] + public string CreateUser { get; set; } + public Nullable UpdateTime { get; set; } + + [StringLength(50)] + public string UpdateUser { get; set; } + + [StringLength(500)] + public string Remark { get; set; } + } +} diff --git a/Models/CK.SCP.Models.csproj b/Models/CK.SCP.Models.csproj index b6c0c90..e6cfa8a 100644 --- a/Models/CK.SCP.Models.csproj +++ b/Models/CK.SCP.Models.csproj @@ -11,6 +11,7 @@ CK.SCP.Models v4.5.2 512 + true @@ -46,6 +47,7 @@ + @@ -53,6 +55,9 @@ + + ..\UniApiGroup\bin\Debug\Z.EntityFramework.Extensions.dll + @@ -72,6 +77,7 @@ + @@ -331,7 +337,11 @@ + + + + @@ -340,15 +350,34 @@ + + + + + + + + + + + + + + + + + + + @@ -376,6 +405,8 @@ + + @@ -385,6 +416,8 @@ + + @@ -425,6 +458,9 @@ + + + @@ -440,6 +476,8 @@ + + @@ -451,6 +489,11 @@ + + + + + diff --git a/Models/EntitiesFactory.cs b/Models/EntitiesFactory.cs index e5ec486..9d0f72f 100644 --- a/Models/EntitiesFactory.cs +++ b/Models/EntitiesFactory.cs @@ -174,7 +174,7 @@ namespace CK.SCP.Models { try { - db.SaveChanges(); + db.BulkSaveChanges(); } catch (System.Data.Entity.Validation.DbEntityValidationException dbEx)//ʵ֤쳣 { diff --git a/Models/Enums/SCP_ENUM.cs.cs b/Models/Enums/SCP_ENUM.cs.cs index 0e4d0f2..cc266e9 100644 --- a/Models/Enums/SCP_ENUM.cs.cs +++ b/Models/Enums/SCP_ENUM.cs.cs @@ -81,6 +81,15 @@ namespace CK.SCP.Models.Enums Non_Contract = 2, } + public enum BillFwModType + { + [Description("普通订单")] + Contract = 1, + [Description("委外订单")] + Non_Contract = 2, + [Description("期货订单")] + Qh_Contract = 3, + } public enum AskState { [Description("新建")] diff --git a/Models/Enums/UniApiType.cs b/Models/Enums/UniApiType.cs index 1db54bd..9eb77ae 100644 --- a/Models/Enums/UniApiType.cs +++ b/Models/Enums/UniApiType.cs @@ -5,7 +5,9 @@ namespace CK.SCP.Models.Enums public enum UniApiType { [Description("订单")] - PO, + Pobillnum, + [Description("大订单")] + MaxPobillnum, [Description("收货")] Receive, [Description("条码")] diff --git a/Models/GlobalConfig.cs b/Models/GlobalConfig.cs index 0db5485..c8e7e07 100644 --- a/Models/GlobalConfig.cs +++ b/Models/GlobalConfig.cs @@ -15,19 +15,24 @@ namespace CK.SCP.Models public const string WmsDbFileName = "Wms数据库设置.ini"; public const string DataCenterDbFileName = "数据中心数据库设置.ini"; public const string ExchangeCenterDbFileName = "交换中心数据库设置.ini"; - + public const string QiMingERPDatabase = "启明ERP数据库设置.ini"; private static DbSetting _scpDatabase; private static DbSetting _appboxDatabase; private static DbSetting _uniApiDatabase; private static DbSetting _wmsDatabase; - + private static DbSetting _qiMingERPDatabase; private static DbSetting _dcDB; private static DbSetting _ecDB; + + public static DbSetting qiMingERPDatabase + { + get { return _qiMingERPDatabase ?? (_qiMingERPDatabase = GetConfigValues(QiMingERPDatabase)); } - + set { _qiMingERPDatabase = value; } + } public static DbSetting ScpDatabase { get { return _scpDatabase ?? (_scpDatabase = GetConfigValues(ScpDbFileName)); } diff --git a/Models/ScpCache.cs b/Models/ScpCache.cs index 97f1bed..09bb437 100644 --- a/Models/ScpCache.cs +++ b/Models/ScpCache.cs @@ -18,7 +18,7 @@ namespace CK.SCP.Models private static List _usersList; private static List _ReceiveList; private static List _FactoryList; - private static List _PortList; + private static List _PortList; private static ScpConfig _config; public static ScpConfig Config @@ -319,5 +319,21 @@ namespace CK.SCP.Models public bool 负数发票 { get; set; } = false; public bool 开票数量限制 { get; set; } = true; public bool 数据中心接口 { get; set; } = false; + public string 密码验证格式 { get; set; } = "^(?![0-9]+$)(?![a-zA-Z]+$)(?![0-9a-zA-Z]+$)(?![0-9\\W]+$)(?![a-zA-Z\\W]+$)[0-9A-Za-z\\W]{8,}$"; + public string 密码验证提示语 { get; set; } = "至少8位,必须包含字母、数字和特殊字符!"; + // public string 密码验证格式 { get; set; } = "^((?=.*[A-Z])(?=.*[a-z])(?=.*[0-9])|(?=.*[a-z])(?=.*[0-9])(?=.*[$@$!%*#?&])|(?=.*[A-Z])(?=.*[0-9])(?=.*[$@$!%*#?&])|(?=.*[A-Z])(?=.*[a-z])(?=.*[$@$!%*#?&])).{8,}$"; + + //public string 密码验证格式 { get; set; } = "^(?=.*[a-z])(?=.*[A-Z])(?=.*\\d)(?=.*[$@$!%*?&])[A-Za-z\\d$@$!%*?&]{8,10}"; + //public string 密码验证格式 { get; set; } = "^((?=.*[a-z])(?=.*[A-Z])(?=.*\\d)|(?=.*[a-z])(?=.*[A-Z])(?=.*[$@$!%*?&])|(?=.*\\d)(?=.*[A-Z])(?=.*[$@$!%*?&])|(?=.*\\d)(?=.*[a-z])(?=.*[$@$!%*?&])).{8,}$"; + + // public string 密码验证格式 { get; set; } = "^((?=.*[A-Z])(?=.*[a-z])(?=.*[0-9])|(?=.*[a-z])(?=.*[0-9])(?=.*[\\W])|(?=.*[A-Z])(?=.*[0-9])(?=.*[\\W])|(?=.*[A-Z])(?=.*[a-z])(?=.*[\\W])).{8,}$"; + // public string 密码验证提示语 { get; set; } = "至少8位,必须包含大写字母、小写字母、数字和特殊字符中的三种!"; + + public string 默认密码 { get; set; } = "666666"; + public string 密码锁定次数 { get; set; } = "5"; + + public string 更换密码周期 { get; set; } = "6"; + + public bool 密码验证 { get; set; } = false; } } \ No newline at end of file diff --git a/Models/ScpEntities.cs b/Models/ScpEntities.cs index d734b7e..e1a2e93 100644 --- a/Models/ScpEntities.cs +++ b/Models/ScpEntities.cs @@ -32,16 +32,39 @@ namespace CK.SCP.Models { } - + public virtual DbSet V_TB_REEEE { set; get; } + public virtual DbSet TB_SUPPLIER_MAIL { set; get; } + public virtual DbSet TA_ProductionLine { get; set; } + public virtual DbSet TA_PurchasGroup { get; set; } + public virtual DbSet TA_PinFan { get; set; } + public virtual DbSet TA_BOXTYPE { get; set; } + public virtual DbSet TA_StorageLocation { get; set; } + public virtual DbSet TA_Appliance { get; set; } + public virtual DbSet TB_ASN_PARTBOX { get; set; } + public virtual DbSet TB_PALLETS_BTL { get; set; } + public virtual DbSet TA_Receiving_Information { get; set; } + public virtual DbSet V_TA_APPLIANCE { get; set; } + public virtual DbSet TA_SubPart { get; set; } + public virtual DbSet TB_MAXPO { get; set; } + public virtual DbSet TB_MAXPO_DETAIL { get; set; } + public virtual DbSet V_TB_MAXPO { get; set; } + public virtual DbSet V_TB_MAXPO_DETAIL { get; set; } public virtual DbSet TA_BILLTYPE { get; set; } public virtual DbSet TA_CONFIG { get; set; } public virtual DbSet TA_PART { get; set; } + public virtual DbSet TA_CarModel { get; set; } + public virtual DbSet TA_SubPartCode { get; set; } + public virtual DbSet V_TA_SubPartCode { get; set; } + public virtual DbSet TA_ASK_SUBPART { get; set; } + public virtual DbSet TB_FACTORY { get; set; } public virtual DbSet TA_VEND_PART { get; set; } public virtual DbSet TA_VENDER { get; set; } public virtual DbSet TB_ARRIVE { get; set; } public virtual DbSet TB_ARRIVE_DETAIL { get; set; } public virtual DbSet TB_INVOICE { get; set; } + public virtual DbSet TB_MAXPO_CONSUME { get; set; } + public virtual DbSet V_TB_MAXPO_CONSUME { get; set; } public virtual DbSet TB_INVOICE_DETAIL { get; set; } public virtual DbSet TB_RECEIVE { get; set; } public virtual DbSet TB_RECEIVE_DETAIL { get; set; } @@ -49,13 +72,15 @@ namespace CK.SCP.Models public virtual DbSet TB_REJECT_DETAIL { get; set; } public virtual DbSet TA_FACTORY_CONFIG { get; set; } public virtual DbSet TL_BASEDATA { get; set; } - public virtual DbSet TL_BILL { get; set; } + public virtual DbSet TL_BILL { get; set; } public virtual DbSet TL_OPER { get; set; } public virtual DbSet TS_BARCODE { get; set; } public virtual DbSet V_TS_BARCODE { get; set; } public virtual DbSet TS_BARCODE_SMALL { get; set; } public virtual DbSet TS_STOCK { get; set; } public virtual DbSet TS_UNI_API { get; set; } + public virtual DbSet TB_PO_SUBDETAIL { get; set; } + public virtual DbSet V_TB_PO_SUBDETAIL { get; set; } public virtual DbSet TS_UNI_API_HIS { get; set; } public virtual DbSet TT_CURRENCY { get; set; } public virtual DbSet TT_PROJECT { get; set; } @@ -76,6 +101,7 @@ namespace CK.SCP.Models public virtual DbSet V_TB_ASK { get; set; } public virtual DbSet TB_ASK_DETAIL { get; set; } public virtual DbSet V_TB_ASK_DETAIL { get; set; } + public virtual DbSet TM_CYJ_BOM { get; set; } public virtual DbSet TB_PO { get; set; } public virtual DbSet TB_PO_DETAIL { get; set; } public virtual DbSet TB_ASN { get; set; } @@ -124,6 +150,7 @@ namespace CK.SCP.Models public virtual DbSet TS_BARCODE_CUSTOM { get; set; } public virtual DbSet V_TA_VEND_PART { get; set; } public virtual DbSet TB_PRICE { get; set; } + public virtual DbSet TB_NetPrice { get; set; } public virtual DbSet TB_FORECAST { get; set; } public virtual DbSet V_TB_FORECAST { get; set; } public virtual DbSet TA_MoldSharing { get; set; } @@ -166,15 +193,27 @@ namespace CK.SCP.Models modelBuilder.Entity() .Property(e => e.Amt) .HasPrecision(18, 5); + modelBuilder.Entity() + .Property(e => e.Amt) + .HasPrecision(18, 5); modelBuilder.Entity() .Property(e => e.VendAbbCode) .IsUnicode(false); modelBuilder.Entity() .Property(e => e.PackQty) .HasPrecision(19, 2); + modelBuilder.Entity() + .Property(e => e.PlanQty) + .HasPrecision(19, 6); + modelBuilder.Entity() + .Property(e => e.PackQty) + .HasPrecision(19, 6); modelBuilder.Entity() .Property(e => e.ReceivedQty) .HasPrecision(19, 2); + modelBuilder.Entity() + .Property(e => e.Price) + .HasPrecision(19, 5); modelBuilder.Entity() .Property(e => e.PackQty) .HasPrecision(19, 2); @@ -264,15 +303,43 @@ namespace CK.SCP.Models .HasPrecision(18, 2); modelBuilder.Entity() .Property(e => e.PackQty) - .HasPrecision(18, 5); - - modelBuilder.Entity() + .HasPrecision(18, 6); + modelBuilder.Entity() + .Property(e => e.Qty) + .HasPrecision(18, 6); + modelBuilder.Entity() + .Property(e => e.Qty) + .HasPrecision(18, 6); + modelBuilder.Entity() + .Property(e => e.SubQty) + .HasPrecision(18, 6); + modelBuilder.Entity() + .Property(e => e.Qty) + .HasPrecision(18, 6); + modelBuilder.Entity() .Property(e => e.Rate) .HasPrecision(18, 5); modelBuilder.Entity() .Property(e => e.CurAmt) .HasPrecision(18, 5); - + modelBuilder.Entity() + .Property(e => e.MinordQty) + .HasPrecision(18, 6); + modelBuilder.Entity() + .Property(e => e.Singlecon) + .HasPrecision(18, 6); + modelBuilder.Entity() + .Property(e => e.OrderQtyd) + .HasPrecision(18, 6); + modelBuilder.Entity() + .Property(e => e.OrderQtykg) + .HasPrecision(18, 6); + modelBuilder.Entity() +.Property(e => e.OrderNumber) +.HasPrecision(18, 6); + modelBuilder.Entity() +.Property(e => e.PoQty) +.HasPrecision(18, 6); } } } diff --git a/Models/ScpEntity/ExcelExportEnttity/SCP_APPLIANCE_EXPOPT.cs b/Models/ScpEntity/ExcelExportEnttity/SCP_APPLIANCE_EXPOPT.cs new file mode 100644 index 0000000..189d80a --- /dev/null +++ b/Models/ScpEntity/ExcelExportEnttity/SCP_APPLIANCE_EXPOPT.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace CK.SCP.Models.ScpEntity.ExcelExportEnttity +{ + public class SCP_APPLIANCE_EXPOPT + { + public string 零件号码; + public string 材质; + public string 收货口; + public string 零件描述; + public string 车型; + public string 标包数; + public string 背番号; + public string 所番地; + public string 箱种; + public string 后工程; + public string 供应商代码; + } +} diff --git a/Models/ScpEntity/ExcelExportEnttity/SCP_INVOICE_DETAIL_EXPORT.cs b/Models/ScpEntity/ExcelExportEnttity/SCP_INVOICE_DETAIL_EXPORT.cs index 645520b..3b7d849 100644 --- a/Models/ScpEntity/ExcelExportEnttity/SCP_INVOICE_DETAIL_EXPORT.cs +++ b/Models/ScpEntity/ExcelExportEnttity/SCP_INVOICE_DETAIL_EXPORT.cs @@ -30,5 +30,7 @@ namespace CK.SCP.Models.ScpEntity.ExcelExportEnttity public string 开票数量 { get; set; }//Qty public string 备注 { get; set; }//Remark + public string 发票金额 { get; set; } + public string 订单金额 { get; set; } } } diff --git a/Models/ScpEntity/ExcelExportEnttity/SCP_MAXPODC_EXPORT.cs b/Models/ScpEntity/ExcelExportEnttity/SCP_MAXPODC_EXPORT.cs new file mode 100644 index 0000000..085a055 --- /dev/null +++ b/Models/ScpEntity/ExcelExportEnttity/SCP_MAXPODC_EXPORT.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace CK.SCP.Models.ScpEntity.ExcelExportEnttity +{ + public class SCP_MAXPODC_EXPORT + { + public string 订单编号 { get; set; } + public string 供应商编码 { get; set; } + public string 供应商名称 { get; set; } + public string 合同月 { get; set; } + + } +} diff --git a/Models/ScpEntity/ExcelExportEnttity/SCP_MAXPO_DETAIL_EXPORT.cs b/Models/ScpEntity/ExcelExportEnttity/SCP_MAXPO_DETAIL_EXPORT.cs new file mode 100644 index 0000000..405944a --- /dev/null +++ b/Models/ScpEntity/ExcelExportEnttity/SCP_MAXPO_DETAIL_EXPORT.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace CK.SCP.Models.ScpEntity.ExcelExportEnttity +{ + public class SCP_MAXPO_DETAIL_EXPORT + { + public string 车型 { get; set; } + public string 零件号 { get; set; } + public string 原材物料号 { get; set; } + public string 材质 { get; set; } + public string 技术标准 { get; set; } + public string 起定量 { get; set; } + public string 订货量吨 { get; set; } + public string 订货件数 { get; set; } + + public string 材料厂家 { get; set; } + public string 行号 { get; set; } + + public string 预测1 { get; set; } + public string 预测2 { get; set; } + public string 预测3 { get; set; } + public string 预测4 { get; set; } + public string 预测5 { get; set; } + public string 预测6 { get; set; } + + } +} diff --git a/Models/ScpEntity/ExcelExportEnttity/SCP_MAXPO_EXPORT.cs b/Models/ScpEntity/ExcelExportEnttity/SCP_MAXPO_EXPORT.cs new file mode 100644 index 0000000..c2668dd --- /dev/null +++ b/Models/ScpEntity/ExcelExportEnttity/SCP_MAXPO_EXPORT.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace CK.SCP.Models.ScpEntity.ExcelExportEnttity +{ + public class SCP_MAXPO_EXPORT + { + public string 车型 { get; set; } + public string 零件号 { get; set; } + public string 原材物料号 { get; set; } + public string 材质 { get; set; } + public string 技术标准 { get; set; } + public string 起定量 { get; set; } + public string 订货量吨 { get; set; } + public string 订货件数 { get; set; } + public string 供应商编号 { get; set; } + public string 材料厂家 { get; set; } + public string 备注 { get; set; } + } + } diff --git a/Models/ScpEntity/ExcelExportEnttity/SCP_PO_DETAIL_EXPORT.cs b/Models/ScpEntity/ExcelExportEnttity/SCP_PO_DETAIL_EXPORT.cs index 66aea79..2d88864 100644 --- a/Models/ScpEntity/ExcelExportEnttity/SCP_PO_DETAIL_EXPORT.cs +++ b/Models/ScpEntity/ExcelExportEnttity/SCP_PO_DETAIL_EXPORT.cs @@ -21,8 +21,9 @@ namespace CK.SCP.Models.ScpEntity.ExcelExportEnttity public string 退货数 { get; set; } //RejectQty" public string 到货日期 { get; set; } //EndTime" public string 单位 {get;set; } //PoUnit" + public string 预计到货日期 { get; set; } + public string 存储地点 { get; set; } - } public class SCP_PO_DETAIL_EXPORT_MODEL { @@ -98,5 +99,18 @@ namespace CK.SCP.Models.ScpEntity.ExcelExportEnttity public string 零件截至日期 { get; set; } public string 订单开始时间 { get; set; } public string 订单截至日期 { get; set; } + public string 组件物料号 { get; set; } + public string 采购组 { get; set; } + public string 组件计量单位 { get; set; } + public string 组件数量 { get; set; } + public string 器具型号 { get; set; } + public string 采购计量单位 { get; set; } + public string BOM版本 { get; set; } + public string 物料号码 { get; set; } + public string 车型 { get; set; } + public string 存储地点 { get; set; } + public string 原材物料号 { get; set; } + public string 期货订单 { get; set; } + } } diff --git a/Models/ScpEntity/ExcelExportEnttity/SCP_VENDER_EXPORT.cs b/Models/ScpEntity/ExcelExportEnttity/SCP_VENDER_EXPORT.cs index 5ae17ed..8972223 100644 --- a/Models/ScpEntity/ExcelExportEnttity/SCP_VENDER_EXPORT.cs +++ b/Models/ScpEntity/ExcelExportEnttity/SCP_VENDER_EXPORT.cs @@ -24,5 +24,14 @@ namespace CK.SCP.Models.ScpEntity.ExcelExportEnttity public string 状态 { get; set; } public string 备注 { get; set; } public string 税率 { get; set; } + public string 存储地点 { get; set; } + public string 层次 { get; set; } + public string 层次描述 { get; set; } + public string 描述 { get; set; } + public string 存货标识 { get; set; } + public string 品番 { get; set; } + public string 条码内容 { get; set; } + public string Code39条码 { get; set; } + public string 车型 { get; set; } } } diff --git a/Models/ScpEntity/ExcelExportEnttity/SCP_VENDER_PART_EXPORT.cs b/Models/ScpEntity/ExcelExportEnttity/SCP_VENDER_PART_EXPORT.cs index ea6b803..2d4174a 100644 --- a/Models/ScpEntity/ExcelExportEnttity/SCP_VENDER_PART_EXPORT.cs +++ b/Models/ScpEntity/ExcelExportEnttity/SCP_VENDER_PART_EXPORT.cs @@ -12,10 +12,30 @@ namespace CK.SCP.Models.ScpEntity.ExcelExportEnttity public string 供应商代码{ get; set; } public string 零件号 { get; set; } public string 供应商零件号 { get; set; } - public string 零件名称 { get; set; } + public string 零件号码 { get; set; } public string 标包数 { get; set; } public string 单位 { get; set; } public string 小包装数 { get; set; } public string 托盘包装数 { get; set; } + public string 器具型号 { get; set; } + public string 车型 { get; set; } + public string 客户零件号 { get; set; } + public string 产线 { get; set; } + public string 零件描述 { get; set; } + public string 背番号 { get; set; } + public string 所番地 { get; set; } + public string 箱种 { get; set; } + public string 后工程 { get; set; } + public string 物料号码 { get; set; } + public string 规格 { get; set; } + public string 材质 { get; set; } + public string 收货口 { get; set; } + public string 采购组 { get; set; } + public string 中文名称 { get; set; } + public string 描述 { get; set; } + public string 班次 { get; set; } + public string 收货人 { get; set; } + public string 收货人电话 { get; set; } + public string 打印托盘码 { get; set; } } } diff --git a/Models/ScpEntity/PURSubcontractor.cs b/Models/ScpEntity/PURSubcontractor.cs new file mode 100644 index 0000000..fb33c3f --- /dev/null +++ b/Models/ScpEntity/PURSubcontractor.cs @@ -0,0 +1,59 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace CK.SCP.Models.ScpEntity +{ + public partial class PURSubcontractors + { + [Key] + public int di_batchno { get; set; } + public string purDocNO { get; set; } + public string purDocItemNO { get; set; } + + public string ordType { get; set; } + + public DateTime? docDate { get; set; } + + public string returnsItem { get; set; } + public string sizecoL { get; set; } + public string purDocItemCtg { get; set; } + public string plant { get; set; } + public string purOrg { get; set; } + public string companyCode { get; set; } + public string mtlNO { get; set; } + public string shortText { get; set; } + public decimal quantity { get; set; } + public DateTime? itemDeliveryDate { get; set; } + public decimal price { get; set; } + public string baseUnitMeasure { get; set; } + public string ordPriceUnit { get; set; } + + public string vendorNO { get; set; } + public string responsibleSalesperson { get; set; } + public string storeLocation { get; set; } + public string purGrp { get; set; } + public string phone { get; set; } + public string ctype { get; set; } + public string remark { get; set; } + public DateTime? createdDate { get; set; } + public string createdBy { get; set; } + public DateTime? di_updatetime { get; set; } + public string updatedBy { get; set; } + public string measureBaseUnit { get; set; } + public string groupWareMaterielNO { get; set; } + public string groupWarePlant { get; set; } + public DateTime? compRequireDate { get; set; } + public decimal COMPONQUANTITY { get; set; } + public string di_message { get; set; } + public string di_status { get; set; } + public DateTime? di_writeTime { get; set; } + public string outPurDocNO { get; set; } + public string outPurDocItemNO { get; set; } + public string alternativeBOM { get; set; } + } +} + diff --git a/Models/ScpEntity/TA_ASK_SUBPART.cs b/Models/ScpEntity/TA_ASK_SUBPART.cs new file mode 100644 index 0000000..6aea38a --- /dev/null +++ b/Models/ScpEntity/TA_ASK_SUBPART.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace CK.SCP.Models.ScpEntity +{ + public partial class TA_ASK_SUBPART + { + + [Key] + public long UID { get; set; } + public string PartCode { get; set; } + + public string SubPartCode { get; set; } + public string BOMedtiton { get; set; } + public string AskBillNum { get; set; } + + public decimal Qty { get; set; } + + public string VendBatch { get; set; } + } +} diff --git a/Models/ScpEntity/TA_Appliance.cs b/Models/ScpEntity/TA_Appliance.cs new file mode 100644 index 0000000..7aaf6b9 --- /dev/null +++ b/Models/ScpEntity/TA_Appliance.cs @@ -0,0 +1,28 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace CK.SCP.Models.ScpEntity +{ + + public partial class TA_Appliance + { + + [Key] + public long UID { get; set; } + public string PartCode { get; set; } + + public string Model { get; set; } + public decimal? PackNumber { get; set;} + public string PartDesc1 { get; set; } + public string ReciteNumber { get; set; } + public string SufanLand { get; set; } + public string BoxType { get; set; } + public string PostEngineering { get; set; } + public string PartNumber { get; set; } + public string PartDesc2 { get; set; } + public string Texture { get; set; } + public string ReceivingPort { get; set; } + public string VendID { get; set; } + + } +} diff --git a/Models/ScpEntity/TA_BOXTYPE.cs b/Models/ScpEntity/TA_BOXTYPE.cs new file mode 100644 index 0000000..9a1c475 --- /dev/null +++ b/Models/ScpEntity/TA_BOXTYPE.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace CK.SCP.Models.ScpEntity +{ + public class TA_BOXTYPE + { + + [DatabaseGenerated(DatabaseGeneratedOption.Identity)] + public long UID { get; set; } + [Key] + public string BoxType { get; set; } + public bool Enabled { get; set; } + public string CreateUser { get; set; } + public DateTime CreateTime { get; set; } + } +} diff --git a/Models/ScpEntity/TA_CONFIG.cs b/Models/ScpEntity/TA_CONFIG.cs index cce6416..c45cd84 100644 --- a/Models/ScpEntity/TA_CONFIG.cs +++ b/Models/ScpEntity/TA_CONFIG.cs @@ -13,7 +13,7 @@ namespace CK.SCP.Models.ScpEntity public string ParamName { get; set; } [Required] - [StringLength(50)] + [StringLength(500)] public string ParamValue { get; set; } public int? State { get; set; } diff --git a/Models/ScpEntity/TA_CarModel.cs b/Models/ScpEntity/TA_CarModel.cs new file mode 100644 index 0000000..4a4328e --- /dev/null +++ b/Models/ScpEntity/TA_CarModel.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace CK.SCP.Models.ScpEntity +{ + public partial class TA_CarModel + { + + [DatabaseGenerated(DatabaseGeneratedOption.Identity)] + public long UID { get; set; } + [Key] + public string Model { get; set; } + + } +} \ No newline at end of file diff --git a/Models/ScpEntity/TA_PinFan.cs b/Models/ScpEntity/TA_PinFan.cs new file mode 100644 index 0000000..59cba4e --- /dev/null +++ b/Models/ScpEntity/TA_PinFan.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace CK.SCP.Models.ScpEntity +{ + public partial class TA_PinFan + { + + [Key] + public long UID { get; set; } + public string PartCode { get; set; } + + public string Barcodnt { get; set; } + public string Identification { get; set; } + + } +} diff --git a/Models/ScpEntity/TA_ProductionLine.cs b/Models/ScpEntity/TA_ProductionLine.cs new file mode 100644 index 0000000..b6dc7a5 --- /dev/null +++ b/Models/ScpEntity/TA_ProductionLine.cs @@ -0,0 +1,22 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace CK.SCP.Models.ScpEntity +{ + + public partial class TA_ProductionLine + { + + [DatabaseGenerated(DatabaseGeneratedOption.Identity)] + public long UID { get; set; } + + [Key] + [Column(Order = 0)] + [StringLength(50)] + public string PartCode { get; set; } + + public string ProductionLine { get; set; } + + + } +} diff --git a/Models/ScpEntity/TA_PurchasGroup.cs b/Models/ScpEntity/TA_PurchasGroup.cs new file mode 100644 index 0000000..6fb9e8f --- /dev/null +++ b/Models/ScpEntity/TA_PurchasGroup.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace CK.SCP.Models.ScpEntity +{ + public partial class TA_PurchasGroup + { + + [Key] + public long UID { get; set; } + public string PurchasingGroup { get; set; } + + public string ChineseName { get; set; } + public string Describe { get; set; } + + } +} \ No newline at end of file diff --git a/Models/ScpEntity/TA_Receiving_Information.cs b/Models/ScpEntity/TA_Receiving_Information.cs new file mode 100644 index 0000000..0fdc1ea --- /dev/null +++ b/Models/ScpEntity/TA_Receiving_Information.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace CK.SCP.Models.ScpEntity +{ + public class TA_Receiving_Information + { + [Key] + public long UID { get; set; } + public string Shift { get; set; } + + public string Name { get; set; } + public string Phone { get; set; } + } +} diff --git a/Models/ScpEntity/TA_StorageLocation.cs b/Models/ScpEntity/TA_StorageLocation.cs new file mode 100644 index 0000000..7b7dead --- /dev/null +++ b/Models/ScpEntity/TA_StorageLocation.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace CK.SCP.Models.ScpEntity +{ + public partial class TA_StorageLocation + { + + [Key] + public long UID { get; set; } + public string StLocation { get; set; } + + public string Arrangement { get; set; } + public string Leveldescription { get; set; } + public string Describe { get; set; } + public string Inventoryation { get; set; } + + } +} diff --git a/Models/ScpEntity/TA_SubPart.cs b/Models/ScpEntity/TA_SubPart.cs new file mode 100644 index 0000000..9c8ddbc --- /dev/null +++ b/Models/ScpEntity/TA_SubPart.cs @@ -0,0 +1,20 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace CK.SCP.Models.ScpEntity +{ + + public partial class TA_SubPart + { + + [DatabaseGenerated(DatabaseGeneratedOption.Identity)] + public long UID { get; set; } + + [Key] + [Column(Order = 0)] + [StringLength(50)] + public string PartCode { get; set; } + public string SubPart { get; set; } + + } +} diff --git a/Models/ScpEntity/TA_SubPartCode.cs b/Models/ScpEntity/TA_SubPartCode.cs new file mode 100644 index 0000000..4f01f74 --- /dev/null +++ b/Models/ScpEntity/TA_SubPartCode.cs @@ -0,0 +1,22 @@ +using System; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Web; + +namespace CK.SCP.Models.ScpEntity +{ + public partial class TA_SubPartCode + { + [DatabaseGenerated(DatabaseGeneratedOption.Identity)] + [Key] + public long UID { get; set; } + public string PartCode { get; set; } + public string SubPartCode { get; set; } + + public string BOMedtiton { get; set; } + public string Site { get; set; } + public decimal Qty { get; set; } + public decimal SUMQTY { get; set; } + + } +} diff --git a/Models/ScpEntity/TB_ASK.cs b/Models/ScpEntity/TB_ASK.cs index 6e26293..b5d5d9f 100644 --- a/Models/ScpEntity/TB_ASK.cs +++ b/Models/ScpEntity/TB_ASK.cs @@ -41,6 +41,7 @@ namespace CK.SCP.Models.ScpEntity public string Extend2 { get; set; } public string Extend3 { get; set; } public string SubSite { get; set; } - + public string AskType { get; set; } + } } diff --git a/Models/ScpEntity/TB_ASK_DETAIL.cs b/Models/ScpEntity/TB_ASK_DETAIL.cs index 83d1ed4..c140123 100644 --- a/Models/ScpEntity/TB_ASK_DETAIL.cs +++ b/Models/ScpEntity/TB_ASK_DETAIL.cs @@ -46,7 +46,7 @@ namespace CK.SCP.Models.ScpEntity public string ReceivedPort { get; set; } - + public string Remark1 { get; set; } public decimal? ReduceQty { get; set; } public string Site { get; set; } diff --git a/Models/ScpEntity/TB_ASN_DETAIL.cs b/Models/ScpEntity/TB_ASN_DETAIL.cs index 4b9ed93..c893ac6 100644 --- a/Models/ScpEntity/TB_ASN_DETAIL.cs +++ b/Models/ScpEntity/TB_ASN_DETAIL.cs @@ -31,7 +31,7 @@ namespace CK.SCP.Models.ScpEntity [StringLength(50)] public string Batch { get; set; } public DateTime? ProduceDate { get; set; } - [StringLength(50)] + public string VendBatch { get; set; } public decimal Qty { get; set; } [StringLength(50)] diff --git a/Models/ScpEntity/TB_ASN_PARTBOX.cs b/Models/ScpEntity/TB_ASN_PARTBOX.cs new file mode 100644 index 0000000..fbfc110 --- /dev/null +++ b/Models/ScpEntity/TB_ASN_PARTBOX.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace CK.SCP.Models.ScpEntity +{ + public partial class TB_ASN_PARTBOX + { + [DatabaseGenerated(DatabaseGeneratedOption.Identity)] + [Key] + public long UID { get; set; } + [StringLength(50)] + public string AsnBillNum { get; set; } + public string PartCode { get; set; } + public string BoxType { get; set; } + public int Box { get; set; } + public int Qty { get; set; } + public int Qty1 { get; set; } + public int SumBox { get; set; } + public string PoBillNum { get; set; } + public string VendId { get; set; } + public string ShipTime { get; set; } + public string Batch { get; set; } + public int PoLine { get; set; } + public decimal PackQty { get; set; } + } +} diff --git a/Models/ScpEntity/TB_INVOICE_DETAIL.cs b/Models/ScpEntity/TB_INVOICE_DETAIL.cs index a7cd28e..efed916 100644 --- a/Models/ScpEntity/TB_INVOICE_DETAIL.cs +++ b/Models/ScpEntity/TB_INVOICE_DETAIL.cs @@ -55,7 +55,6 @@ namespace CK.SCP.Models.ScpEntity [StringLength(50)] public string Site { get; set; } [StringLength(50)] - public string SubSite { get; set; } - + public string SubSite { get; set; } } } diff --git a/Models/ScpEntity/TB_MAXPO.cs b/Models/ScpEntity/TB_MAXPO.cs new file mode 100644 index 0000000..1ec35d4 --- /dev/null +++ b/Models/ScpEntity/TB_MAXPO.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace CK.SCP.Models.ScpEntity +{ + public partial class TB_MAXPO + { + + [DatabaseGenerated(DatabaseGeneratedOption.Identity)] + public long UID { get; set; } + + [Key] + [Column(Order = 0)] + [StringLength(50)] + public string PoBillNum { get; set; } + public string VendId { get; set; } + public DateTime CreateTime { get; set; } + public string CreateUser { get; set; } + public string ContractNo { get; set; } + public string ContractMonth { get; set; } + public string Site { get; set; } + + public string Remark { get; set; } + public bool IsDeleted { get; set; } + } +} diff --git a/Models/ScpEntity/TB_MAXPO_CONSUME.cs b/Models/ScpEntity/TB_MAXPO_CONSUME.cs new file mode 100644 index 0000000..1265d4b --- /dev/null +++ b/Models/ScpEntity/TB_MAXPO_CONSUME.cs @@ -0,0 +1,19 @@ +using System; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace CK.SCP.Models.ScpEntity +{ + public partial class TB_MAXPO_CONSUME + { + [Key] + public long UID { get; set; } + public string BillNum { get; set; } + + public string PartCode { get; set; } + public string VendId { get; set; } + public decimal PoQty { get; set; } + public string PoBillNum { get; set; } + public DateTime? ShipTime { get; set; } + } +} diff --git a/Models/ScpEntity/TB_MAXPO_DETAIL.cs b/Models/ScpEntity/TB_MAXPO_DETAIL.cs new file mode 100644 index 0000000..81e41b9 --- /dev/null +++ b/Models/ScpEntity/TB_MAXPO_DETAIL.cs @@ -0,0 +1,58 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace CK.SCP.Models.ScpEntity +{ + public partial class TB_MAXPO_DETAIL + { + [DatabaseGenerated(DatabaseGeneratedOption.Identity)] + public long UID { get; set; } + + + + [Key] + [Column(Order =0)] + public string PoBillNum { get; set; } + [Key] + [Column(Order = 1)] + public string VendId { get; set; } + public DateTime CreateTime { get; set; } + public string CreateUser { get; set; } + + public string ContractNo { get; set; } + [Key] + [Column(Order = 2)] + public string PartCode { get; set; } + public string PartNumber { get; set; } + public string Texture { get; set; } + public string Model { get; set; } + public string Finprspec { get; set; } + public string TechStandard { get; set; } + public decimal MinordQty { get; set; } + public decimal Singlecon { get; set; } + public decimal OrderQtyd { get; set; } + public decimal OrderQtykg { get; set; } + public decimal OrderNumber { get; set; } + public string forecastone { get; set; } + public string forecasttwo { get; set; } + public string forecastthree { get; set; } + public string forecastfour { get; set; } + public string forecastfive { get; set; } + public string forecastsix { get; set; } + public string Matermanu { get; set; } + public string ContractMonth { get; set; } + public decimal BomQty { get; set; } + public int PoLine { get; set; } + public string Site { get; set; } + public decimal SurplusQty { get; set; } + public decimal AsnQty { get; set; } + public decimal ReceQty { get; set; } + public bool IsDeleted { get; set; } + public decimal ReturnQty { get; set; } + } +} diff --git a/Models/ScpEntity/TB_NetPrice.cs b/Models/ScpEntity/TB_NetPrice.cs new file mode 100644 index 0000000..475921c --- /dev/null +++ b/Models/ScpEntity/TB_NetPrice.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using ChangKeTec.Wms.Models; + +namespace CK.SCP.Models.ScpEntity +{ + + public partial class TB_NetPrice + { + [Key] + public int UID { get; set; } + public string VendId { get; set; } + public string Site { get; set; } + public string PartCode { get; set; } + public Nullable StartTime { get; set; } + public Nullable EndTime { get; set; } + public string Curr { get; set; } + public string Unit { get; set; } + [DecimalPrecision(18, 5)] + public decimal Amt { get; set; } + public string Remarks { get; set; } + public string Extend1 { get; set; } + public string Extend2 { get; set; } + public string Extend3 { get; set; } + //public int State { get; set; } + //public decimal? VendAmt { get; set; } + } +} diff --git a/Models/ScpEntity/TB_PALLETS_BTL.cs b/Models/ScpEntity/TB_PALLETS_BTL.cs new file mode 100644 index 0000000..43fd2ad --- /dev/null +++ b/Models/ScpEntity/TB_PALLETS_BTL.cs @@ -0,0 +1,47 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace CK.SCP.Models.ScpEntity +{ + public partial class TB_PALLETS_BTL + { + [DatabaseGenerated(DatabaseGeneratedOption.Identity)] + public long UID { get; set; } + [Key] + public string PalletNum{ get; set; } + public string AsnBillNum { get; set; } + public int SumBox { get; set; } + public string PoBillNum { get; set; } + public decimal SumQty { get; set; } + public string VendId { get; set; } + public string VendName { get; set; } + public string ShipTime { get; set; } + public string PartCode { get; set; } + public string PartCode1 { get; set; } + public string PartCode2 { get; set; } + public string PartCode3 { get; set; } + public string PartCode4 { get; set; } + public string PartCode5 { get; set; } + public string Box { get; set; } + public string Box1 { get; set; } + public string Box2 { get; set; } + public string Box3 { get; set; } + public string Box4 { get; set; } + public string Box5 { get; set; } + public string PackQty { get; set; } + public string PackQty1 { get; set; } + public string PackQty2 { get; set; } + public string PackQty3 { get; set; } + public string PackQty4 { get; set; } + public string PackQty5 { get; set; } + public string PalletCode { get; set; } + [NotMapped] + public List UIDList { get; set; } + public bool IsDeleted { get; set; } + } +} diff --git a/Models/ScpEntity/TB_PO.cs b/Models/ScpEntity/TB_PO.cs index ccca48b..6495fbf 100644 --- a/Models/ScpEntity/TB_PO.cs +++ b/Models/ScpEntity/TB_PO.cs @@ -15,7 +15,7 @@ namespace CK.SCP.Models.ScpEntity using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; - public partial class TB_PO:RecordEntity + public partial class TB_PO : RecordEntity { [DatabaseGenerated(DatabaseGeneratedOption.Identity)] public long UID { get; set; } @@ -41,12 +41,12 @@ namespace CK.SCP.Models.ScpEntity public int State { get; set; } [StringLength(200)] public string Remark { get; set; } - + public DateTime? BeginTime { get; set; } public DateTime? EndTime { get; set; } - - + [StringLength(50)] + [NotMapped] @@ -56,9 +56,40 @@ namespace CK.SCP.Models.ScpEntity public string Extend3 { get; set; } public string SubSite { get; set; } + + + public TB_PO Clone(string p_NewBill, string p_Site) + { + return new TB_PO() + { + PoBillNum = p_NewBill, + ErpBillNum = p_NewBill, + UID = UID, + ModType=ModType, + State=State, + VendId = VendId, + Contacter = Contacter, + Buyer = Buyer, + BuyerPhone = BuyerPhone, + Remark = Remark, + BeginTime = BeginTime, + EndTime = EndTime, + ReceivedPort = ReceivedPort, + Extend1 = Extend1, + Extend2 = Extend2, + Extend3 = Extend3, + SubSite = SubSite, + Site = p_Site, + CreateUser = CreateUser, + CreateTime=CreateTime, + GUID=GUID, + UpdateInfo=UpdateInfo, + }; + } + } - - + + } diff --git a/Models/ScpEntity/TB_PO_DETAIL.cs b/Models/ScpEntity/TB_PO_DETAIL.cs index a549dfc..2083cf4 100644 --- a/Models/ScpEntity/TB_PO_DETAIL.cs +++ b/Models/ScpEntity/TB_PO_DETAIL.cs @@ -78,5 +78,6 @@ namespace CK.SCP.Models.ScpEntity public string Site { get; set; } + } } diff --git a/Models/ScpEntity/TB_PO_SUBDETAIL.cs b/Models/ScpEntity/TB_PO_SUBDETAIL.cs new file mode 100644 index 0000000..1a6176a --- /dev/null +++ b/Models/ScpEntity/TB_PO_SUBDETAIL.cs @@ -0,0 +1,36 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace CK.SCP.Models.ScpEntity +{ + public partial class TB_PO_SUBDETAIL + { + + [DatabaseGenerated(DatabaseGeneratedOption.Identity)] + [Key] + public long UID { get; set; } + + public string PoBillNum { get; set; } + + public string PartCode { get; set; } + + public decimal Qty { get; set; } + + public decimal SubQty { get; set; } + + public string Site { get; set; } + + public string SubPartCode { get; set; } + + + + public string BOMedtiton { get; set; } + + public int PoLine { get; set; } + } +} diff --git a/Models/ScpEntity/TB_SUPPLIER_MAIL.cs b/Models/ScpEntity/TB_SUPPLIER_MAIL.cs new file mode 100644 index 0000000..09f92ac --- /dev/null +++ b/Models/ScpEntity/TB_SUPPLIER_MAIL.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations.Schema; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace CK.SCP.Models.ScpEntity +{ + public class TB_SUPPLIER_MAIL + { + [DatabaseGenerated(DatabaseGeneratedOption.Identity)] + public long Id { set; get; } + public string SupplicerCode { set; get; } + + public string Email { set; get; } + + public int State { set; get; } + + public string MailBody { set; get; } + + + + } +} diff --git a/Models/ScpEntity/TM_CYJ_BOM.cs b/Models/ScpEntity/TM_CYJ_BOM.cs new file mode 100644 index 0000000..696c7a7 --- /dev/null +++ b/Models/ScpEntity/TM_CYJ_BOM.cs @@ -0,0 +1,63 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace CK.SCP.Models.ScpEntity +{ + public partial class TM_CYJ_BOM + { + [DatabaseGenerated(DatabaseGeneratedOption.Computed)] + public int UID { get; set; } + + [Key] + [Column(Order = 0)] + [StringLength(50)] + [DisplayName("物料号")] + public string PartCode { get; set; } + + [Key] + [Column(Order = 1)] + [StringLength(50)] + [DisplayName("子物料")] + public string SubPartCode { get; set; } + + [Key] + [Column(Order = 2)] + [DisplayName("Bom用途")] + public string BomUsage { get; set; } + + [Key] + [Column(Order = 3)] + [DisplayName("Bom替代")] + public string BomFillIn { get; set; } + + [DisplayName("特殊获取类型")] + public string SpecialType { get; set; } + + [DisplayName("用量")] + public decimal Qty { get; set; } + + [DisplayName("单位")] + public string Unit { get; set; } + + [DisplayName("删除标识")] + public string IsDelete { get; set; } + + [DisplayName("有效开始日期")] + public DateTime StartDate { get; set; } + + [DisplayName("有效截止日期")] + public DateTime EndDate { get; set; } + + [DisplayName("创建日期")] + public DateTime CreateTime { get; set; } + + [DisplayName("备注")] + public string Remark { get; set; } + } +} diff --git a/Models/ScpEntity/TS_BARCODE.cs b/Models/ScpEntity/TS_BARCODE.cs index 703d712..caca2c7 100644 --- a/Models/ScpEntity/TS_BARCODE.cs +++ b/Models/ScpEntity/TS_BARCODE.cs @@ -53,8 +53,7 @@ namespace CK.SCP.Models.ScpEntity [StringLength(50)] public string VendId { get; set; } - - [StringLength(50)] + public string VendBatch { get; set; } [Column(TypeName = "money")] @@ -84,7 +83,7 @@ namespace CK.SCP.Models.ScpEntity public string Extend1 { get; set; } public string Extend2 { get; set; } - public string Extend3 { get; set; } + public string Extend3 { get; set; } [DisplayName("Ӧ")] public string VendName => ScpCache.GetVendName(VendId,Site); @@ -106,6 +105,19 @@ namespace CK.SCP.Models.ScpEntity public string IsScanned_Desc => IsScanned ? "ɨ" : "δɨ"; [NotMapped] public decimal CanQty { get; set; } - + public string Extend4 { get; set; } + public string Extend5 { get; set; } + public DateTime Extend6 { get; set; } + public string Extend7 { get; set; } + public string Extend8 { get; set; } + public string Extend9 { get; set; } + public string Extend10{ get; set; } + public string Extend11 { get; set; } + public string Extend12 { get; set; } + public DateTime Extend13 { get; set; } + public string Extend14 { get; set; } + public string Extend15 { get; set; } + public string Extend16 { get; set; } + public string PalletNum { get; set; } } } diff --git a/Models/ScpEntity/TS_UNI_API.cs b/Models/ScpEntity/TS_UNI_API.cs index b44766f..b422491 100644 --- a/Models/ScpEntity/TS_UNI_API.cs +++ b/Models/ScpEntity/TS_UNI_API.cs @@ -81,9 +81,10 @@ namespace CK.SCP.Models.ScpEntity public decimal Tax { get; set; } public string Site { get; set; } public string Domain { get; set; } - + public string SubSite { get; set; } public string Extend1 { get; set; } public string Extend2 { get; set; } + public string Extend3 { get; set; } public TS_UNI_API_HIS ToHis() { return new TS_UNI_API_HIS diff --git a/Models/ScpEntity/V_ASN_PRINT.cs b/Models/ScpEntity/V_ASN_PRINT.cs index a46ca33..c596824 100644 --- a/Models/ScpEntity/V_ASN_PRINT.cs +++ b/Models/ScpEntity/V_ASN_PRINT.cs @@ -23,6 +23,7 @@ namespace CK.SCP.Models.ScpEntity public string CAAIPhone{get;set;} public string CAAIFax { get; set; } public string Total { get; set; } + public string CurrentUserPhone { get; set; } } @@ -42,6 +43,7 @@ namespace CK.SCP.Models.ScpEntity public string Batch { get; set; } public string VendBatch { get; set; } public string ProjectId { get; set; } + public string PoQty { get; set; } public string DockCode_Desc => ScpCache.PortList.Where(p => p.PORT_NO == DockCode).FirstOrDefault() == null ? "" : ScpCache.PortList.Where(p => p.PORT_NO == DockCode).FirstOrDefault().PORT_DESCRIPTION; } diff --git a/Models/ScpEntity/V_TA_APPLIANCE.cs b/Models/ScpEntity/V_TA_APPLIANCE.cs new file mode 100644 index 0000000..68d79a2 --- /dev/null +++ b/Models/ScpEntity/V_TA_APPLIANCE.cs @@ -0,0 +1,29 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace CK.SCP.Models.ScpEntity +{ + + public partial class V_TA_APPLIANCE + { + + [Key] + public long UID { get; set; } + public string PartCode { get; set; } + + public string Model { get; set; } + public decimal? PackNumber { get; set; } + public string PartDesc1 { get; set; } + public string ReciteNumber { get; set; } + public string SufanLand { get; set; } + public string BoxType { get; set; } + public string PostEngineering { get; set; } + public string PartNumber { get; set; } + public string PartDesc2 { get; set; } + public string Texture { get; set; } + public string ReceivingPort { get; set; } + public string VendID { get; set; } + public string VendName { get; set; } + + } +} diff --git a/Models/ScpEntity/V_TA_SubPartCode.cs b/Models/ScpEntity/V_TA_SubPartCode.cs new file mode 100644 index 0000000..1b9fe74 --- /dev/null +++ b/Models/ScpEntity/V_TA_SubPartCode.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Web; + +namespace CK.SCP.Models.ScpEntity +{ + public partial class V_TA_SubPartCode + { + [DatabaseGenerated(DatabaseGeneratedOption.Identity)] + [Key] + public long UID { get; set; } + public string PartCode { get; set; } + public string SubPartCode { get; set; } + + public string BOMedtiton { get; set; } + public string Site { get; set; } + + public Decimal Qty { get; set; } + public Decimal SUMQTY { get; set; } + public string PartDesc1 { get; set; } + + public string PartDesc2 { get; set; } + public string Unit { get; set; } + [NotMapped] + public string Partname { get; set; } + [NotMapped] + public List PartList { set; get; } + + } +} diff --git a/Models/ScpEntity/V_TB_ASK.cs b/Models/ScpEntity/V_TB_ASK.cs index 6f51266..ecc15ee 100644 --- a/Models/ScpEntity/V_TB_ASK.cs +++ b/Models/ScpEntity/V_TB_ASK.cs @@ -61,6 +61,7 @@ namespace CK.SCP.Models.ScpEntity public string Extend3 { get; set; } public string SubSite { get; set; } + //public string AskType { get; set; } #region 条件 [NotMapped] public string Batch { get; set; } @@ -84,6 +85,8 @@ namespace CK.SCP.Models.ScpEntity public string Month { get; set; } [NotMapped] public bool IsComplete { get; set; } + public string AskType { get; set; } + #endregion } } diff --git a/Models/ScpEntity/V_TB_ASK_DETAIL.cs b/Models/ScpEntity/V_TB_ASK_DETAIL.cs index ff16455..21a1113 100644 --- a/Models/ScpEntity/V_TB_ASK_DETAIL.cs +++ b/Models/ScpEntity/V_TB_ASK_DETAIL.cs @@ -125,7 +125,11 @@ namespace CK.SCP.Models.ScpEntity public string ReceiveUser { get; set; } [NotMapped] public DateTime ProduceDate { get; set; } + [NotMapped] + public string Time { get; set; } + [NotMapped] + public string MaxTime { get; set; } #endregion } diff --git a/Models/ScpEntity/V_TB_ASN.cs b/Models/ScpEntity/V_TB_ASN.cs index 684f9b6..f0330a2 100644 --- a/Models/ScpEntity/V_TB_ASN.cs +++ b/Models/ScpEntity/V_TB_ASN.cs @@ -37,7 +37,7 @@ namespace CK.SCP.Models.ScpEntity public DateTime? ReceiveTime { get; set; } [StringLength(50)] public string ReceiveUser { get; set; } - + public DateTime EndTime { get; set; } [StringLength(50)] public string ErpBillNum { get; set; } public int? ModType { get; set; } diff --git a/Models/ScpEntity/V_TB_INVOICE_DETAIL.cs b/Models/ScpEntity/V_TB_INVOICE_DETAIL.cs index b03180c..98488a1 100644 --- a/Models/ScpEntity/V_TB_INVOICE_DETAIL.cs +++ b/Models/ScpEntity/V_TB_INVOICE_DETAIL.cs @@ -85,6 +85,8 @@ namespace CK.SCP.Models.ScpEntity public string SubSite { get; set; } - + public string Extend1 { get; set; } + public string Extend2 { get; set; } + } } diff --git a/Models/ScpEntity/V_TB_MAXPO.cs b/Models/ScpEntity/V_TB_MAXPO.cs new file mode 100644 index 0000000..ff1b808 --- /dev/null +++ b/Models/ScpEntity/V_TB_MAXPO.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace CK.SCP.Models.ScpEntity +{ + public partial class V_TB_MAXPO + { + + [DatabaseGenerated(DatabaseGeneratedOption.Identity)] + public long UID { get; set; } + + [Key] + [Column(Order = 0)] + [StringLength(50)] + public string PoBillNum { get; set; } + public string VendId { get; set; } + public string VendName { get; set; } + public DateTime CreateTime { get; set; } + public string CreateUser { get; set; } + public string ContractNo { get; set; } + public string ContractMonth { get; set; } + public string Site { get; set; } + public string Remark { get; set; } + [NotMapped] + public DateTime? BeginTime { get; set; } + [NotMapped] + public DateTime? EndTime { get; set; } + public bool IsDeleted { get; set; } + } +} diff --git a/Models/ScpEntity/V_TB_MAXPO_CONSUME .cs b/Models/ScpEntity/V_TB_MAXPO_CONSUME .cs new file mode 100644 index 0000000..192a44f --- /dev/null +++ b/Models/ScpEntity/V_TB_MAXPO_CONSUME .cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace CK.SCP.Models.ScpEntity +{ + public partial class V_TB_MAXPO_CONSUME + { + [Key] + public long UID { get; set; } + + public string PartCode { get; set; } + public string VendId { get; set; } + public string PoBillNum { get; set; } + public string ContractMonth { get; set; } + public string BillNum { get; set; } + public string PartDesc1 { get; set; } + public string PartDesc2 { get; set; } + public string VendName{ get; set; } + public DateTime? ShipTime { get; set; } + public decimal PoQty { get; set; } + + [NotMapped] + public List PoList { set; get; } + [NotMapped] + public List PartList { set; get; } + + } +} diff --git a/Models/ScpEntity/V_TB_MAXPO_DETAIL.cs b/Models/ScpEntity/V_TB_MAXPO_DETAIL.cs new file mode 100644 index 0000000..ae727c4 --- /dev/null +++ b/Models/ScpEntity/V_TB_MAXPO_DETAIL.cs @@ -0,0 +1,64 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace CK.SCP.Models.ScpEntity +{ + public partial class V_TB_MAXPO_DETAIL + { + + [DatabaseGenerated(DatabaseGeneratedOption.Identity)] + [Key] + public long UID { get; set; } + + + [Column(Order = 0)] + [StringLength(50)] + public string PoBillNum { get; set; } + + public string PartCode { get; set; } + public string PartNumber { get; set; } + public string Texture { get; set; } + public string Model { get; set; } + public string Finprspec { get; set; } + public string TechStandard { get; set; } + public decimal MinordQty { get; set; } + public decimal Singlecon { get; set; } + public decimal OrderQtyd { get; set; } + public decimal OrderQtykg { get; set; } + public decimal OrderNumber { get; set; } + public string forecastone { get; set; } + public string forecasttwo { get; set; } + public string forecastthree { get; set; } + public string forecastfour { get; set; } + public string forecastfive { get; set; } + public string forecastsix { get; set; } + public string Matermanu { get; set; } + + public decimal BomQty { get; set; } + public string PartDesc2 { get; set; } + public int PoLine { get; set; } + public decimal SurplusQty { get; set; } + public string VendId { get; set; } + public string ContractMonth { get; set; } + public decimal AnQty { get; set; } + public decimal AsnQty { get; set; } + public decimal RecQty { get; set; } + + public string CreateUser { get; set; } + [NotMapped] + public DateTime? BeginTime { get; set; } + [NotMapped] + public DateTime? EndTime { get; set; } + public DateTime? CreateTime { get; set; } + public string VendName { get; set; } + public decimal ReceQty { get; set; } + public decimal ReturnQty { get; set; } + public bool IsDeleted { get; set; } + } + +} diff --git a/Models/ScpEntity/V_TB_PO.cs b/Models/ScpEntity/V_TB_PO.cs index ff3a585..a60f82b 100644 --- a/Models/ScpEntity/V_TB_PO.cs +++ b/Models/ScpEntity/V_TB_PO.cs @@ -57,6 +57,11 @@ namespace CK.SCP.Models.ScpEntity public string Extend3 { get; set; } public string SubSite { get; set; } + [NotMapped] + public List MaxpoList { get; set; } + + [NotMapped]///Ҫ󵽻 + public DateTime? EndTime_End { get; set; } diff --git a/Models/ScpEntity/V_TB_PO_DETAIL.cs b/Models/ScpEntity/V_TB_PO_DETAIL.cs index 6c8d7b4..b061151 100644 --- a/Models/ScpEntity/V_TB_PO_DETAIL.cs +++ b/Models/ScpEntity/V_TB_PO_DETAIL.cs @@ -67,5 +67,14 @@ namespace CK.SCP.Models.ScpEntity public string Extend3 { get; set; } public string SubSite { get; set; } + + [NotMapped] + public string Subpartspec { get; set; }//Ӽ + + [NotMapped] + public string ContractNo { get; set; }//ͬ + + [NotMapped] + public string ContractMonth { get; set; }//ͬ } } diff --git a/Models/ScpEntity/V_TB_PO_SUBDETAIL.cs b/Models/ScpEntity/V_TB_PO_SUBDETAIL.cs new file mode 100644 index 0000000..693a67b --- /dev/null +++ b/Models/ScpEntity/V_TB_PO_SUBDETAIL.cs @@ -0,0 +1,39 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace CK.SCP.Models.ScpEntity +{ + public partial class V_TB_PO_SUBDETAIL + { + + [DatabaseGenerated(DatabaseGeneratedOption.Identity)] + [Key] + public long UID { get; set; } + + public string PoBillNum { get; set; } + + public string PartCode { get; set; } + public decimal Qty { get; set; } + public decimal SubQty { get; set; } + + public string Site { get; set; } + + public string SubPartCode { get; set; } + + + + public string BOMedtiton { get; set; } + + public int PoLine { get; set; } + public string PartDesc2 { get; set; } + + + + public string Unit { get; set; } + } +} diff --git a/Models/ScpEntity/V_TB_REEEE.cs b/Models/ScpEntity/V_TB_REEEE.cs new file mode 100644 index 0000000..e3af992 --- /dev/null +++ b/Models/ScpEntity/V_TB_REEEE.cs @@ -0,0 +1,33 @@ +namespace CK.SCP.Models.ScpEntity +{ + using System; + using System.Collections.Generic; + using System.ComponentModel.DataAnnotations; + using System.ComponentModel.DataAnnotations.Schema; + [Serializable] + public partial class V_TB_REEEE + { + [Key] + [DatabaseGenerated(DatabaseGeneratedOption.Identity)] + public long UID { get; set; } + public string PoBillNum { get; set; } + [StringLength(50)] + public string PartCode { get; set; } + public string DockCode { get; set; } + public decimal Qty { get; set; } + + public string VendId { get; set; } + public DateTime? CreateTime { get; set; } + public string VendName { get; set; } + public string PartDesc2 { get; set; } + public string CreateUser { get; set; } + public string PartGroup { get; set; } + public string Describe { get; set; } + public string Buyer { get; set; } + //public string Extend2 { get; set; } + [NotMapped] + public Nullable ReceiveTimeBegin { get; set; } + [NotMapped] + public Nullable ReceiveTimeEnd { get; set; } + } +} \ No newline at end of file diff --git a/Models/UniApiEntity/PURReplenishQty.cs b/Models/UniApiEntity/PURReplenishQty.cs new file mode 100644 index 0000000..20685c8 --- /dev/null +++ b/Models/UniApiEntity/PURReplenishQty.cs @@ -0,0 +1,17 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + + +namespace CK.SCP.Models.UniApiEntity +{ + public partial class PURReplenishQties + { + [Key] + public int di_batchno { get; set; } + public string PURDOCNO { get; set; } + public string purDocLineNO { get; set; } + public decimal replenishQty { get; set; } + public string client { get; set; } + public string plant { get; set; } + } +} diff --git a/Models/UniApiEntity/QadTableName.cs b/Models/UniApiEntity/QadTableName.cs index 4e2a7bf..bebfe20 100644 --- a/Models/UniApiEntity/QadTableName.cs +++ b/Models/UniApiEntity/QadTableName.cs @@ -44,11 +44,13 @@ namespace CK.SCP.Models.UniApiEntity { [Description("采购订单")] xxscm_pod_det, + [Description("大订单")] + xxscm_maxpod_det, [Description("发货单(ASN)")] xxscm_tx_mstr, [Description("发货单标签列表")] xxscm_tx_det, - [Description("发票")] + [Description("发货数量")] xxscm_inv_det, } diff --git a/Models/UniApiEntity/UniApiEntities.cs b/Models/UniApiEntity/UniApiEntities.cs index 96a1eeb..a5a39c6 100644 --- a/Models/UniApiEntity/UniApiEntities.cs +++ b/Models/UniApiEntity/UniApiEntities.cs @@ -1,3 +1,4 @@ +using CK.SCP.Models.ScpEntity; using System.Data.Entity; namespace CK.SCP.Models.UniApiEntity @@ -13,7 +14,9 @@ namespace CK.SCP.Models.UniApiEntity : base("name=ModelUniApi") { } - + public virtual DbSet xxerp_MaxbatchNO { get; set; } + public virtual DbSet xxDiMaxes { get; set; } + public virtual DbSet xxDiMaxes_Po { get; set; } public virtual DbSet xxmes_ctrl { get; set; } public virtual DbSet xxqad_cm_mstr { get; set; } public virtual DbSet xxqad_ctrl { get; set; } @@ -33,6 +36,7 @@ namespace CK.SCP.Models.UniApiEntity public virtual DbSet xxscm_ctrl { get; set; } public virtual DbSet xxscm_inv_det { get; set; } public virtual DbSet xxscm_pod_det { get; set; } + public virtual DbSet xxscm_maxpod_det { get; set; } public virtual DbSet xxqad_ppod_det { get; set; } public virtual DbSet xxscm_tx_det { get; set; } public virtual DbSet xxscm_tx_mstr { get; set; } @@ -48,9 +52,9 @@ namespace CK.SCP.Models.UniApiEntity public virtual DbSet xxwms_tag_det { get; set; } public virtual DbSet xxwms_tr_det { get; set; } public virtual DbSet xxwms_qua_det { get; set; } - + public virtual DbSet PURReplenishQty { get; set; } public virtual DbSet xxwms_review_det { get; set; } - + public virtual DbSet PURSubcontractors { get; set; } protected override void OnModelCreating(DbModelBuilder modelBuilder) { modelBuilder.Entity() @@ -1241,126 +1245,7 @@ namespace CK.SCP.Models.UniApiEntity .Property(e => e.xxscm_inv_updateur) .IsUnicode(false); - modelBuilder.Entity() - .Property(e => e.xxscm_pod_seq) - .IsUnicode(false); - - modelBuilder.Entity() - .Property(e => e.xxscm_pod_nbr) - .IsUnicode(false); - - modelBuilder.Entity() - .Property(e => e.xxscm_pod_modtype) - .IsUnicode(false); - - modelBuilder.Entity() - .Property(e => e.xxscm_pod_site) - .IsUnicode(false); - - modelBuilder.Entity() - .Property(e => e.xxscm_pod_domain) - .IsUnicode(false); - - modelBuilder.Entity() - .Property(e => e.xxscm_pod_part) - .IsUnicode(false); - - modelBuilder.Entity() - .Property(e => e.xxscm_pod_desc) - .IsUnicode(false); - - modelBuilder.Entity() - .Property(e => e.xxscm_pod_qty_ord) - .HasPrecision(18, 5); - - modelBuilder.Entity() - .Property(e => e.xxscm_pod_qty_rct) - .HasPrecision(18, 5); - - modelBuilder.Entity() - .Property(e => e.xxscm_pod_qty_std) - .HasPrecision(18, 5); - - modelBuilder.Entity() - .Property(e => e.xxscm_pod_price) - .HasPrecision(18, 5); - - modelBuilder.Entity() - .Property(e => e.xxscm_pod_curr) - .IsUnicode(false); - - modelBuilder.Entity() - .Property(e => e.xxscm_pod_loc_um) - .IsUnicode(false); - - modelBuilder.Entity() - .Property(e => e.xxscm_pod_um) - .IsUnicode(false); - - modelBuilder.Entity() - .Property(e => e.xxscm_pod_um_conv) - .HasPrecision(18, 5); - - modelBuilder.Entity() - .Property(e => e.xxscm_pod_vend) - .IsUnicode(false); - - modelBuilder.Entity() - .Property(e => e.xxscm_pod_name) - .IsUnicode(false); - - modelBuilder.Entity() - .Property(e => e.xxscm_pod_attn) - .IsUnicode(false); - - modelBuilder.Entity() - .Property(e => e.xxscm_pod_ship) - .IsUnicode(false); - - modelBuilder.Entity() - .Property(e => e.xxscm_pod_made) - .IsUnicode(false); - - modelBuilder.Entity() - .Property(e => e.xxscm_pod_buyer) - .IsUnicode(false); - - modelBuilder.Entity() - .Property(e => e.xxscm_pod_buyer_phone) - .IsUnicode(false); - - modelBuilder.Entity() - .Property(e => e.xxscm_pod_status) - .IsUnicode(false); - - modelBuilder.Entity() - .Property(e => e.xxscm_pod_qadread) - .IsUnicode(false); - - modelBuilder.Entity() - .Property(e => e.xxscm_pod_wmsread) - .IsUnicode(false); - - modelBuilder.Entity() - .Property(e => e.xxscm_pod_scmread) - .IsUnicode(false); - - modelBuilder.Entity() - .Property(e => e.xxscm_pod_mesread) - .IsUnicode(false); - - modelBuilder.Entity() - .Property(e => e.xxscm_pod_rmks) - .IsUnicode(false); - - modelBuilder.Entity() - .Property(e => e.xxscm_pod_createur) - .IsUnicode(false); - - modelBuilder.Entity() - .Property(e => e.xxscm_pod_updateur) - .IsUnicode(false); - + modelBuilder.Entity() .Property(e => e.xxscm_tx_seq) .IsUnicode(false); @@ -1500,6 +1385,9 @@ namespace CK.SCP.Models.UniApiEntity modelBuilder.Entity() .Property(e => e.xxscm_tx_mesread) .IsUnicode(false); + modelBuilder.Entity() + .Property(e => e.xxscm_tx_type) + .IsUnicode(false); modelBuilder.Entity() .Property(e => e.xxscm_tx_rmks) @@ -2177,7 +2065,33 @@ namespace CK.SCP.Models.UniApiEntity modelBuilder.Entity() .Property(e => e.xxwms_tr_updateur) .IsUnicode(false); - + modelBuilder.Entity() + .Property(e => e.COMPONQUANTITY) + .HasPrecision(18, 5); + modelBuilder.Entity() + .Property(e => e.quantity) + .HasPrecision(18, 5); + modelBuilder.Entity() + .Property(e => e.price) + .HasPrecision(18, 5); + modelBuilder.Entity() + .Property(e => e.xxscm_pod_qty_ord) + .HasPrecision(18, 5); + modelBuilder.Entity() + .Property(e => e.xxscm_maxpod_qty) + .HasPrecision(18, 6); + modelBuilder.Entity() +.Property(e => e.xxscm_maxpod_orderqty) +.HasPrecision(18, 6); + modelBuilder.Entity() +.Property(e => e.xxscm_maxpod_orderqtyd) +.HasPrecision(18, 6); + modelBuilder.Entity() +.Property(e => e.xxscm_maxpod_orderqtykg) +.HasPrecision(18, 6); + modelBuilder.Entity() +.Property(e => e.xxscm_maxpod_consumption) +.HasPrecision(18, 6); } } } diff --git a/Models/UniApiEntity/xxDiMaxes.cs b/Models/UniApiEntity/xxDiMaxes.cs new file mode 100644 index 0000000..65f4af1 --- /dev/null +++ b/Models/UniApiEntity/xxDiMaxes.cs @@ -0,0 +1,14 @@ +using System.ComponentModel.DataAnnotations; + +namespace CK.SCP.Models.UniApiEntity +{ + public partial class xxDiMaxes + { + [Key] + public int ID { get; set; } + public int Di_Batchno { get; set; } + public int Di_Batchno_part { get; set; } + public int Di_Batchno_price { get; set; } + public int Di_Batchno_NETprice { get; set; } + } +} diff --git a/Models/UniApiEntity/xxDiMaxes_Po.cs b/Models/UniApiEntity/xxDiMaxes_Po.cs new file mode 100644 index 0000000..c4008b7 --- /dev/null +++ b/Models/UniApiEntity/xxDiMaxes_Po.cs @@ -0,0 +1,11 @@ +using System.ComponentModel.DataAnnotations; +namespace CK.SCP.Models.UniApiEntity +{ + public partial class xxDiMaxes_Po + { + [Key] + public int UID { get; set; } + public int Di_Batchno { get; set; } + + } +} diff --git a/Models/UniApiEntity/xxerp_MaxbatchNO.cs b/Models/UniApiEntity/xxerp_MaxbatchNO.cs new file mode 100644 index 0000000..14d45fb --- /dev/null +++ b/Models/UniApiEntity/xxerp_MaxbatchNO.cs @@ -0,0 +1,15 @@ +using System.ComponentModel.DataAnnotations; + +namespace CK.SCP.Models.UniApiEntity +{ + public partial class xxerp_MaxbatchNO + { + [Key] + public int xxerp_uid { get; set; } + public string tablename { get; set; } + public string Remark { get; set; } + + public int MaxdibatchNO { get; set; } + + } +} diff --git a/Models/UniApiEntity/xxscm_ctrl.cs b/Models/UniApiEntity/xxscm_ctrl.cs index 44e0552..ab35730 100644 --- a/Models/UniApiEntity/xxscm_ctrl.cs +++ b/Models/UniApiEntity/xxscm_ctrl.cs @@ -25,6 +25,6 @@ namespace CK.SCP.Models.UniApiEntity [StringLength(50)] public string xxscm_wms { get; set; } [StringLength(50)] - public string xxscm_rmks { get; set; } + public string xxscm_rmks { get; set; } } } diff --git a/Models/UniApiEntity/xxscm_inv_det.cs b/Models/UniApiEntity/xxscm_inv_det.cs index 7c00350..6270419 100644 --- a/Models/UniApiEntity/xxscm_inv_det.cs +++ b/Models/UniApiEntity/xxscm_inv_det.cs @@ -107,11 +107,11 @@ namespace CK.SCP.Models.UniApiEntity public string xxscm_inv_project { get; set; } - public decimal xxscm_inv_extend1 { get; set; } - public decimal xxscm_inv_extend2 { get; set; } - public decimal xxscm_inv_extend3 { get; set; } - public decimal xxscm_inv_extend4 { get; set; } - public decimal xxscm_inv_extend5 { get; set; } + //public decimal xxscm_inv_extend1 { get; set; } + //public decimal xxscm_inv_extend2 { get; set; } + //public decimal xxscm_inv_extend3 { get; set; } + //public decimal xxscm_inv_extend4 { get; set; } + //public decimal xxscm_inv_extend5 { get; set; } diff --git a/Models/UniApiEntity/xxscm_maxpo_det.cs b/Models/UniApiEntity/xxscm_maxpo_det.cs new file mode 100644 index 0000000..17ded69 --- /dev/null +++ b/Models/UniApiEntity/xxscm_maxpo_det.cs @@ -0,0 +1,42 @@ +using System; +using System.ComponentModel.DataAnnotations; + +namespace CK.SCP.Models.UniApiEntity +{ + public partial class xxscm_maxpod_det + { + [Key] + public int xxscm_maxpod_uid { get; set; } + public string xxscm_maxpod_seq { get; set; }//任务号 + public string xxscm_maxpod_nbr { get; set; }//订单号/合同编号 + public int xxscm_maxpod_line { get; set; }//订单行号 + + public string xxscm_maxpod_part { get; set; }//零件号(父件) + public string xxscm_maxpod_groupart { get; set; }//原材物料号(子件) + public decimal xxscm_maxpod_qty { get; set; }//订货件数(小订单消耗对应的大订单数) + public decimal xxscm_maxpod_orderqty { get; set; }//起订量 + public decimal xxscm_maxpod_orderqtyd { get; set; }//订货量(吨) + public decimal xxscm_maxpod_orderqtykg { get; set; }//订货量(千克) + public decimal xxscm_maxpod_consumption { get; set; }//单件消耗(千克) + public string xxscm_maxpod_createuser { get; set; }//创建者 + public DateTime xxscm_maxpod_createtime { get; set; }//创建时间 + + public string xxscm_maxpod_month { get; set; }//合同月 + public string xxscm_maxpod_Model { get; set; }//车型 + public string xxscm_maxpod_texture { get; set; }//材质 + public string xxscm_maxpod_testandard { get; set; }//技术标准 + public string xxscm_maxpod_vend { get; set; }//供应商编号 + public string xxscm_maxpod_manufacturer { get; set; }//材料厂家 + public string xxscm_maxpod_forecastone { get; set; }//预测1/数量 + public string xxscm_maxpod_forecasttwo { get; set; }//预测2/数量 + public string xxscm_maxpod_forecastthree { get; set; }//预测3/数量 + public string xxscm_maxpod_forecastfour { get; set; }//预测4/数量 + public string xxscm_maxpod_forecastfive { get; set; }//预测5/数量 + public string xxscm_maxpod_forecastsix { get; set; }//预测6/数量 + public string xxscm_maxpod_idention { get; set; }//标识新增或者修改新增为A修改为U + public string xxscm_maxpod_site { get; set; }//地点 + public string xxscm_maxpod_domain { get; set; }//域 + + + } +} diff --git a/Models/UniApiEntity/xxscm_pod_det.cs b/Models/UniApiEntity/xxscm_pod_det.cs index 34f1008..29cfc72 100644 --- a/Models/UniApiEntity/xxscm_pod_det.cs +++ b/Models/UniApiEntity/xxscm_pod_det.cs @@ -7,115 +7,42 @@ namespace CK.SCP.Models.UniApiEntity { [Key] public int xxscm_pod_uid { get; set; } - - [Required(AllowEmptyStrings = true)] - [StringLength(50)] public string xxscm_pod_seq { get; set; } - - [Required(AllowEmptyStrings = true)] - [StringLength(8)] public string xxscm_pod_nbr { get; set; } - public int xxscm_pod_line { get; set; } - [Required(AllowEmptyStrings = true)] - [StringLength(8)] - public string xxscm_pod_modtype { get; set; } - - [Required(AllowEmptyStrings = true)] - [StringLength(8)] - public string xxscm_pod_site { get; set; } - - [Required(AllowEmptyStrings = true)] - [StringLength(8)] + public string xxscm_pod_modtype { get; set; } + public string xxscm_pod_ordType { get; set; } + public string xxscm_pod_site { get; set; } public string xxscm_pod_domain { get; set; } - - [Required(AllowEmptyStrings = true)] - [StringLength(18)] - public string xxscm_pod_part { get; set; } - - [StringLength(50)] - public string xxscm_pod_desc { get; set; } - + public string xxscm_pod_part { get; set; } public decimal xxscm_pod_qty_ord { get; set; } - public decimal xxscm_pod_qty_rct { get; set; } - public decimal xxscm_pod_qty_std { get; set; } - public DateTime xxscm_pod_due_date { get; set; } - public decimal xxscm_pod_price { get; set; } - - [Required(AllowEmptyStrings = true)] - [StringLength(8)] - public string xxscm_pod_curr { get; set; } - - [Required(AllowEmptyStrings = true)] - [StringLength(8)] public string xxscm_pod_loc_um { get; set; } - - [Required(AllowEmptyStrings = true)] - [StringLength(8)] - public string xxscm_pod_um { get; set; } - public decimal xxscm_pod_um_conv { get; set; } - - [Required(AllowEmptyStrings = true)] - [StringLength(8)] + public string xxscm_pod_um { get; set; } public string xxscm_pod_vend { get; set; } - - [StringLength(100)] - public string xxscm_pod_name { get; set; } - - [StringLength(8)] - public string xxscm_pod_attn { get; set; } - - [StringLength(8)] public string xxscm_pod_ship { get; set; } - - [StringLength(2)] - public string xxscm_pod_made { get; set; } - - public bool xxscm_pod_confirm { get; set; } - - [Required(AllowEmptyStrings = true)] - [StringLength(8)] public string xxscm_pod_buyer { get; set; } - [StringLength(20)] public string xxscm_pod_buyer_phone { get; set; } - - [Required(AllowEmptyStrings = true)] - [StringLength(8)] - public string xxscm_pod_status { get; set; } - - [Required(AllowEmptyStrings = true)] - [StringLength(1)] public string xxscm_pod_qadread { get; set; } - - [Required(AllowEmptyStrings = true)] - [StringLength(1)] public string xxscm_pod_wmsread { get; set; } - - [Required(AllowEmptyStrings = true)] - [StringLength(1)] public string xxscm_pod_scmread { get; set; } - - [Required(AllowEmptyStrings = true)] - [StringLength(1)] public string xxscm_pod_mesread { get; set; } - - public string xxscm_pod_rmks { get; set; } - public DateTime? xxscm_pod_createdt { get; set; } - - [StringLength(8)] public string xxscm_pod_createur { get; set; } - - public DateTime? xxscm_pod_updatedt { get; set; } - - [StringLength(8)] - public string xxscm_pod_updateur { get; set; } + public string xxscm_pod_groupWareMaterielNO { get; set; } + public string xxscm_pod_componquantity { get; set; } + public string xxscm_pod_measureBaseUnit { get; set; } + public string xxscm_pod_returnsItem { get; set; } + public string xxscm_pod_curr { get; set; } + public string xxscm_pod_status { get; set; } + public string xxscm_pod_ctype { get; set; } + public string xxscm_pod_companyCode { get; set; } + public string xxscm_pod_purOrg { get; set; } } } diff --git a/Models/UniApiEntity/xxscm_tx_mstr.cs b/Models/UniApiEntity/xxscm_tx_mstr.cs index c9f8d4d..a5145a5 100644 --- a/Models/UniApiEntity/xxscm_tx_mstr.cs +++ b/Models/UniApiEntity/xxscm_tx_mstr.cs @@ -20,7 +20,7 @@ namespace CK.SCP.Models.UniApiEntity [StringLength(50)] public string xxscm_tx_po_line { get; set; } [Required(AllowEmptyStrings = true)] - [StringLength(18)] + [StringLength(50)] public string xxscm_tx_part { get; set; } public decimal xxscm_tx_qty_total { get; set; } diff --git a/Models/UniApiEntity/xxwms_rc_det.cs b/Models/UniApiEntity/xxwms_rc_det.cs index 290adee..1d8d030 100644 --- a/Models/UniApiEntity/xxwms_rc_det.cs +++ b/Models/UniApiEntity/xxwms_rc_det.cs @@ -26,7 +26,7 @@ namespace CK.SCP.Models.UniApiEntity public int xxwms_rc_po_line { get; set; } [Required(AllowEmptyStrings = true)] - [StringLength(18)] + [StringLength(40)] public string xxwms_rc_part { get; set; } public decimal xxwms_rc_qty_total { get; set; } @@ -41,7 +41,7 @@ namespace CK.SCP.Models.UniApiEntity [StringLength(50)] public string xxwms_rc_vend { get; set; } - [StringLength(20)] + public string xxwms_rc_ware_class { get; set; } [StringLength(20)] @@ -55,7 +55,7 @@ namespace CK.SCP.Models.UniApiEntity public string xxwms_rc_po_um { get; set; } [Required(AllowEmptyStrings = true)] - [StringLength(8)] + [StringLength(50)] public string xxwms_rc_loc_um { get; set; } public decimal xxwms_rc_conv { get; set; } diff --git a/Models/UniApiEntity/xxwms_rt_det.cs b/Models/UniApiEntity/xxwms_rt_det.cs index cbb589a..a3b8855 100644 --- a/Models/UniApiEntity/xxwms_rt_det.cs +++ b/Models/UniApiEntity/xxwms_rt_det.cs @@ -17,7 +17,7 @@ namespace CK.SCP.Models.UniApiEntity public string xxwms_rt_nbr { get; set; } [Required(AllowEmptyStrings = true)] - [StringLength(8)] + [StringLength(20)] public string xxwms_rt_po_nbr { get; set; } public int xxwms_rt_po_line { get; set; } @@ -38,7 +38,7 @@ namespace CK.SCP.Models.UniApiEntity [StringLength(8)] public string xxwms_rt_vend { get; set; } - [StringLength(20)] + [StringLength(200)] public string xxwms_rt_ware_class { get; set; } [StringLength(20)] @@ -52,7 +52,7 @@ namespace CK.SCP.Models.UniApiEntity [StringLength(2)] public string xxwms_rt_po_um { get; set; } - [StringLength(2)] + [StringLength(50)] public string xxwms_rt_loc_um { get; set; } public decimal xxwms_rt_conv { get; set; } diff --git a/Models/WmsEntity/TableSchema1.cs b/Models/WmsEntity/TableSchema1.cs index 69c6b92..5f28270 100644 --- a/Models/WmsEntity/TableSchema1.cs +++ b/Models/WmsEntity/TableSchema1.cs @@ -1,9 +1 @@ -//------------------------------------------------------------------------------ -// -// 此代码已从模板生成。 -// -// 手动更改此文件可能导致应用程序出现意外的行为。 -// 如果重新生成代码,将覆盖对此文件的手动更改。 -// -//------------------------------------------------------------------------------ - + \ No newline at end of file diff --git a/SCP.sln b/SCP.sln index 25dbcf4..54231fd 100644 --- a/SCP.sln +++ b/SCP.sln @@ -34,7 +34,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "库存查询脚本", "库 ..\Users\asus\Desktop\20200820唐明亮.sql = ..\Users\asus\Desktop\20200820唐明亮.sql ..\Desktop\SCP项目\VIEW_PRODUCT_DETAIL.sql = ..\Desktop\SCP项目\VIEW_PRODUCT_DETAIL.sql ..\Desktop\SCP项目\Wms数据库设置.ini = ..\Desktop\SCP项目\Wms数据库设置.ini - ..\..\..\Desktop\常熟定时更新程序.txt = ..\..\..\Desktop\常熟定时更新程序.txt + ..\..\Desktop\常熟定时更新程序.txt = ..\..\Desktop\常熟定时更新程序.txt EndProjectSection EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "权限库备份", "权限库备份", "{137B27CF-8F56-49BB-9705-060995312716}" @@ -51,6 +51,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CK.SCP.GrupUniApi", "UniApi EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UniApiWpf", "UniApiWpf\UniApiWpf.csproj", "{28128F6F-8EC3-4C15-8AC4-475F6AF6FFDB}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebService", "WebService\WebService.csproj", "{612FA92D-3A80-4E83-98CE-383533A0BFC6}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -85,6 +87,10 @@ Global {28128F6F-8EC3-4C15-8AC4-475F6AF6FFDB}.Debug|Any CPU.Build.0 = Debug|Any CPU {28128F6F-8EC3-4C15-8AC4-475F6AF6FFDB}.Release|Any CPU.ActiveCfg = Release|Any CPU {28128F6F-8EC3-4C15-8AC4-475F6AF6FFDB}.Release|Any CPU.Build.0 = Release|Any CPU + {612FA92D-3A80-4E83-98CE-383533A0BFC6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {612FA92D-3A80-4E83-98CE-383533A0BFC6}.Debug|Any CPU.Build.0 = Debug|Any CPU + {612FA92D-3A80-4E83-98CE-383533A0BFC6}.Release|Any CPU.ActiveCfg = Release|Any CPU + {612FA92D-3A80-4E83-98CE-383533A0BFC6}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/SCP/Admin/profile.aspx b/SCP/Admin/profile.aspx index b64be09..a6c5672 100644 --- a/SCP/Admin/profile.aspx +++ b/SCP/Admin/profile.aspx @@ -20,10 +20,10 @@ ShowRedStar="true"> + ShowRedStar="true"> + Required="true" ShowRedStar="true" CompareControl="tbxNewPassword" CompareOperator="Equal" CompareMessage="两次密码不一致!"> diff --git a/SCP/Admin/profile.aspx.cs b/SCP/Admin/profile.aspx.cs index 87b89d9..db970ff 100644 --- a/SCP/Admin/profile.aspx.cs +++ b/SCP/Admin/profile.aspx.cs @@ -7,6 +7,8 @@ using System.Web.UI.WebControls; using FineUI; using System.Linq; using CK.SCP.Models.AppBoxEntity; +using CK.SCP.Models; +using System.Text.RegularExpressions; namespace SCP.admin { @@ -28,7 +30,8 @@ namespace SCP.admin TranslatorAgent(tbxConfirmNewPassword); TranslatorAgent(btnSave); TranslatorAgent(btnSaveUser); - + tbxNewPassword.Regex = ScpCache.Config.密码验证格式; + tbxNewPassword.RegexMessage = ScpCache.Config.密码验证提示语; } } @@ -67,7 +70,12 @@ namespace SCP.admin tbxOldPassword.MarkInvalid("当前密码不正确!"); return; } - + Regex _regex = new Regex(ScpCache.Config.密码验证格式); + if (!_regex.IsMatch(newPass)) + { + Alert.Show(GetResourceKey(ScpCache.Config.密码验证提示语)); + return; + } if (!string.IsNullOrEmpty(tbxCellPhone.Text.Trim())) { user.CellPhone = tbxCellPhone.Text; @@ -79,6 +87,7 @@ namespace SCP.admin user.Password = PasswordUtil.CreateDbPassword(newPass); + user.LastUpdatePasswordTime = DateTime.Now; DB.SaveChanges(); Alert.ShowInTop("修改密码成功!"); diff --git a/SCP/Admin/profileExtend.aspx.cs b/SCP/Admin/profileExtend.aspx.cs index c7573c0..d2a1b23 100644 --- a/SCP/Admin/profileExtend.aspx.cs +++ b/SCP/Admin/profileExtend.aspx.cs @@ -55,6 +55,7 @@ namespace SCP.admin } user.Password = PasswordUtil.CreateDbPassword(newPass); + user.LastUpdatePasswordTime = DateTime.Now; DB.SaveChanges(); Alert.ShowInTop("修改密码成功!"); diff --git a/SCP/Admin/user.aspx.cs b/SCP/Admin/user.aspx.cs index aae5323..273a1c9 100644 --- a/SCP/Admin/user.aspx.cs +++ b/SCP/Admin/user.aspx.cs @@ -255,7 +255,7 @@ namespace SCP.admin // 执行数据库操作 //DB.Users.Where(u => ids.Contains(u.UserID)).ToList().ForEach(u => u.Enabled = enabled); //DB.SaveChanges(); - DB.Users.Where(u => ids.Contains(u.ID)).Update(u => new User { Enabled = enabled }); + DB.Users.Where(u => ids.Contains(u.ID)).Update(u => new User { Enabled = enabled,ErrorCount=0 }); // 重新绑定表格 BindGrid(); diff --git a/SCP/Admin/user_changepassword.aspx b/SCP/Admin/user_changepassword.aspx index f4c94aa..5436bcb 100644 --- a/SCP/Admin/user_changepassword.aspx +++ b/SCP/Admin/user_changepassword.aspx @@ -36,7 +36,7 @@ TextMode="Password"> + ShowRedStar="true" TextMode="Password" CompareControl="tbxPassword" CompareOperator="Equal" CompareMessage="两次密码不一致!"> diff --git a/SCP/Admin/user_changepassword.aspx.cs b/SCP/Admin/user_changepassword.aspx.cs index 2826396..54fbdd2 100644 --- a/SCP/Admin/user_changepassword.aspx.cs +++ b/SCP/Admin/user_changepassword.aspx.cs @@ -7,6 +7,8 @@ using System.Data.Entity; using System.Linq; using CK.SCP.Models.AppBoxEntity; using FineUI; +using CK.SCP.Models; +using System.Text.RegularExpressions; namespace SCP.admin { @@ -34,6 +36,8 @@ namespace SCP.admin if (!IsPostBack) { LoadData(); + tbxPassword.Regex = ScpCache.Config.密码验证格式; + tbxPassword.RegexMessage = ScpCache.Config.密码验证提示语; } } @@ -66,9 +70,16 @@ namespace SCP.admin protected void btnSaveClose_Click(object sender, EventArgs e) { + Regex _regex = new Regex(ScpCache.Config.密码验证格式); + if (!_regex.IsMatch(tbxPassword.Text.Trim())) + { + Alert.Show(GetResourceKey(ScpCache.Config.密码验证提示语)); + return; + } int id = GetQueryIntValue("id"); User item = DB.Users.Find(id); item.Password = PasswordUtil.CreateDbPassword(tbxPassword.Text.Trim()); + item.LastUpdatePasswordTime = DateTime.Now; DB.SaveChanges(); //Alert.Show("保存成功!", String.Empty, Alert.DefaultIcon, ActiveWindow.GetHidePostBackReference()); diff --git a/SCP/Admin/user_changepassword.aspx.designer.cs b/SCP/Admin/user_changepassword.aspx.designer.cs index e9e2a1f..52bcc78 100644 --- a/SCP/Admin/user_changepassword.aspx.designer.cs +++ b/SCP/Admin/user_changepassword.aspx.designer.cs @@ -2,16 +2,18 @@ // <自动生成> // 此代码由工具生成。 // -// 对此文件的更改可能会导致不正确的行为,并且如果 -// 重新生成代码,这些更改将会丢失。 +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 // //------------------------------------------------------------------------------ -namespace SCP.admin { - - - public partial class user_changepassword { - +namespace SCP.admin +{ + + + public partial class user_changepassword + { + /// /// form1 控件。 /// @@ -20,7 +22,7 @@ namespace SCP.admin { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::System.Web.UI.HtmlControls.HtmlForm form1; - + /// /// PageManager1 控件。 /// @@ -29,7 +31,7 @@ namespace SCP.admin { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUI.PageManager PageManager1; - + /// /// Panel1 控件。 /// @@ -38,7 +40,7 @@ namespace SCP.admin { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUI.Panel Panel1; - + /// /// Toolbar1 控件。 /// @@ -47,7 +49,7 @@ namespace SCP.admin { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUI.Toolbar Toolbar1; - + /// /// btnClose 控件。 /// @@ -56,7 +58,7 @@ namespace SCP.admin { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUI.Button btnClose; - + /// /// ToolbarSeparator2 控件。 /// @@ -65,7 +67,7 @@ namespace SCP.admin { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUI.ToolbarSeparator ToolbarSeparator2; - + /// /// btnSaveClose 控件。 /// @@ -74,7 +76,7 @@ namespace SCP.admin { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUI.Button btnSaveClose; - + /// /// SimpleForm1 控件。 /// @@ -83,7 +85,7 @@ namespace SCP.admin { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUI.SimpleForm SimpleForm1; - + /// /// labUserName 控件。 /// @@ -92,7 +94,7 @@ namespace SCP.admin { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUI.Label labUserName; - + /// /// labUserRealName 控件。 /// @@ -101,7 +103,7 @@ namespace SCP.admin { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUI.Label labUserRealName; - + /// /// tbxPassword 控件。 /// @@ -110,7 +112,7 @@ namespace SCP.admin { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUI.TextBox tbxPassword; - + /// /// tbxConfirmPassword 控件。 /// diff --git a/SCP/Admin/user_edit.aspx.cs b/SCP/Admin/user_edit.aspx.cs index 955b652..81d4934 100644 --- a/SCP/Admin/user_edit.aspx.cs +++ b/SCP/Admin/user_edit.aspx.cs @@ -200,7 +200,7 @@ namespace SCP.admin item.HomePhone = tbxHomePhone.Text.Trim(); item.Remark = tbxRemark.Text.Trim(); item.Enabled = cbxEnabled.Checked; - + item.ErrorCount = 0; if (String.IsNullOrEmpty(hfSelectedDept.Text)) { diff --git a/SCP/Admin/user_new.aspx b/SCP/Admin/user_new.aspx index 42d1fa2..758a15b 100644 --- a/SCP/Admin/user_new.aspx +++ b/SCP/Admin/user_new.aspx @@ -49,7 +49,7 @@ - + diff --git a/SCP/Admin/user_new.aspx.cs b/SCP/Admin/user_new.aspx.cs index 9e17659..aefb464 100644 --- a/SCP/Admin/user_new.aspx.cs +++ b/SCP/Admin/user_new.aspx.cs @@ -10,6 +10,7 @@ using CK.SCP.Controller; using FineUI; using ListItem = FineUI.ListItem; using CK.SCP.Models.ScpEntity; +using CK.SCP.Models; namespace SCP.admin { @@ -64,6 +65,7 @@ namespace SCP.admin DPL_Vender.Items.Insert(0, new FineUI.ListItem("", "")); } + tbxPassword.Text = ScpCache.Config.默认密码; } #region InitUserRole diff --git a/SCP/Business/PageBase.cs b/SCP/Business/PageBase.cs index 5e44e61..920d3b4 100644 --- a/SCP/Business/PageBase.cs +++ b/SCP/Business/PageBase.cs @@ -236,11 +236,10 @@ namespace SCP protected string GetSelectedDataKey(Grid grid, int dataIndex) { - string data = String.Empty; int rowIndex = grid.SelectedRowIndex; if (rowIndex >= 0) - { + { data = grid.DataKeys[rowIndex][dataIndex].ToString(); } return data; diff --git a/SCP/Common/MailHelper.cs b/SCP/Common/MailHelper.cs index 6872f9d..a8cd960 100644 --- a/SCP/Common/MailHelper.cs +++ b/SCP/Common/MailHelper.cs @@ -9,6 +9,7 @@ using CK.SCP.Models.AppBoxEntity; using System.Text; using CK.SCP.Utils; using System.Configuration; +using static CK.SCP.UniApi.Controller.MailController; namespace SCP.Common { @@ -20,8 +21,7 @@ namespace SCP.Common { using (AppBoxContext db = EntitiesFactory.CreateAppBoxInstance()) { - //if (_count > 0) - //{ + StringBuilder _buffer = new StringBuilder(); _buffer.Append("SELECT b.Email "); _buffer.Append(" FROM VenderUsers AS a INNER JOIN "); @@ -33,10 +33,26 @@ namespace SCP.Common _buffer.Append(" Roles AS h ON g.RoleID = h.ID "); _buffer.AppendFormat(" WHERE(h.Name = '供应商' and a.VenderId='{0}' and d.FactoryId='{1}' ) ", p_VendId, p_site); var _userList = db.Database.SqlQuery(_buffer.ToString()).ToList(); + if (_userList != null && _userList.Count > 0) { foreach (var itm in _userList) { + + if (itm.Contains('@')) + { + using (ScpEntities dbb = EntitiesFactory.CreateScpInstance()) + { + string[] arr = itm.Split('@'); + string vendid = arr[0]; + var vend = dbb.TA_VENDER.FirstOrDefault(p => p.VendId == vendid); + if (vend != null) + { + break; + } + } + } + string mails = ""; mails += itm + ","; if (mails != "") @@ -46,7 +62,7 @@ namespace SCP.Common string mailbody = ""; mailbody += "尊敬的供应商
"; mailbody += "你好!

"; - mailbody += "" + p_Content + " ,请到供应商协同网站" + ConfigurationManager.AppSettings["ResetPassWord"] + "打开查看!
"; + mailbody += "" + p_Content + " ," + ConfigurationManager.AppSettings["ResetPassWord"] + "
"; mailbody += "



日期:" + DateTime.Now; MyWebSmtpMail webmail = new MyWebSmtpMail(); webmail.Send(mails, mailbody, p_title); @@ -54,7 +70,7 @@ namespace SCP.Common } } } - //} + catch(Exception e) { LogHelper.Writlog(LogHelper.LogType.Error, typeof(MailManager), "MailManager", e.Message); @@ -135,6 +151,71 @@ namespace SCP.Common } } } + } + + //富维发邮件 + public static void GetPoMailList() + { + using (AppBoxContext idb = EntitiesFactory.CreateAppBoxInstance()) + { + using (ScpEntities db = EntitiesFactory.CreateScpInstance()) + { + + //var _list = new List(); + + var _list = db.Database.SqlQuery("Select top(5) * from TB_SUPPLIER_MAIL WHERE STATE=0 order by id asc"); + foreach (var l in _list) + { + + StringBuilder _buffer = new StringBuilder(); + _buffer.Append("SELECT b.Email ,a.VenderId as VendId "); + _buffer.Append(" FROM VenderUsers AS a INNER JOIN "); + _buffer.Append(" Users AS b ON a.UserId = b.ID INNER JOIN "); + _buffer.Append(" FactoryUsers AS c ON a.UserId = c.UserID INNER JOIN "); + _buffer.Append(" TA_FACTORY AS d ON c.FACTORY_ID = d.ID INNER JOIN "); + _buffer.Append(" Users AS f ON c.UserID = f.ID INNER JOIN "); + _buffer.Append("RoleUsers AS g ON a.UserId = g.UserID INNER JOIN "); + _buffer.Append("Roles AS h ON g.RoleID = h.ID "); + _buffer.AppendFormat(" WHERE (h.Name = '供应商' and b.Enabled=1) and a.VenderId ='{0}'", l.SupplicerCode); + var _userList = idb.Database.SqlQuery(_buffer.ToString()).ToList(); + var grouplist = _userList.GroupBy(r => r.VendId); + if (_userList != null && _userList.Count > 0) + { + foreach (var itm in grouplist) + { + var maillist = itm.Select(r => r.Email); + string mails = ""; + foreach (var mail in maillist) + { + mails += mail + ","; + } + if (mails != "") + { + mails = mails.Substring(0, mails.Length - 1); + } + + MyWebSmtpMail webmail = new MyWebSmtpMail(); + webmail.Send(mails, l.MailBody, "采购订单提醒"); + Console.WriteLine($"发送邮件:供应商编码为{ l.SupplicerCode}"); + } + } + + } + var _ids = _list.Select(p => p.Id); + var _entities = db.TB_SUPPLIER_MAIL.Where(p => _ids.Contains(p.Id)).ToList(); + foreach (var itm in _entities) + { + itm.State = 1; + } + EntitiesFactory.SaveDb(idb); + EntitiesFactory.SaveDb(db); + + } + } + + + + } /// /// 发邮件给采购 diff --git a/SCP/Common/ReportHelper.cs b/SCP/Common/ReportHelper.cs index d1d75fb..fd39a6c 100644 --- a/SCP/Common/ReportHelper.cs +++ b/SCP/Common/ReportHelper.cs @@ -67,7 +67,7 @@ namespace SCP.Common ds = GET_ASN_PALLET(p_request); break; case (int)PrintType.PALLET: - ds = GET_TB_PALLETS(p_request); + ds = GET_TB_PALLETS_BTL(p_request); break; case (int)PrintType.SmallBARCODE: ds = GET_TS_BAR_Small(p_request); @@ -92,11 +92,12 @@ namespace SCP.Common } private static DataSet GET_ASN(HttpRequest p_request) { - DataSet ds = new DataSet(); + DataSet ds = new DataSet(); if (!string.IsNullOrEmpty(p_request["AsnBillNum"])) { var AskBillNum = p_request["AsnBillNum"].ToString(); - ds=SCP_ASN_CONTROLLER.ASN_REPORT(AskBillNum); + var CurrentUserPhone = p_request["CurrentUserPhone"].ToString(); + ds =SCP_ASN_CONTROLLER.ASN_REPORT(AskBillNum, CurrentUserPhone); } return ds; } @@ -127,6 +128,46 @@ namespace SCP.Common } return ds; } + /// + /// 本特勒获取托盘 + /// + /// + /// + private static DataSet GET_TB_PALLETS_BTL(HttpRequest p_request) + { + DataSet ds = new DataSet(); + TB_PALLETS_BTL _pallet = new TB_PALLETS_BTL(); + if (!string.IsNullOrEmpty(p_request["AsnBillNum"])) + { + _pallet.AsnBillNum = p_request["AsnBillNum"].ToString(); + } + if (!string.IsNullOrEmpty(p_request["UID"])) + { + var _ls = p_request["UID"].ToString().Split('_').ToList(); + _pallet.UIDList = new List(); + _ls.ForEach(p => + { + if (!string.IsNullOrEmpty(p)) + { + _pallet.UIDList.Add(long.Parse(p)); + } + }); + } + if (!string.IsNullOrEmpty(_pallet.AsnBillNum)||_pallet.UIDList.Count()>0) + { + _pallet.IsDeleted = false; + SCP_PALLET_CONTROLLER.Get_TB_PALLETS_BTL_List(_pallet, (ret) => + { + if (ret.State == ReturnStatus.Succeed) + { + var _ls = ret.Result.DistinctBy(t => t.PalletNum); + var dt = ConvertHelper.ToDataTable(_ls.ToList()); + ds.Tables.Add(dt); + } + }); + } + return ds; + } private static DataSet GET_TS_BAR(HttpRequest p_request) { DataSet ds = new DataSet(); @@ -135,6 +176,10 @@ namespace SCP.Common { _bar.BillNum = p_request["AsnBillNum"].ToString(); } + if (!string.IsNullOrEmpty(p_request["FHLX"])) + { + _bar.Extend16 = p_request["FHLX"].ToString(); + } if (!string.IsNullOrEmpty(p_request["Barcode"])) { var _ls = p_request["Barcode"].ToString().Split('_').ToList(); diff --git a/SCP/Default_FW.aspx b/SCP/Default_FW.aspx index 1d5e7fa..1bdc4c4 100644 --- a/SCP/Default_FW.aspx +++ b/SCP/Default_FW.aspx @@ -15,19 +15,13 @@ body { margin-bottom: 0px; background-repeat: repeat-x; } -td{ - font-size:12px; - line-height:20px; -} + .login{ } -.login tr td{ - font-size:12px; - line-height:20px; -} + --> @@ -40,8 +34,8 @@ td{ - -
+ +
@@ -53,12 +47,12 @@ td{ - +