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/CorporateClientsEdit.aspx.cs |  196 ++++++++++++++++++++++++++++++++----------------
 1 files changed, 129 insertions(+), 67 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..e68413e 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();
+          
         }
 
         //鎻愪氦浜嬩欢
@@ -82,7 +92,26 @@
 
             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,7 +135,7 @@
                         }
 
                         #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;
@@ -232,6 +261,7 @@
                                 JavaScript.MessageBox("鏇存柊鎴愬姛", this, true, true);
                             else
                                 JavaScript.MessageBox("鏇存柊澶辫触", this);
+                            
                         }
                         else
                         {
@@ -242,7 +272,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 +361,6 @@
                                 JavaScript.MessageBox("瀹岀粨鎴愬姛", this, true, true);
                             else
                                 JavaScript.MessageBox("瀹岀粨澶辫触", this);
-                      
                     
                         #endregion
                 
@@ -345,85 +374,85 @@
         }
 
 
-        //瀹岀粨浜嬩欢
-        protected void btn_Submit_Visit(object sender, EventArgs e)
-        {
-            OA_CorporateClientsVisit m_OA_CorporateClientsVisit = new OA_CorporateClientsVisit();
+        ////瀹岀粨浜嬩欢
+        //protected void btn_Submit_Visit(object sender, EventArgs e)
+        //{
+        //    OA_CorporateClientsVisit m_OA_CorporateClientsVisit = new OA_CorporateClientsVisit();
 
 
-            try
-            {
-                Guid Keyid = Request["Keyid"].ToGuid2();
+        //    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();
+        //        if (Request["Keyid"] != null)
+        //        {
 
 
-                m_OA_CorporateClientsVisit.CorporateClientsid = Keyid;
+        //        }
+        //        else
+        //        {
+        //            JavaScript.MessageBox("璇峰厛淇濆瓨瀹㈡埛", this);
+        //        }
 
-                m_OA_CorporateClientsVisit.VisitTime = this.txtVisitTime.Value.ToDateTime2();
+        //        if (this.txtVisitTime.Value == "")
+        //        {
+        //            JavaScript.MessageBox("璇烽�夋嫨鏃ユ湡", this);
 
-                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;
+        //        }
+        //        if (this.txtVisitTime.Value == "")
+        //        {
+        //            JavaScript.MessageBox("璇峰~鍐欑淮鎶よ褰�", this);
+
+        //        }
+
+        //        m_OA_CorporateClientsVisit.Keyid = Guid.NewGuid();
 
 
-                #region 娣诲姞鎴栫紪杈�
+        //        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;
 
 
-                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
+        //        #region 娣诲姞鎴栫紪杈�
 
 
-            }
-            catch (Exception ex)
-            {
-                PAGEHandleException(ex);
-                JavaScript.MessageBox("鎿嶄綔澶辫触", this);
-            }
-        }
+        //        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()
@@ -676,9 +705,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