using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using CY.BLL; using CY.Model; using CY.Infrastructure.Query; using CY.Infrastructure.Common; using CY.BLL.Sys; using CY.Model.Inquiry; using CY.SQLDAL; using System.Data.SqlClient; using CY.Infrastructure.Logging; using CY.WebForm.Helper; namespace CY.WebForm.Pages.business { public partial class CorporateClientsSheji : BasePage { OA_CorporateClientsBLL bll_OA_CorporateClientsBLL = null; Sys_DictionaryBLL bll_Sys_DictionaryBLL = null;//字典业务逻辑操作类对象 SysInquiry_PrintingTypeBLL bll_SysInquiry_PrintingTypeBLL = null;//印刷业务类型业务逻辑操作类对象 /// /// 是否需要节假日维护 /// public bool IsNeedJiejiaRi { get; set; } /// /// 是否需要维护 /// public bool NeedWeihu { get; set; } /// /// 合作客户例子 /// public OA_CorporateClients client { get; set; } //初始化 public CorporateClientsSheji() { bll_OA_CorporateClientsBLL = new OA_CorporateClientsBLL(); bll_Sys_DictionaryBLL = new Sys_DictionaryBLL(); bll_SysInquiry_PrintingTypeBLL = new SysInquiry_PrintingTypeBLL(); } /// /// 是否时维护提醒传过来的 /// public bool IsWeihuTixingUrl { get; set; } = false; //页面加载 protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (Request["Keyid"] != null || Request["MemberId"] != null) { 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()); this.txtShejiTime.Value = DateTime.Now.ToString("yyyy-MM-dd"); this.RepClientList.DataSource = bll_OA_CorporateClientsBLL.SelectShejiListByCorId(Request["Keyid"].ToGuid2()); this.RepClientList.DataBind(); } } } //完结事件 protected void btn_Submit_Sheji(object sender, EventArgs e) { OA_CorporateClientsSheji m_OA_CorporateClientsSheji = new OA_CorporateClientsSheji(); try { Guid Keyid = Request["Keyid"].ToGuid2(); if (Request["Keyid"] != null) { } else { JavaScript.MessageBox("请先保存客户", this); return; } if (this.txtShejiTime.Value == "") { JavaScript.MessageBox("请选择日期", this); return; } if (this.txtYinjianName.Value.Trim() == "") { JavaScript.MessageBox("请填写印件名称", this); return; } if (this.txtJiaogaoCount.Value.Trim() == "") { JavaScript.MessageBox("请填写校稿次数", this); return; } if (this.txtShejiRemark.Value.Trim() == "") { JavaScript.MessageBox("请填写维护记录", this); return; } m_OA_CorporateClientsSheji.Keyid = Guid.NewGuid(); m_OA_CorporateClientsSheji.CorporateClientsid = Keyid; m_OA_CorporateClientsSheji.ShejiTime = this.txtShejiTime.Value.ToDateTime2(); m_OA_CorporateClientsSheji.YinjianName = this.txtYinjianName.Value.Trim(); m_OA_CorporateClientsSheji.JiaogaoCount = this.txtJiaogaoCount.Value.Trim().ToInt32(); m_OA_CorporateClientsSheji.Remark = this.txtShejiRemark.Value.Trim(); m_OA_CorporateClientsSheji.Creater = CurrentUser.TrueMemberId; m_OA_CorporateClientsSheji.CreateTime = DateTime.Now; m_OA_CorporateClientsSheji.Updater = CurrentUser.TrueMemberId; m_OA_CorporateClientsSheji.LastUpdateTime = DateTime.Now; #region 添加或编辑 bool result = bll_OA_CorporateClientsBLL.InsertModelSheji(m_OA_CorporateClientsSheji);//更新信息 if (result) { this.txtShejiTime.Value = ""; this.txtShejiRemark.Value = ""; this.txtYinjianName.Value = ""; this.txtJiaogaoCount.Value = ""; //JavaScript.MessageBox("维护保存成功", this, false, false); JavaScript.MessageBoxandhideLoadingIndicator("保存成功", this); } else JavaScript.MessageBox("维护保存失败", this); this.RepClientList.DataSource = bll_OA_CorporateClientsBLL.SelectShejiListByCorId(Request["Keyid"].ToGuid2()); this.RepClientList.DataBind(); #endregion } catch (Exception ex) { PAGEHandleException(ex); JavaScript.MessageBox("操作失败", this); } } } }