using System; using System.Data; using System.Configuration; using System.Collections; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; using GThinking.N_MISPRO; using GThinking.N_MISPRO.Data; using GThinking.N_MODEL.Page; using GThinking.N_PUBLIC; using GThinking.N_MISPRO.Utility; namespace GThinking.N_XLXSBJ { public partial class XLBJD_CYSMInfo : SingleCardBase { XLBJD_CYSM entity = new XLBJD_CYSM(); protected void Page_Load(object sender, EventArgs e) { this.UMID = 100860000; this.UMName = "常用说明"; base.CurMaster = Master; this.CurEntity = entity; this.PageHeight = 400; this.PageWidth = 500; this.Master.EnableInsertBtn = false; this.Master.EnableCopyBtn = false; this.Master.EnableAttachBtn = false; base.InitPage(); if (!IsPostBack) { if (this.PageHeight > 400) { txtSMNR.Height = Unit.Parse(Convert.ToString(this.PageHeight - 400 + 150) + "px"); } } } #region 模板继承事件 protected override void LoadRecord() { if (!IsPostBack) { entity.Param.Add("XLXSBJSM_SMID", PageParam.GetRTrimString("SMID")); entity.Param.Add("XLXSBJSM_ZDM", PageParam.GetRTrimString("ZDM")); } else { entity.Param.Add("XLXSBJSM_SMID", txtSMID.Text.Trim()); entity.Param.Add("XLXSBJSM_ZDM", txtZDM.Value); } base.LoadRecord(); } protected override void SetControlState() { base.SetControlState(); txtWHR.Enabled = false; datWHSJ.Enabled = false; txtSMID.Enabled = false; } protected override bool Master_BeforeSaveAction(object sender, EventArgs e) { txtWHR.Text = tSession.UserName; txtWHRID.Value = tSession.UserId; datWHSJ.Value = CMISproConvert.ConvertTime(DateTime.Now); txtZDM.Value = "BJSM"; return base.Master_BeforeSaveAction(sender, e); } protected override bool DataLogicValid() { if(txtSMZT.Text.Trim().Equals("")) { ShowMessage("说明主题不允许为空!"); return false; } return base.DataLogicValid(); } protected override void SetComboxItems() { base.SetComboxItems(); } protected override void AfterSave(TDatabase db, ref bool ActionIsDone) { if (chkMRBZ.Checked) { db.ExecSQL(String.Format("update XLXSBJSM set XLXSBJSM_MRBZ ='N' where XLXSBJSM_SMID <> '{0}' and XLXSBJSM_ZDM = 'BJSM' and isnull(XLXSBJSM_KH,' ')='{1}'", txtSMID.Text.Trim(), txtKH.Text.Trim())); } base.AfterSave(db, ref ActionIsDone); } #endregion #region 控件事件 #endregion #region 自定义事件 #endregion } }