username@email.com
2025-08-25 fa0043f004f1c666d1873436a980e0c90ff09054
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