From 4d584101e46ff34b2694e88af706b9b2e92364bc Mon Sep 17 00:00:00 2001 From: CB2-20200827ONU\Administrator <liaoxujun@qq.com> Date: 星期三, 22 九月 2021 08:55:31 +0800 Subject: [PATCH] no message --- CY_ECommercePlatform/CY.WebForm/Pages/business/CorporateClientsVisit.aspx.cs | 290 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 289 insertions(+), 1 deletions(-) diff --git a/CY_ECommercePlatform/CY.WebForm/Pages/business/CorporateClientsVisit.aspx.cs b/CY_ECommercePlatform/CY.WebForm/Pages/business/CorporateClientsVisit.aspx.cs index 3018f45..152ed11 100644 --- a/CY_ECommercePlatform/CY.WebForm/Pages/business/CorporateClientsVisit.aspx.cs +++ b/CY_ECommercePlatform/CY.WebForm/Pages/business/CorporateClientsVisit.aspx.cs @@ -10,6 +10,9 @@ using CY.Infrastructure.Common; using CY.BLL.Sys; using CY.Model.Inquiry; +using CY.SQLDAL; +using System.Data.SqlClient; +using CY.Infrastructure.Logging; namespace CY.WebForm.Pages.business { @@ -18,7 +21,19 @@ OA_CorporateClientsBLL bll_OA_CorporateClientsBLL = null; Sys_DictionaryBLL bll_Sys_DictionaryBLL = null;//瀛楀吀涓氬姟閫昏緫鎿嶄綔绫诲璞� SysInquiry_PrintingTypeBLL bll_SysInquiry_PrintingTypeBLL = null;//鍗板埛涓氬姟绫诲瀷涓氬姟閫昏緫鎿嶄綔绫诲璞� + /// <summary> + /// 鏄惁闇�瑕佽妭鍋囨棩缁存姢 + /// </summary> + public bool IsNeedJiejiaRi { get; set; } + /// <summary> + /// 鏄惁闇�瑕佺淮鎶� + /// </summary> + public bool NeedWeihu { get; set; } + /// <summary> + /// 鍚堜綔瀹㈡埛渚嬪瓙 + /// </summary> + public OA_CorporateClients client { get; set; } //鍒濆鍖� public CorporateClientsVisit() { @@ -26,7 +41,10 @@ bll_Sys_DictionaryBLL = new Sys_DictionaryBLL(); bll_SysInquiry_PrintingTypeBLL = new SysInquiry_PrintingTypeBLL(); } - + /// <summary> + /// 鏄惁鏃剁淮鎶ゆ彁閱掍紶杩囨潵鐨� + /// </summary> + public bool IsWeihuTixingUrl { get; set; } = false; //椤甸潰鍔犺浇 protected void Page_Load(object sender, EventArgs e) { @@ -37,10 +55,280 @@ this.spanCompanyName.InnerText = m_OA_CorporateClients.CompanyName; this.spanBusinessManagerId.InnerText = m_OA_CorporateClients.BusinessmanagerName; this.spanprintdate.InnerText = DateTime.Now.ToString("yyyy-MM-dd"); + client = bll_OA_CorporateClientsBLL.GetModel(Request["Keyid"].ToGuid2()); + IsNeedJiejiaRi = client.JieJiaRiWiHu==true; + NeedWeihu = client.NeedWiHu == true; + this.RepClientList.DataSource = bll_OA_CorporateClientsBLL.SelectVisitListByCorId(Request["Keyid"].ToGuid2()); + this.RepClientList.DataBind(); + if (IsNeedJiejiaRi) + this.btn_Submit.Enabled = true; + else + this.btn_Submit.Enabled = false; + + + //鍒ゅ喅鏄惁鏄妭鍋囨棩缁存姢寮圭獥 杩欎釜寮圭獥娣诲姞缁存姢璁板綍鍚庝細鍏抽棴绐楀彛 + var x = Request["JIeriCount"]; + if (x != "undefined"&&x!=null) + { + this.Button1.Enabled = false; + this.txtvisitRemark.Value = x; + } + + this.txtVisitTime.Value = DateTime.Now.ToString("yyyy-MM-dd"); + //鍒ゅ喅鏄惁鏄彁閱掑脊绐� 杩欎釜寮圭獥娣诲姞缁存姢璁板綍鍚庝細鍏抽棴绐楀彛 + var y = Request["tixingweihu"]; + if ( y != null&& y=="1") + { + IsWeihuTixingUrl = true; + } + + + } + + + } + //瀹岀粨浜嬩欢 + 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); + if (NeedWeihu) + { + + Database DC = new Database(); + string sqlStr = string.Format("USE [ECTEST] UPDATE[dbo].[OA_CorporateClients] SET [NeedWiHu] = 'false' where Keyid='{0}'", Request["Keyid"]); + + try + { + SqlCommand myCmd = new SqlCommand(sqlStr, DC.Connection); + //SqlDataAdapter myDa = new SqlDataAdapter(myCmd); + int a = myCmd.ExecuteNonQuery(); + //myDa.Dispose(); + + + } + catch (Exception ee) + { + new Log4NetAdapter().Log("涓鑺傛彁閱掗敊璇� 閿欒锛�" + ee.Message); + this.txtVisitTime.Value = ""; + this.txtvisitRemark.Value = ""; + JavaScript.MessageBox("娓呴櫎缁存姢鏍囧織澶辫触", this, false, false); + + } + finally + { + if (DC.Connection.State != System.Data.ConnectionState.Closed) + DC.Connection.Close(); + } + + + + } + + + + } + + else + JavaScript.MessageBox("缁存姢淇濆瓨澶辫触", this); this.RepClientList.DataSource = bll_OA_CorporateClientsBLL.SelectVisitListByCorId(Request["Keyid"].ToGuid2()); this.RepClientList.DataBind(); + //Province = CurrentUser.Province; + //City = CurrentUser.City; + //County = CurrentUser.County; + //BindData(); + if (IsWeihuTixingUrl) + JavaScript.RefreshDIVOpener(this); + #endregion + + + } + catch (Exception ex) + { + PAGEHandleException(ex); + JavaScript.MessageBox("鎿嶄綔澶辫触", this); + if (IsWeihuTixingUrl) + JavaScript.RefreshDIVOpener(this); + } + } + + protected void btn_Submit_Visit_jiari(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); + if (IsNeedJiejiaRi) + { + + Database DC = new Database(); + + string sqlStr = string.Format("USE [ECTEST] UPDATE[dbo].[OA_CorporateClients] SET [JieJiaRiWiHu] = 'false' where Keyid='{0}'", Request["Keyid"]); + + try + { + SqlCommand myCmd = new SqlCommand(sqlStr, DC.Connection); + //SqlDataAdapter myDa = new SqlDataAdapter(myCmd); + int a = myCmd.ExecuteNonQuery(); + //myDa.Dispose(); + + + } + catch (Exception ee) + { + new Log4NetAdapter().Log("鑺傚亣鏃ユ竻闄ゆ爣蹇� 閿欒锛�" + ee.Message); + this.txtVisitTime.Value = ""; + this.txtvisitRemark.Value = ""; + JavaScript.MessageBox("娓呴櫎缁存姢鏍囧織澶辫触", this, false, false); + + } + finally + { + if (DC.Connection.State != System.Data.ConnectionState.Closed) + DC.Connection.Close(); + } + + + + } + + + + } + + else + JavaScript.MessageBox("缁存姢淇濆瓨澶辫触", this); + this.RepClientList.DataSource = bll_OA_CorporateClientsBLL.SelectVisitListByCorId(Request["Keyid"].ToGuid2()); + this.RepClientList.DataBind(); + JavaScript.MessageBox("缁存姢瀹屾垚", this); + //Province = CurrentUser.Province; + //City = CurrentUser.City; + //County = CurrentUser.County; + //BindData(); + if(IsWeihuTixingUrl) + JavaScript.RefreshDIVOpener(this); + #endregion + + + } + catch (Exception ex) + { + PAGEHandleException(ex); + JavaScript.MessageBox("鎿嶄綔澶辫触", this); + if (IsWeihuTixingUrl) + JavaScript.RefreshDIVOpener(this); } } } -- Gitblit v1.9.1