username@email.com
2025-03-25 111fae25722710296a2ed9dce65dced57bb79419
20250324 修改供应商名字不能重复 外协供应商对应 完成
5个文件已修改
207 ■■■■■ 已修改文件
CY_ECommercePlatform/CY.BLL/OA/OA_SuppliersBLL.cs 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CY_ECommercePlatform/CY.IDAL/OA/IOA_SuppliersDAL.cs 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CY_ECommercePlatform/CY.SQLDAL/OA/OA_SuppliersDAL.cs 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CY_ECommercePlatform/CY.WebForm/Pages/business/Waixiefukuanshenqing.aspx.cs 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CY_ECommercePlatform/CY.WebForm/Pages/procurement/SuppliersEdit.aspx.cs 149 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CY_ECommercePlatform/CY.BLL/OA/OA_SuppliersBLL.cs
@@ -83,5 +83,16 @@
      {
          return suppliersDAL.getSupplierTable(FirmId);
      }
        /// <summary>
        /// 获取table类型的所有供应商
        /// </summary>
        /// <param name="FirmId"></param>
        /// <returns></returns>
        public IEnumerable<Model.OA_Suppliers> getSupplierByFirmId(Guid FirmId,string Name)
        {
            return suppliersDAL.getSupplierByFirmId(FirmId, Name);
        }
    }
}
CY_ECommercePlatform/CY.IDAL/OA/IOA_SuppliersDAL.cs
@@ -17,5 +17,7 @@
        IEnumerable<Model.OA_Suppliers> getAllSuppliers(Pagination pa, Guid FirsmId, string CooperativeStateId, string SuppliersLevelId, string SuppliersTypeId, string SuppliersName, string BusinessScope);
        OA_Suppliers getSingleSupplier(string Keyid);
        DataTable getSupplierTable(Guid FirmId);
        IEnumerable<Model.OA_Suppliers> getSupplierByFirmId(Guid FirmId, string Name);
    }
}
CY_ECommercePlatform/CY.SQLDAL/OA/OA_SuppliersDAL.cs
@@ -252,6 +252,41 @@
        /// <summary>
        /// 返回table类型的所有列表
        /// </summary>
        /// <param name="FirmId"></param>
        /// <returns></returns>
        public IEnumerable<Model.OA_Suppliers> getSupplierByFirmId(Guid FirmId, string Name)
        {
            try
            {
                if (FirmId == null || FirmId == Guid.Empty)
                    return null;//错误数据返会空
                string condition = " FirmId='" + FirmId + "' ";
                if (!string.IsNullOrEmpty(Name))
                {
                    condition += " and [Name]='" + Name + "' ";
                }
                IList<Model.OA_Suppliers> result = _dataBase.SelectModel<Model.OA_Suppliers>("*", "OA_Suppliers", condition) as IList<Model.OA_Suppliers>;//执行查询
                return result;//返回结果
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        /// <summary>
        /// 获取单个供应商
        /// </summary>
        /// <param name="Keyid"></param>
CY_ECommercePlatform/CY.WebForm/Pages/business/Waixiefukuanshenqing.aspx.cs
@@ -98,12 +98,12 @@
                        this.txtSupplierName.Value = corporateClients.OutVendorName;
                        this.selSuppliersss.Value = corporateClients.Keyid.ToString(); 
                     var sss =   _OA_SuppliersBLL.getSupplierTable(CurrentUser.MemberId).Select("Name = '"+ corporateClients.OutVendorName + "'");
                        if (sss.Length > 0)
                     var sss =   _OA_SuppliersBLL.getSupplierByFirmId(CurrentUser.MemberId, corporateClients.OutVendorName.Trim()).ToList();
                        if (sss.Count > 0)
                        {
                            this.txtHuming.Value = sss[0]["Huming"].ToString();
                            this.txtBank.Value = sss[0]["Bank"].ToString();
                            this.txtAccountID.Value = sss[0]["AccountID"].ToString();
                            this.txtHuming.Value = sss[0].Huming;//  ["Huming"].ToString();
                            this.txtBank.Value = sss[0].Bank; //["Bank"].ToString();
                            this.txtAccountID.Value = sss[0].AccountID;//["AccountID"].ToString();
                        }
                    }
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))