From fa0043f004f1c666d1873436a980e0c90ff09054 Mon Sep 17 00:00:00 2001
From: username@email.com <yzy2002yzy@163.com>
Date: 星期一, 25 八月 2025 15:59:43 +0800
Subject: [PATCH] 修改请示批复的查询条件

---
 CY_ECommercePlatform/CY.WebForm/Pages/business/CorporateClientsVisit.aspx.cs |  147 +++++++++++++++++++++++++++++++++++-------------
 1 files changed, 106 insertions(+), 41 deletions(-)

diff --git a/CY_ECommercePlatform/CY.WebForm/Pages/business/CorporateClientsVisit.aspx.cs b/CY_ECommercePlatform/CY.WebForm/Pages/business/CorporateClientsVisit.aspx.cs
index 3c51962..ce696dd 100644
--- a/CY_ECommercePlatform/CY.WebForm/Pages/business/CorporateClientsVisit.aspx.cs
+++ b/CY_ECommercePlatform/CY.WebForm/Pages/business/CorporateClientsVisit.aspx.cs
@@ -13,6 +13,7 @@
 using CY.SQLDAL;
 using System.Data.SqlClient;
 using CY.Infrastructure.Logging;
+using CY.WebForm.Helper;
 
 namespace CY.WebForm.Pages.business
 {
@@ -48,43 +49,46 @@
         //椤甸潰鍔犺浇
         protected void Page_Load(object sender, EventArgs e)
         {
-
-            if (Request["Keyid"] != null || Request["MemberId"] != null)
+            if (!IsPostBack)
             {
-                OA_CorporateClients m_OA_CorporateClients = bll_OA_CorporateClientsBLL.GetModelDetail(Request["Keyid"].ToGuid2());
-                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)
+                if (Request["Keyid"] != null || Request["MemberId"] != null)
                 {
-                    this.Button1.Enabled = false;
-                    this.txtvisitRemark.Value = x;
+                    OA_CorporateClients m_OA_CorporateClients = bll_OA_CorporateClientsBLL.GetModelDetail(Request["Keyid"].ToGuid2());
+                    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;
+                    }
+
+
                 }
-
-                this.txtVisitTime.Value = DateTime.Now.ToString("yyyy-MM-dd");
-                //鍒ゅ喅鏄惁鏄彁閱掑脊绐�  杩欎釜寮圭獥娣诲姞缁存姢璁板綍鍚庝細鍏抽棴绐楀彛
-                var y = Request["tixingweihu"];
-                if ( y != null&& y=="1")
-                {
-                    IsWeihuTixingUrl = true;
-                }
-
-
             }
+              
 
 
         }
@@ -109,18 +113,67 @@
                 else
                 {
                     JavaScript.MessageBox("璇峰厛淇濆瓨瀹㈡埛", this);
+                    return;
                 }
 
                 if (this.txtVisitTime.Value == "")
                 {
                     JavaScript.MessageBox("璇烽�夋嫨鏃ユ湡", this);
+                    return;
 
                 }
                 if (this.txtVisitTime.Value == "")
                 {
                     JavaScript.MessageBox("璇峰~鍐欑淮鎶よ褰�", this);
+                    return;
 
                 }
+                if (this.txtvisitRemark.Value.Trim() == "")
+                {
+                    JavaScript.MessageBox("璇峰~鍐欑淮鎶よ褰�", this);
+                    return;
+
+                }
+
+                var files = Request.Files;
+                List<HttpPostedFile> fileList = new List<HttpPostedFile>();
+                if (files.Count > 0)
+                {
+                    HttpPostedFile postedFile;
+                  
+
+
+                    for (int i = 0; i < files.Count; i++)
+                    {
+
+                        if (files.Keys[i] == "filesel")
+                        {
+                            postedFile = files[i];
+                            if (postedFile.ContentLength == 0)
+                                continue;
+                            if (postedFile.ContentLength > 2 * 1024 * 1024)
+                            {
+                                JavaScript.MessageBox("涓婁紶鏂囦欢澶у皬蹇呴』灏忎簬2M", this);
+                                return;
+                            }
+                                                                          
+
+                            
+                            fileList.Add(postedFile);
+                        }
+
+                    }
+                }
+               
+
+                  
+               
+
+
+
+               
+
+
 
                 m_OA_CorporateClientsVisit.Keyid = Guid.NewGuid();
 
@@ -129,7 +182,7 @@
 
                 m_OA_CorporateClientsVisit.VisitTime = this.txtVisitTime.Value.ToDateTime2();
 
-                m_OA_CorporateClientsVisit.Remark = this.txtvisitRemark.Value.ToString2();
+                m_OA_CorporateClientsVisit.Remark = this.txtvisitRemark.Value.Trim();
                 m_OA_CorporateClientsVisit.Creater = CurrentUser.TrueMemberId;
                 m_OA_CorporateClientsVisit.CreateTime = DateTime.Now;
                 m_OA_CorporateClientsVisit.Updater = CurrentUser.TrueMemberId;
@@ -143,11 +196,27 @@
 
                 if (result)
                 {
-                    //this.RepClientList.DataSource = bll_OA_CorporateClientsBLL.SelectVisitListByCorId(Keyid);
-                    //this.RepClientList.DataBind();
+                    if (fileList.Count > 0)
+                    {
+                        upLoadContractFile uploadContract = new upLoadContractFile();
+                        foreach (var file in fileList)
+                        {
+                            var re = uploadContract.UploadFile(file, "ClientVisit", file.FileName);
+                            var oa_Attachment = new OA_attachment();
+                            oa_Attachment.OA_Id = m_OA_CorporateClientsVisit.Keyid;
+                            oa_Attachment.AttachmentType = 99;
+                            oa_Attachment.PlanAttachment = re;
+                            oa_Attachment.CreateTime = DateTime.Now;
+                            oa_Attachment.Operator = CurrentUser.TrueName;
+                            oa_Attachment.AttachmentName = file.FileName;
+                            oa_Attachment.AttachmentHouzhui = System.IO.Path.GetExtension(file.FileName).ToLower();
+                            bll_OA_CorporateClientsBLL.Insertattachment(oa_Attachment);
+                        }
+                    }
                     this.txtVisitTime.Value = "";
                     this.txtvisitRemark.Value = "";
-                    JavaScript.MessageBox("缁存姢淇濆瓨鎴愬姛", this, false, false);
+                    //JavaScript.MessageBox("缁存姢淇濆瓨鎴愬姛", this, false, false);
+                    JavaScript.MessageBoxandhideLoadingIndicator("淇濆瓨鎴愬姛", this);
                     if (NeedWeihu)
                     {
 
@@ -189,10 +258,6 @@
                     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

--
Gitblit v1.9.1