From a980cd04341d71216e0f59bd4b7327fe9fc50032 Mon Sep 17 00:00:00 2001 From: username@email.com <yzy2002yzy@163.com> Date: 星期三, 21 五月 2025 11:41:46 +0800 Subject: [PATCH] 提交 --- CY_ECommercePlatform/CY.WebForm/Pages/business/CorporateClientsEdit.aspx.cs | 219 +++++++++++++++++++++++++++++++++++++++++++----------- 1 files changed, 175 insertions(+), 44 deletions(-) diff --git a/CY_ECommercePlatform/CY.WebForm/Pages/business/CorporateClientsEdit.aspx.cs b/CY_ECommercePlatform/CY.WebForm/Pages/business/CorporateClientsEdit.aspx.cs index 36421d1..b9d27d6 100644 --- a/CY_ECommercePlatform/CY.WebForm/Pages/business/CorporateClientsEdit.aspx.cs +++ b/CY_ECommercePlatform/CY.WebForm/Pages/business/CorporateClientsEdit.aspx.cs @@ -29,6 +29,12 @@ public string Targetid = ""; //鏀惰揣鏂瑰紡鐩爣鍊� public string Shifouwanjie = ""; //瀹岀粨鐘舵�� public string CorporateClientsid = ""; + public string strNewKeyid = ""; + /// <summary> + /// 鍦ㄦ柊寤烘椂锛屼繚瀛樻垨鑰呮槸澶勭悊闄勪欢鏃跺厛瑕佺敓鎴愯繖涓狦uid + /// </summary> + public Guid NewKeyid{ get; set; } + //鍒濆鍖� public AddCorporateClients() { @@ -45,6 +51,9 @@ try { + GetKeyID(); + this.saveKey.Value = NewKeyid.ToString(); + Targetid = Request["Keyid"].ToString2(); CorporateClientsid = Targetid; switch (Request["datatype"].ToString2()) @@ -71,6 +80,7 @@ Response.Write("-1"); } Response.End(); + } //鎻愪氦浜嬩欢 @@ -79,10 +89,39 @@ OA_CorporateClients m_OA_CorporateClients = new OA_CorporateClients(); OA_CustomerCommunications m_OA_CustomerCommunications = new OA_CustomerCommunications(); EC_AcceptWayByCustomers m_EC_AcceptWayByCustomers = new EC_AcceptWayByCustomers(); + if ( this.selSourcesInfoId.Value.ToString() == "452" && string.IsNullOrWhiteSpace(this.txtJigoudaima.Value.ToString())) + { + JavaScript.MessageBox("瀹㈡埛鏉ユ簮涓烘斂搴滈噰璐紝璇峰~鍐欐満鏋勪唬鐮�", this); + return; + } + if (string.IsNullOrEmpty(Request["selectProvince"].ToString2()) || string.IsNullOrEmpty(Request["selectCity"].ToString2()) || string.IsNullOrEmpty(Request["selectCounty"].ToString2())) + { + JavaScript.MessageBox("璇烽�夋嫨鎵�鍦ㄥ尯鍩�", this); + return; + } try { - Guid Keyid = Request["Keyid"].ToGuid2(); + //var files = Request.Files; + //for (int iFile = 0; iFile < files.Count; iFile++) + //{ + // ///'妫�鏌ユ枃浠舵墿灞曞悕瀛� + // HttpPostedFile postedFile = files[iFile]; + // string fileName, fileExtension; + // fileName = System.IO.Path.GetFileName(postedFile.FileName); + // if (fileName != "") + // { + // fileExtension = System.IO.Path.GetExtension(fileName); + // //strMsg.Append("涓婁紶鐨勬枃浠剁被鍨嬶細" + postedFile.ContentType.ToString() + "<br>"); + // //strMsg.Append("瀹㈡埛绔枃浠跺湴鍧�锛�" + postedFile.FileName + "<br>"); + // //strMsg.Append("涓婁紶鏂囦欢鐨勬枃浠跺悕锛�" + fileName + "<br>"); + // //strMsg.Append("涓婁紶鏂囦欢鐨勬墿灞曞悕锛�" + fileExtension + "<br><hr>"); + // ///'鍙牴鎹墿灞曞悕瀛楃殑涓嶅悓淇濆瓨鍒颁笉鍚岀殑鏂囦欢澶� + // ///娉ㄦ剰锛氬彲鑳借淇敼浣犵殑鏂囦欢澶圭殑鍖垮悕鍐欏叆鏉冮檺銆� + // postedFile.SaveAs(System.Web.HttpContext.Current.Request.MapPath("images/") + fileName); + // } + //} + Guid Keyid = Request["Keyid"].ToGuid2(); bool isExit = bll_OA_CorporateClientsBLL.isExistCompanyName(this.txtCompanyName.Value.ToString2(), CurrentUser.MemberId, Keyid); if (!isExit) { @@ -106,13 +145,14 @@ } #region 鍒濆鍚堜綔瀹㈡埛鍩虹淇℃伅 - m_OA_CorporateClients.CompanyName = this.txtCompanyName.Value.ToString2(); + m_OA_CorporateClients.CompanyName = this.txtCompanyName.Value.ToString2(); m_OA_CorporateClients.CustomerIndustriesId = this.selCustomerIndustriesId.Value.ToInt32() ?? 0; m_OA_CorporateClients.CustomerTypeId = this.selCustomerTypeId.Value.ToInt32() ?? 0; m_OA_CorporateClients.SourcesInfoId = this.selSourcesInfoId.Value.ToInt32() ?? 0; m_OA_CorporateClients.DegreeImportanId = this.selDegreeImportanId.Value.ToInt32() ?? 0; m_OA_CorporateClients.AccountManagerId = this.selAccountManagerId.Value.ToInt32() ?? 0; m_OA_CorporateClients.BusinessManagerId = this.selBusinessManagerId.Value.ToInt32() ?? 0; + m_OA_CorporateClients.Shifouwanjie = 2; //add by zyyao m_OA_CorporateClients.Paytime = this.selPaytime.Value.ToInt32() ?? 0; @@ -232,6 +272,7 @@ JavaScript.MessageBox("鏇存柊鎴愬姛", this, true, true); else JavaScript.MessageBox("鏇存柊澶辫触", this); + } else { @@ -242,7 +283,7 @@ m_OA_CorporateClients.IsPriority = false; m_OA_CorporateClients.CumulativePrepayments = 0; - m_OA_CorporateClients.Keyid = Guid.NewGuid(); + m_OA_CorporateClients.Keyid = new Guid( this.saveKey.Value);// Guid.NewGuid();//GetKeyID(); m_OA_CorporateClients.CreateTime = DateTime.Now; m_OA_CorporateClients.CustomerId = bll_OA_CorporateClientsBLL.GetLastIdByFirmId(CurrentUser.MemberId) + 1; m_OA_CorporateClients.FirmId = CurrentUser.MemberId; @@ -331,7 +372,6 @@ JavaScript.MessageBox("瀹岀粨鎴愬姛", this, true, true); else JavaScript.MessageBox("瀹岀粨澶辫触", this); - #endregion @@ -345,10 +385,11 @@ } + //瀹岀粨浜嬩欢 - protected void btn_Submit_Visit(object sender, EventArgs e) + protected void btn_Submit_chongxinkaitong(object sender, EventArgs e) { - OA_CorporateClientsVisit m_OA_CorporateClientsVisit = new OA_CorporateClientsVisit(); + OA_CorporateClients m_OA_CorporateClients = new OA_CorporateClients(); try @@ -360,7 +401,7 @@ if (Request["Keyid"] != null) { - + m_OA_CorporateClients = bll_OA_CorporateClientsBLL.GetModel(Request["Keyid"].ToGuid2()); } else @@ -368,52 +409,22 @@ JavaScript.MessageBox("璇峰厛淇濆瓨瀹㈡埛", this); } - if (this.txtVisitTime.Value=="") - { - JavaScript.MessageBox("璇烽�夋嫨鏃ユ湡", this); + m_OA_CorporateClients.Shifouwanjie = 2; - } - if (this.txtVisitTime.Value == "") - { - JavaScript.MessageBox("璇峰~鍐欑淮鎶よ褰�", this); - - } - - m_OA_CorporateClientsVisit.Keyid = Guid.NewGuid(); + m_OA_CorporateClients.LastUpdateTime = DateTime.Now; - m_OA_CorporateClientsVisit.CorporateClientsid = Keyid; - - m_OA_CorporateClientsVisit.VisitTime = this.txtVisitTime.Value.ToDateTime2(); - - m_OA_CorporateClientsVisit.Remark = this.txtvisitRemark.Value.ToString2(); - m_OA_CorporateClientsVisit.Creater = CurrentUser.TrueMemberId; - m_OA_CorporateClientsVisit.CreateTime = DateTime.Now; - m_OA_CorporateClientsVisit.Updater = CurrentUser.TrueMemberId; - m_OA_CorporateClientsVisit.LastUpdateTime = DateTime.Now; #region 娣诲姞鎴栫紪杈� - bool result = bll_OA_CorporateClientsBLL.InsertModelVisit(m_OA_CorporateClientsVisit);//鏇存柊淇℃伅 - + bool result = bll_OA_CorporateClientsBLL.UpdateModel(m_OA_CorporateClients);//鏇存柊淇℃伅 if (result) - { - //this.RepClientList.DataSource = bll_OA_CorporateClientsBLL.SelectVisitListByCorId(Keyid); - //this.RepClientList.DataBind(); - this.txtVisitTime.Value = ""; - this.txtvisitRemark.Value = ""; - JavaScript.MessageBox("缁存姢淇濆瓨鎴愬姛", this, false, false); - } - + JavaScript.MessageBox("瀹岀粨鎴愬姛", this, true, true); else - JavaScript.MessageBox("缁存姢淇濆瓨澶辫触", this); + JavaScript.MessageBox("瀹岀粨澶辫触", this); - Province = CurrentUser.Province; - City = CurrentUser.City; - County = CurrentUser.County; - BindData(); #endregion @@ -424,6 +435,85 @@ JavaScript.MessageBox("鎿嶄綔澶辫触", this); } } + ////瀹岀粨浜嬩欢 + //protected void btn_Submit_Visit(object sender, EventArgs e) + //{ + // OA_CorporateClientsVisit m_OA_CorporateClientsVisit = new OA_CorporateClientsVisit(); + + + // try + // { + // Guid Keyid = Request["Keyid"].ToGuid2(); + + + + + // if (Request["Keyid"] != null) + // { + + + // } + // else + // { + // JavaScript.MessageBox("璇峰厛淇濆瓨瀹㈡埛", this); + // } + + // if (this.txtVisitTime.Value == "") + // { + // JavaScript.MessageBox("璇烽�夋嫨鏃ユ湡", this); + + // } + // if (this.txtVisitTime.Value == "") + // { + // JavaScript.MessageBox("璇峰~鍐欑淮鎶よ褰�", this); + + // } + + // m_OA_CorporateClientsVisit.Keyid = Guid.NewGuid(); + + + // m_OA_CorporateClientsVisit.CorporateClientsid = Keyid; + + // m_OA_CorporateClientsVisit.VisitTime = this.txtVisitTime.Value.ToDateTime2(); + + // m_OA_CorporateClientsVisit.Remark = this.txtvisitRemark.Value.ToString2(); + // m_OA_CorporateClientsVisit.Creater = CurrentUser.TrueMemberId; + // m_OA_CorporateClientsVisit.CreateTime = DateTime.Now; + // m_OA_CorporateClientsVisit.Updater = CurrentUser.TrueMemberId; + // m_OA_CorporateClientsVisit.LastUpdateTime = DateTime.Now; + + + // #region 娣诲姞鎴栫紪杈� + + + // bool result = bll_OA_CorporateClientsBLL.InsertModelVisit(m_OA_CorporateClientsVisit);//鏇存柊淇℃伅 + + // if (result) + // { + // //this.RepClientList.DataSource = bll_OA_CorporateClientsBLL.SelectVisitListByCorId(Keyid); + // //this.RepClientList.DataBind(); + // this.txtVisitTime.Value = ""; + // this.txtvisitRemark.Value = ""; + // JavaScript.MessageBox("缁存姢淇濆瓨鎴愬姛", this, false, false); + // } + + // else + // JavaScript.MessageBox("缁存姢淇濆瓨澶辫触", this); + + // Province = CurrentUser.Province; + // City = CurrentUser.City; + // County = CurrentUser.County; + // BindData(); + // #endregion + + + // } + // catch (Exception ex) + // { + // PAGEHandleException(ex); + // JavaScript.MessageBox("鎿嶄綔澶辫触", this); + // } + //} //缁戝畾鏁版嵁 protected void BindData() @@ -434,11 +524,14 @@ this.selSourcesInfoId.DataValueField = "Keyid"; this.selSourcesInfoId.DataTextField = "Name"; this.selSourcesInfoId.DataBind(); + this.selSourcesInfoId.Value = "452"; this.selCustomerIndustriesId.DataSource = bll_Sys_DictionaryBLL.GetDataByType("瀹㈡埛鎵�灞炶涓�"); this.selCustomerIndustriesId.DataValueField = "Keyid"; this.selCustomerIndustriesId.DataTextField = "Name"; this.selCustomerIndustriesId.DataBind(); + + this.selCustomerIndustriesId.Value = "454"; this.selCustomerTypeId.DataSource = bll_Sys_DictionaryBLL.GetDataByType("瀹㈡埛绫诲瀷"); this.selCustomerTypeId.DataValueField = "Keyid"; @@ -451,11 +544,15 @@ this.selBusinessManagerId.DataBind(); this.selBusinessManagerId.Items.Insert(0, new ListItem("璇烽�夋嫨", "")); + this.selBusinessManagerId.Value = CurrentUser.StaffId.Value.ToString(); + this.selAccountManagerId.DataSource = bll_OA_StaffBLL.SelectListByFirmId(CurrentUser.MemberId, false, true); this.selAccountManagerId.DataTextField = "Name"; this.selAccountManagerId.DataValueField = "Keyid"; this.selAccountManagerId.DataBind(); this.selAccountManagerId.Items.Insert(0, new ListItem("璇烽�夋嫨", "")); + + this.selAccountManagerId.Value = CurrentUser.StaffId.Value.ToString(); this.selCreditId.DataSource = bll_Sys_DictionaryBLL.GetDataByType("瀹㈡埛淇¤獕"); this.selCreditId.DataValueField = "Keyid"; @@ -518,8 +615,8 @@ this.selSourcesInfoId.Value = m_OA_CorporateClients.SourcesInfoId.ToString2(); this.selCustomerIndustriesId.Value = m_OA_CorporateClients.CustomerIndustriesId.ToString2(); this.selCustomerTypeId.Value = m_OA_CorporateClients.CustomerTypeId.ToString2(); - this.selBusinessManagerId.Value = m_OA_CorporateClients.BusinessManagerId.ToString2(); - this.selAccountManagerId.Value = m_OA_CorporateClients.AccountManagerId.ToString2(); + this.selBusinessManagerId.Value = m_OA_CorporateClients.BusinessManagerId.ToString2()=="0"?"": m_OA_CorporateClients.BusinessManagerId.ToString2(); + this.selAccountManagerId.Value = m_OA_CorporateClients.AccountManagerId.ToString2() == "0" ? "" : m_OA_CorporateClients.AccountManagerId.ToString2(); this.selDegreeImportanId.Value = m_OA_CorporateClients.DegreeImportanId.ToString2(); this.selBusinessAnalysisId.Value = m_OA_CorporateClients.BusinessAnalysisId.ToString2(); this.selIsLoginCorporateWeb.Value = m_OA_CorporateClients.IsLoginCorporateWeb.ToString2(); @@ -619,6 +716,7 @@ this.txtFinancialOfficers.Value = ""; this.txtOfficersMobile.Value = ""; this.txtOfficersQQ.Value = ""; + Shifouwanjie = "3"; #endregion @@ -676,9 +774,42 @@ return ("[" + string.Join(",", modelArry) + "]"); } } + /// <summary> + /// 鑾峰彇Guid + /// </summary> + /// <returns></returns> + public Guid GetKeyID() + { + if (NewKeyid != null && NewKeyid != new Guid("00000000-0000-0000-0000-000000000000")) + { + strNewKeyid = NewKeyid.ToString(); + return NewKeyid; + } + if (Request["Keyid"] != null) + { + NewKeyid = Request["Keyid"].ToGuid2(); + // this.SaveNewKeyID.Value = NewKeyid.ToString(); + strNewKeyid = NewKeyid.ToString(); + return NewKeyid; + } + + if (this.saveKey.Value == "") + { + NewKeyid = Guid.NewGuid(); + this.saveKey.Value = NewKeyid.ToString(); + return NewKeyid; + } + else + { + NewKeyid = new Guid(this.saveKey.Value); + return NewKeyid; + } + } + + //CY.WebForm.cs.UploadCS.UpFileResult _UpFileResult1 = CY.WebForm.cs.UploadCS.Upload( //鎻愪氦浜嬩欢 protected void btn_SubmitClientsBiddingcompany_Config(object sender, EventArgs e) -- Gitblit v1.9.1