125 lines
3.9 KiB
C#
125 lines
3.9 KiB
C#
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_MISPRO.Utility;
|
|
using GThinking.N_PUBLIC;
|
|
using GThinking.N_MODEL.Dialog;
|
|
using GThinking.N_WORKFLOW;
|
|
using GThinking.N_CONTROL;
|
|
|
|
namespace GThinking.N_XLXSBJ
|
|
{
|
|
public partial class XLXHCPTXWHInfo : SingleCardBase
|
|
{
|
|
XLXHCPTXWH entity = new XLXHCPTXWH();
|
|
protected void Page_Load(object sender, EventArgs e)
|
|
{
|
|
this.UMID = 100860167;
|
|
this.UMName = "线缆型号附加属性维护";
|
|
this.CurMaster = Master;
|
|
this.CurEntity = entity;
|
|
this.PageHeight = 260;
|
|
this.PageWidth = 360;
|
|
|
|
base.InitPage();
|
|
}
|
|
|
|
#region 模板事件继承
|
|
|
|
protected override void LoadRecord()
|
|
{
|
|
if (!IsPostBack)
|
|
{
|
|
entity.Param.Add("XLXHCPTXWH_XLXHID", PageParam.GetRTrimString("XLXHCPTXWH_XLXHID"));
|
|
entity.Param.Add("XLXHCPTXWH_XLXHFJSX", PageParam.GetRTrimString("XLXHCPTXWH_XLXHFJSX"));
|
|
}
|
|
else
|
|
{
|
|
entity.Param.Add("XLXHCPTXWH_XLXHID", cbxXLXHID.SelectedValue.Trim());
|
|
entity.Param.Add("XLXHCPTXWH_XLXHFJSX", txtXLXHFJSX.Text.Trim());
|
|
}
|
|
|
|
base.LoadRecord();
|
|
}
|
|
|
|
protected override void OnNewRecorder()
|
|
{
|
|
base.OnNewRecorder();
|
|
txtWHR.Text = tSession.UserName;
|
|
txtWHRID.Value = tSession.UserId;
|
|
datWHSJ.Value = CMISproConvert.ConvertTime(DateTime.Now);
|
|
}
|
|
|
|
protected override void OnCopyRecorder()
|
|
{
|
|
base.OnCopyRecorder();
|
|
txtWHR.Text = tSession.UserName;
|
|
txtWHRID.Value = tSession.UserId;
|
|
datWHSJ.Value = CMISproConvert.ConvertTime(DateTime.Now);
|
|
}
|
|
|
|
protected override bool DataLogicValid()
|
|
{
|
|
if (ControlState != TControlState.ctsEdit)
|
|
{
|
|
if (CMISproDataBase.ExistsRecord("DBERP", string.Format("select 1 from XLXHCPTXWH where XLXHCPTXWH_XLXHID='{0}' and XLXHCPTXWH_XLXHFJSX='{1}'",
|
|
cbxXLXHID.SelectedValue.Trim(), txtXLXHFJSX.Text.Trim())))
|
|
{
|
|
ShowMessage("已存在型号、附加属性相同的记录,不允许重复登记!");
|
|
return false;
|
|
}
|
|
}
|
|
return base.DataLogicValid();
|
|
}
|
|
|
|
protected override bool Master_BeforeSaveAction(object sender, EventArgs e)
|
|
{
|
|
txtWHR.Text = tSession.UserName;
|
|
txtWHRID.Value = tSession.UserId;
|
|
datWHSJ.Value = CMISproConvert.ConvertTime(DateTime.Now);
|
|
return base.Master_BeforeSaveAction(sender, e);
|
|
}
|
|
|
|
protected override void SetControlState()
|
|
{
|
|
base.SetControlState();
|
|
|
|
txtWHR.Enabled = false;
|
|
datWHSJ.Enabled = false;
|
|
|
|
if (ControlState == TControlState.ctsEdit)
|
|
{
|
|
cbxXLXHID.Enabled = false;
|
|
txtXLXHFJSX.Enabled = false;
|
|
}
|
|
}
|
|
|
|
protected override void SetComboxItems()
|
|
{
|
|
if (ControlState == TControlState.ctsBrowse)
|
|
{
|
|
cbxXLXHID.ClearItems();
|
|
cbxXLXHID.Items.Add(new ListItem(cbxXLXHID.SelectedValue.Trim(), cbxXLXHID.SelectedValue.Trim()));
|
|
}
|
|
else
|
|
{
|
|
TComboBox.SetComboBox("DBERP", cbxXLXHID, "select XLXHB_XLXHID as ID,XLXHB_XLXHID as Name from XLXHB where isnull(XLXHB_TYBZ,'N')<>'Y' order by ID ", false);
|
|
}
|
|
|
|
base.SetComboxItems();
|
|
}
|
|
|
|
#endregion
|
|
}
|
|
}
|