192 lines
11 KiB
C#
192 lines
11 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_PUBLIC;
|
|
using GThinking.N_MISPRO.Utility;
|
|
using System.Text.RegularExpressions;
|
|
using GThinking.N_CONTROL;
|
|
|
|
namespace GThinking.N_XLXSBJ
|
|
{
|
|
public partial class XLBJD_WBBJDMX_XHTHInfo : SingleCardBase
|
|
{
|
|
XLBJD_WBBJDMX_XHTH entity = new XLBJD_WBBJDMX_XHTH();
|
|
|
|
#region 页面初始化
|
|
|
|
protected void Page_Load(object sender, EventArgs e)
|
|
{
|
|
this.UMID = 100860043;
|
|
this.UMName = "外部线缆产品导入";
|
|
this.CurMaster = Master;
|
|
this.CurEntity = entity;
|
|
this.Master.EnableAttachBtn = false;
|
|
this.Master.EnablePrintBtn = false;
|
|
this.PageWidth = 500;
|
|
this.PageHeight = 400;
|
|
|
|
|
|
base.InitPage();
|
|
|
|
|
|
if (!IsPostBack)
|
|
{
|
|
InitControl();
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region 模板事件继承
|
|
|
|
protected override void LoadRecord()
|
|
{
|
|
if (!IsPostBack)
|
|
{
|
|
this.CurEntity.Param.Add("XLWBBJDXHDZB_WBXLXHID", PageParam.GetRTrimString("XLWBBJDXHDZB_WBXLXHID"));
|
|
this.CurEntity.Param.Add("XLWBBJDXHDZB_XLXHID", PageParam.GetRTrimString("XLWBBJDXHDZB_XLXHID"));
|
|
}
|
|
else
|
|
{
|
|
this.CurEntity.Param.Add("XLWBBJDXHDZB_WBXLXHID", txtOLDWBXLXHID.Text.Trim());
|
|
this.CurEntity.Param.Add("XLWBBJDXHDZB_XLXHID", txtOLDXLXHID.Text.Trim());
|
|
}
|
|
|
|
base.LoadRecord();
|
|
}
|
|
|
|
protected override void OnNewRecorder()
|
|
{
|
|
|
|
base.OnNewRecorder();
|
|
|
|
txtWHR.Text = tSession.UserName;
|
|
datWHSJ.Value = CMISproConvert.ConvertTime(DateTime.Now);
|
|
txtWHRID.Value = tSession.UserId;
|
|
}
|
|
|
|
protected override void OnCopyRecorder()
|
|
{
|
|
base.OnCopyRecorder();
|
|
|
|
txtWHR.Text = tSession.UserName;
|
|
txtWHRID.Value = tSession.UserId;
|
|
datWHSJ.Value = CMISproConvert.ConvertTime(DateTime.Now);
|
|
}
|
|
|
|
protected override void SetControlState()
|
|
{
|
|
base.SetControlState();
|
|
|
|
txtWHR.Enabled = false;
|
|
datWHSJ.Enabled = false;
|
|
}
|
|
|
|
protected override void SetComboxItems()
|
|
{
|
|
base.SetComboxItems();
|
|
}
|
|
|
|
protected override bool DataLogicValid()
|
|
{
|
|
if (txtWBXLXHID.Text.Trim().Equals(""))
|
|
{
|
|
ShowMessage("外部型号不允许为空!");
|
|
return false;
|
|
}
|
|
if (txtXLXHID.Text.Trim().Equals(""))
|
|
{
|
|
ShowMessage("系统型号不允许为空!");
|
|
return false;
|
|
}
|
|
string sSQL = "";
|
|
sSQL = string.Format("select 1 from XLXHB where XLXHB_XLXHID = '{0}' ", txtXLXHID.Text.Trim());
|
|
if (!CMISproDataBase.ExistsRecord("DBERP", sSQL))
|
|
{
|
|
ShowMessage("系统型号不合法,不允许保存!");
|
|
return false;
|
|
}
|
|
//此处需要限制不能出现出现同样的外部型号
|
|
if ((ControlState == TControlState.ctsInsert) || (ControlState == TControlState.ctsCopy))
|
|
{
|
|
sSQL = string.Format("select 1 from XLWBBJDXHDZB where XLWBBJDXHDZB_WBXLXHID = '{0}' ", txtWBXLXHID.Text.Trim());
|
|
if (CMISproDataBase.ExistsRecord("DBERP", sSQL))
|
|
{
|
|
ShowMessage("外部型号已经存在,不允许重复替换!");
|
|
return false;
|
|
}
|
|
}
|
|
else
|
|
{
|
|
if (!txtOLDWBXLXHID.Text.ToString().Trim().Equals(txtWBXLXHID.Text.ToString().Trim()))
|
|
{
|
|
sSQL = string.Format("select 1 from XLWBBJDXHDZB where XLWBBJDXHDZB_WBXLXHID = '{0}' ", txtWBXLXHID.Text.Trim());
|
|
if (CMISproDataBase.ExistsRecord("DBERP", sSQL))
|
|
{
|
|
ShowMessage("外部型号已经存在,不允许重复替换!");
|
|
return false;
|
|
}
|
|
}
|
|
}
|
|
//此处暂不增加外部型号与系统型号相同。
|
|
//此处暂不增加外部型号与系统型号不可咬合。
|
|
|
|
|
|
return base.DataLogicValid();
|
|
}
|
|
|
|
protected override bool Master_BeforeSaveAction(object sender, EventArgs e)
|
|
{
|
|
txtWHR.Text = tSession.UserName;
|
|
txtWHRID.Value = tSession.UserId;
|
|
datWHSJ.Text = CMISproConvert.ConvertTime(System.DateTime.Now);
|
|
|
|
return base.Master_BeforeSaveAction(sender, e);
|
|
}
|
|
|
|
protected override void BeforeSave(TDatabase db, ref bool ActionIsDone)
|
|
{
|
|
base.BeforeSave(db, ref ActionIsDone);
|
|
}
|
|
|
|
protected override void AfterSave(TDatabase db, ref bool ActionIsDone)
|
|
{
|
|
base.BeforeSave(db, ref ActionIsDone);
|
|
}
|
|
|
|
protected override bool Master_AfterSaveAction(object sender, EventArgs e)
|
|
{
|
|
txtOLDWBXLXHID.Text = txtWBXLXHID.Text.Trim();
|
|
txtOLDXLXHID.Text = txtXLXHID.Text.Trim();
|
|
return base.Master_AfterSaveAction(sender, e);
|
|
}
|
|
|
|
|
|
#endregion
|
|
|
|
#region 控件事件
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
#region 私有函数
|
|
private void InitControl()
|
|
{
|
|
|
|
}
|
|
#endregion
|
|
}
|
|
}
|