username@email.com
2025-03-25 111fae25722710296a2ed9dce65dced57bb79419
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))