From be3b255bbe328d793ff20011683dca5aee1668a1 Mon Sep 17 00:00:00 2001 From: username@email.com <yzy2002yzy@163.com> Date: 星期三, 23 七月 2025 09:05:29 +0800 Subject: [PATCH] 20250722 川印系统客户访问增加长度,增加附件何查看 20250721 川印系统修改 完成 --- CY_ECommercePlatform/CY.WebForm/Pages/business/CorporateClientsVisit.aspx.cs | 78 +++++++++++++++++++++++++++++++++++---- 1 files changed, 70 insertions(+), 8 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..20d0954 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 { @@ -109,18 +110,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 +179,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 +193,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 +255,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