From 111fae25722710296a2ed9dce65dced57bb79419 Mon Sep 17 00:00:00 2001 From: username@email.com <yzy2002yzy@163.com> Date: 星期二, 25 三月 2025 08:43:25 +0800 Subject: [PATCH] 20250324 修改供应商名字不能重复 外协供应商对应 完成 --- CY_ECommercePlatform/CY.WebForm/Pages/procurement/SuppliersEdit.aspx.cs | 149 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 148 insertions(+), 1 deletions(-) diff --git a/CY_ECommercePlatform/CY.WebForm/Pages/procurement/SuppliersEdit.aspx.cs b/CY_ECommercePlatform/CY.WebForm/Pages/procurement/SuppliersEdit.aspx.cs index fbe26e9..00f3b7f 100644 --- a/CY_ECommercePlatform/CY.WebForm/Pages/procurement/SuppliersEdit.aspx.cs +++ b/CY_ECommercePlatform/CY.WebForm/Pages/procurement/SuppliersEdit.aspx.cs @@ -23,6 +23,7 @@ OA_SuppliersBLL _OA_SuppliersBLL = null; OA_BrandBLL _OA_BrandBLL = null; OA_SuppliersOtherQualificationBLL _OA_SuppliersOtherQualificationBLL = null; + OA_CorporateClientsBLL bll_OA_CorporateClientsBLL = null; public string[] Fileds; public SuppliersEdit() @@ -32,6 +33,7 @@ _Sys_DictionaryBLL = new Sys_DictionaryBLL(); supplier = new OA_Suppliers(); _OA_SuppliersBLL = new OA_SuppliersBLL(); + bll_OA_CorporateClientsBLL = new OA_CorporateClientsBLL(); } @@ -128,6 +130,151 @@ if (Request["Keyid"].ToInt32() > 0) { supplier = _OA_SuppliersBLL.getSingleSupplier(Request["Keyid"].ToString2()); + + var sss = _OA_SuppliersBLL.getSupplierByFirmId(CurrentUser.MemberId, this.txtName.Value.Trim()).ToList(); + if (sss.Count > 0) + { + if(sss.Count(x => x.Keyid != supplier.Keyid) > 0) + { + JavaScript.MessageBox("宸叉湁鍚屽悕渚涘簲鍟嗭紒", this); + return; + } + } + } + else + { + var sss = _OA_SuppliersBLL.getSupplierByFirmId(CurrentUser.MemberId, this.txtName.Value.Trim()).ToList(); + if (sss.Count > 0) + { + JavaScript.MessageBox("宸叉湁鍚屽悕渚涘簲鍟嗭紒", this); + return; + } + var suptypeid = this.selSuppliersTypeId.Value.ToInt32(); + var sys_Dictionary = _Sys_DictionaryBLL.GetDataByType("渚涘簲鍟嗙被鍒� ").Where(x=>x.Keyid == suptypeid).FirstOrDefault(); + if (sys_Dictionary!=null && sys_Dictionary.Name == "澶栧崗鍔犲伐") + { + Pagination pa = new Pagination(); + pa.PageSize = 500; + pa.PageIndex = 1; + //鏌ヨ鏄惁鏈夊悓鍚嶇殑澶栧崗 + var ss = bll_OA_CorporateClientsBLL.SelectModelPage(pa, CurrentUser.MemberId, "").Where(x=>x.OutVendorName == this.txtName.Value.Trim()).ToList(); + if (ss.Count == 0) + { + //鏂板澶栧崗鍘傚晢 + OA_CorporateClients m_OA_CorporateClients = new OA_CorporateClients(); + OA_CustomerCommunications m_OA_CustomerCommunications = new OA_CustomerCommunications(); + EC_AcceptWayByCustomers m_EC_AcceptWayByCustomers = new EC_AcceptWayByCustomers(); + EC_MemberBasic m_EC_MemberBasic = new EC_MemberBasic(); + Guid NewGuid = Guid.NewGuid(); + #region 鍒濆鍚堜綔瀹㈡埛鍩虹淇℃伅 + m_OA_CorporateClients.CompanyName = CurrentUser.Name; + m_OA_CorporateClients.CustomerIndustriesId = 0; + m_OA_CorporateClients.CustomerTypeId = 0; + m_OA_CorporateClients.SourcesInfoId = 0; + m_OA_CorporateClients.DegreeImportanId = 0; + m_OA_CorporateClients.AccountManagerId = 0; + m_OA_CorporateClients.BusinessManagerId = 0; + + m_OA_CorporateClients.CreditId = 0; + m_OA_CorporateClients.LoginPhone = ""; + m_OA_CorporateClients.CorporateWebsite = ""; + m_OA_CorporateClients.BusinessAnalysisId = 0; + m_OA_CorporateClients.IsLoginCorporateWeb = false; + m_OA_CorporateClients.Credit = 0; + m_OA_CorporateClients.Bank = ""; + m_OA_CorporateClients.TaxID = ""; + m_OA_CorporateClients.AccountID = ""; + m_OA_CorporateClients.OrderCount = 0; + m_OA_CorporateClients.OrderMoney = 0; + + m_OA_CorporateClients.Prepayments = 0; + m_OA_CorporateClients.IsOutsourcing = true; + m_OA_CorporateClients.OutVendorName = this.txtName.Value.Trim(); + m_OA_CorporateClients.IsPriority = false; + m_OA_CorporateClients.CumulativePrepayments = 0; + m_OA_CorporateClients.LastUpdateTime = DateTime.Now; + m_OA_CorporateClients.Operator = CurrentUser.ShortName; + m_OA_CorporateClients.Remark = ""; + m_OA_CorporateClients.OutRate = 1; + m_OA_CorporateClients.LoginPwd = ""; + + #endregion + + #region 鍒濆鍚堜綔瀹㈡埛閫氳淇℃伅 + m_OA_CustomerCommunications.Province = CurrentUser.Province; + m_OA_CustomerCommunications.City = CurrentUser.City; + m_OA_CustomerCommunications.County = CurrentUser.County; + m_OA_CustomerCommunications.DetailedAddress = CurrentMemberExtend.DetailedAddress; + m_OA_CustomerCommunications.CompanyPhone = CurrentMemberExtend.PhoneNum; + m_OA_CustomerCommunications.Postcode = CurrentMemberExtend.Postcode; + m_OA_CustomerCommunications.Mobile = CurrentMemberExtend.MobileNum; + m_OA_CustomerCommunications.Fax = CurrentMemberExtend.Fax; + m_OA_CustomerCommunications.Email = CurrentMemberExtend.Email; + m_OA_CustomerCommunications.QQ = CurrentMemberExtend.QQ; + m_OA_CustomerCommunications.LegalRepresentative = ""; + m_OA_CustomerCommunications.LegalMobile = ""; + m_OA_CustomerCommunications.LegalQQ = ""; + m_OA_CustomerCommunications.BusinessManagers = ""; + m_OA_CustomerCommunications.ManagersMobile = ""; + m_OA_CustomerCommunications.ManagersQQ = ""; + m_OA_CustomerCommunications.FinancialOfficers = ""; + m_OA_CustomerCommunications.OfficersMobile = ""; + m_OA_CustomerCommunications.OfficersQQ = ""; + m_OA_CustomerCommunications.Remark = ""; + m_OA_CustomerCommunications.LastUpdateTime = DateTime.Now; + m_OA_CustomerCommunications.Operator = CurrentUser.ShortName; + #endregion + + #region 鍒濆鍚堜綔瀹㈡埛鏀惰揣鍦板潃 + m_EC_AcceptWayByCustomers.AcceptTypeId = 0; + m_EC_AcceptWayByCustomers.InvoiceDemand = ""; + m_EC_AcceptWayByCustomers.Remark = ""; + m_EC_AcceptWayByCustomers.LastUpdateTime = DateTime.Now; + m_EC_AcceptWayByCustomers.Operator = CurrentUser.ShortName; + + m_EC_AcceptWayByCustomers.City = ""; + m_EC_AcceptWayByCustomers.Accepter = ""; + m_EC_AcceptWayByCustomers.AccepterPhone = ""; + m_EC_AcceptWayByCustomers.AppointCourierCompany = ""; + m_EC_AcceptWayByCustomers.AccepterAddress = ""; + m_EC_AcceptWayByCustomers.AccepterPhoneNum = ""; + m_EC_AcceptWayByCustomers.AcceptContacts = ""; + m_EC_AcceptWayByCustomers.FetchAddress = ""; + m_EC_AcceptWayByCustomers.FetchPhoneNum = ""; + m_EC_AcceptWayByCustomers.FetchContacts = ""; + + #endregion + + m_OA_CorporateClients.Keyid = NewGuid; + m_OA_CorporateClients.CreateTime = DateTime.Now; + m_OA_CorporateClients.MemberId = CurrentUser.MemberId; + m_OA_CorporateClients.FirmId = NewGuid; + m_OA_CorporateClients.InquiryId = AdminAccount.MemberId; + m_OA_CorporateClients.CustomerId = bll_OA_CorporateClientsBLL.GetLastIdByFirmId(m_OA_CorporateClients.FirmId) + 1; + + m_OA_CustomerCommunications.Keyid = NewGuid; + m_EC_AcceptWayByCustomers.TargetId = NewGuid; + m_OA_CorporateClients.Paytime = 0; + m_OA_CorporateClients.Paydays = 0; + m_OA_CorporateClients.Biddingcompany = 0; + m_OA_CorporateClients.Contracttype = 0; + m_OA_CorporateClients.Contractmoney = 0; + m_OA_CorporateClients.Jigoudaima = ""; + m_OA_CorporateClients.Piaoju = 0; + m_OA_CorporateClients.Kaipiaoziliao = ""; + m_OA_CorporateClients.Expiretype = 0; + m_OA_CorporateClients.Shifouwanjie = 2; + m_OA_CorporateClients.Note = ""; + bool result = bll_OA_CorporateClientsBLL.InsertModel(m_OA_CorporateClients, m_OA_CustomerCommunications, m_EC_AcceptWayByCustomers);//娣诲姞淇℃伅 + if (!result) + { + JavaScript.MessageBox("娣诲姞澶辫触", this); + return; + } + + + } + } } @@ -221,7 +368,7 @@ supplier.LegalRepresentative = this.txtLegalRepresentative.Value; supplier.ManagersMobile = this.txtManagersMobile.Value; supplier.ManagersQQ = this.txtManagersQQ.Value; - supplier.Name = this.txtName.Value; + supplier.Name = this.txtName.Value.Trim(); supplier.OfficersMobile = this.txtOfficersMobile.Value; supplier.OfficersQQ = this.txtOfficersQQ.Value; if (!string.IsNullOrEmpty(this.txtHuming.Value)) -- Gitblit v1.9.1