2026821
This commit is contained in:
@@ -0,0 +1,196 @@
|
||||
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.Utility;
|
||||
using GThinking.N_MODEL.Page;
|
||||
using GThinking.N_MISPRO;
|
||||
using GThinking.N_MISPRO.Data;
|
||||
|
||||
namespace GThinking.N_XLJC
|
||||
{
|
||||
public partial class XHMLXQInfo : SingleCardBase
|
||||
{
|
||||
XHMLXQ entity = new XHMLXQ();
|
||||
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
this.UMID = 101421007;
|
||||
this.UMName = "适用型号电压";
|
||||
this.CurMaster = Master;
|
||||
this.CurEntity = entity;
|
||||
this.PageHeight = 400;
|
||||
this.PageWidth = 500;
|
||||
if (!IsPostBack)
|
||||
{
|
||||
InitControls();
|
||||
}
|
||||
base.InitPage();
|
||||
}
|
||||
#region 模板事件继承
|
||||
|
||||
protected override void OnNewRecorder()
|
||||
{
|
||||
string sMLXHID = txtMLXLXHID.Text.Trim();
|
||||
string sMLDYDJID = txtMLDYDJID.Text.Trim();
|
||||
if(sMLXHID.Equals(""))
|
||||
sMLXHID = PageParam.GetRTrimString("MLXLXHID");
|
||||
if (sMLDYDJID.Equals(""))
|
||||
sMLDYDJID = PageParam.GetRTrimString("MLDYDJID");
|
||||
|
||||
base.OnNewRecorder();
|
||||
txtMLXLXHID.Text = sMLXHID;
|
||||
txtMLDYDJID.Text = sMLDYDJID;
|
||||
txtWHR.Text = tSession.UserName.ToString().Trim();
|
||||
txtWHRID.Value = tSession.UserId.ToString().Trim();
|
||||
datWHSJ.Text = CMISproConvert.ConvertTime(System.DateTime.Now);
|
||||
}
|
||||
|
||||
protected override void LoadRecord()
|
||||
{
|
||||
if (!this.IsPostBack)
|
||||
{
|
||||
this.CurEntity.Param.Add("XLXSBJXHMLXQ_MLXLXHID", PageParam.GetRTrimString("XLXSBJXHMLXQ_MLXLXHID").Trim());
|
||||
this.CurEntity.Param.Add("XLXSBJXHMLXQ_MLDYDJID", PageParam.GetRTrimString("XLXSBJXHMLXQ_MLDYDJID").Trim());
|
||||
this.CurEntity.Param.Add("XLXSBJXHMLXQ_XLXHID", PageParam.GetRTrimString("XLXSBJXHMLXQ_XLXHID").Trim());
|
||||
this.CurEntity.Param.Add("XLXSBJXHMLXQ_XLGGID", PageParam.GetRTrimString("XLXSBJXHMLXQ_XLGGID").Trim());
|
||||
this.CurEntity.Param.Add("XLXSBJXHMLXQ_DYDJID", PageParam.GetRTrimString("XLXSBJXHMLXQ_DYDJID").Trim());
|
||||
this.CurEntity.Param.Add("XLXSBJXHMLXQ_JLDW", PageParam.GetRTrimString("XLXSBJXHMLXQ_JLDW").Trim());
|
||||
}
|
||||
else
|
||||
{
|
||||
entity.Param.Add("XLXSBJXHMLXQ_MLXLXHID", txtMLXLXHID.Text);
|
||||
entity.Param.Add("XLXSBJXHMLXQ_MLDYDJID", txtMLDYDJID.Text);
|
||||
entity.Param.Add("XLXSBJXHMLXQ_XLXHID", txtOLD_XLXHID.Value);
|
||||
entity.Param.Add("XLXSBJXHMLXQ_XLGGID", txtOLD_XLGGID.Value);
|
||||
entity.Param.Add("XLXSBJXHMLXQ_DYDJID", txtOLD_DYDJID.Value);
|
||||
entity.Param.Add("XLXSBJXHMLXQ_JLDW", txtOLD_JLDW.Value);
|
||||
}
|
||||
|
||||
base.LoadRecord();
|
||||
txtOLD_XLXHID.Value = txtXLXHID.Text;
|
||||
txtOLD_DYDJID.Value = cbxDYDJID.SelectedValue;
|
||||
txtOLD_XLGGID.Value = txtXLGGID.Text;
|
||||
txtOLD_JLDW.Value = txtJLDW.Text;
|
||||
}
|
||||
|
||||
protected override bool DataLogicValid()
|
||||
{
|
||||
bool bReturn = base.DataLogicValid();
|
||||
if (txtXLXHID.Text.Trim().Equals(""))
|
||||
{
|
||||
ShowMessage("型号不允许为空!");
|
||||
return false;
|
||||
}
|
||||
return bReturn;
|
||||
}
|
||||
|
||||
protected override void OnCopyRecorder()
|
||||
{
|
||||
base.OnCopyRecorder();
|
||||
|
||||
|
||||
txtWHR.Text = tSession.UserName.ToString().Trim();
|
||||
txtWHRID.Value = tSession.UserId.ToString().Trim();
|
||||
datWHSJ.Text = CMISproConvert.ConvertTime(System.DateTime.Now);
|
||||
}
|
||||
|
||||
protected override void SetControlState()
|
||||
{
|
||||
base.SetControlState();
|
||||
txtWHR.Enabled = false;
|
||||
datWHSJ.Enabled = false;
|
||||
}
|
||||
|
||||
protected override bool Master_AfterSaveAction(object sender, EventArgs e)
|
||||
{
|
||||
if (!base.Master_AfterSaveAction(sender, e)) return false;
|
||||
{
|
||||
txtOLD_XLXHID.Value = txtXLXHID.Text;
|
||||
txtOLD_DYDJID.Value = cbxDYDJID.SelectedValue;
|
||||
txtOLD_XLGGID.Value = txtXLGGID.Text;
|
||||
txtOLD_JLDW.Value = txtJLDW.Text;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
protected override void AfterSave(TDatabase db, ref bool ActionIsDone)
|
||||
{
|
||||
|
||||
TSQL SQL = new TSQL(db);
|
||||
SQL.Clear();
|
||||
SQL.Add(" merge into XLXSBJXHMLXQ a ");
|
||||
SQL.Add(" using ");
|
||||
SQL.Add("( ");
|
||||
SQL.Add("select XLXSBJXHMLXQ_MLXLXHID,XLXSBJXHMLXQ_MLDYDJID,");
|
||||
SQL.Add(" XLXSBJXHMLXQ_XLXHID,XLXSBJXHMLXQ_DYDJID,XLXSBJXHMLXQ_XLGGID,XLXSBJXHMLXQ_JLDW, ");
|
||||
SQL.Add(" row_number() ");
|
||||
SQL.Add(" over(order by XLXSBJXHMLXQ_XSXH,XLXSBJXHMLXQ_XLXHID,XLXSBJXHMLXQ_DYDJID,XLXSBJXHMLXQ_XLGGID,XLXSBJXHMLXQ_JLDW ) as XH ");
|
||||
SQL.Add(" from XLXSBJXHMLXQ ");
|
||||
SQL.Add(" where XLXSBJXHMLXQ_MLXLXHID=:pMLXHID and XLXSBJXHMLXQ_MLDYDJID=:pMLDYDJID ");
|
||||
SQL.Add(" ) b ");
|
||||
SQL.Add(" on( ");
|
||||
SQL.Add(" a.XLXSBJXHMLXQ_MLXLXHID=b.XLXSBJXHMLXQ_MLXLXHID ");
|
||||
SQL.Add(" and a.XLXSBJXHMLXQ_MLDYDJID=b.XLXSBJXHMLXQ_MLDYDJID ");
|
||||
SQL.Add(" and a.XLXSBJXHMLXQ_XLXHID=b.XLXSBJXHMLXQ_XLXHID ");
|
||||
SQL.Add(" and a.XLXSBJXHMLXQ_DYDJID=b.XLXSBJXHMLXQ_DYDJID ");
|
||||
SQL.Add(" and a.XLXSBJXHMLXQ_XLGGID=b.XLXSBJXHMLXQ_XLGGID ");
|
||||
SQL.Add(" and a.XLXSBJXHMLXQ_JLDW=b.XLXSBJXHMLXQ_JLDW ");
|
||||
SQL.Add(" ) ");
|
||||
SQL.Add(" when matched then update set a.XLXSBJXHMLXQ_XSXH=b.XH ");
|
||||
SQL.ParamByName("pMLXHID").Value = txtMLXLXHID.Text.Trim();
|
||||
SQL.ParamByName("pMLDYDJID").Value = txtMLDYDJID.Text.Trim();
|
||||
|
||||
db.ExecSQL(SQL);
|
||||
|
||||
SQL.Clear();
|
||||
SQL.Add(@"select XLXSBJXHMLXQ_XSXH from XLXSBJXHMLXQ
|
||||
where XLXSBJXHMLXQ_MLXLXHID=:XLXSBJXHMLXQ_MLXLXHID and XLXSBJXHMLXQ_MLDYDJID=:XLXSBJXHMLXQ_MLDYDJID and XLXSBJXHMLXQ_XLXHID=:XLXSBJXHMLXQ_XLXHID
|
||||
and XLXSBJXHMLXQ_DYDJID=:XLXSBJXHMLXQ_DYDJID and XLXSBJXHMLXQ_XLGGID=:XLXSBJXHMLXQ_XLGGID and XLXSBJXHMLXQ_JLDW=:XLXSBJXHMLXQ_JLDW ");
|
||||
SQL.ParamByName("XLXSBJXHMLXQ_MLXLXHID").Value = txtMLXLXHID.Text.Trim();
|
||||
SQL.ParamByName("XLXSBJXHMLXQ_MLDYDJID").Value = txtMLDYDJID.Text.Trim();
|
||||
SQL.ParamByName("XLXSBJXHMLXQ_XLXHID").Value = txtXLXHID.Text.Trim();
|
||||
SQL.ParamByName("XLXSBJXHMLXQ_DYDJID").Value =cbxDYDJID.SelectedValue.Trim();
|
||||
SQL.ParamByName("XLXSBJXHMLXQ_XLGGID").Value = txtXLGGID.Text.Trim();
|
||||
SQL.ParamByName("XLXSBJXHMLXQ_JLDW").Value = txtJLDW.Text.Trim();
|
||||
DataSet ds = db.OpenDataSet(SQL);
|
||||
if (ds.Tables[0].Rows.Count > 0)
|
||||
{
|
||||
txtXSXH.Value = CMISproConvert.StrToFloat(ds.Tables[0].Rows[0]["XLXSBJXHMLXQ_XSXH"].ToString());
|
||||
}
|
||||
|
||||
base.AfterSave(db, ref ActionIsDone);
|
||||
}
|
||||
|
||||
protected override bool Master_BeforeSaveAction(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
return base.Master_BeforeSaveAction(sender, e);
|
||||
}
|
||||
|
||||
protected override bool Master_BeforeDeleteAction(object sender, EventArgs e)
|
||||
{
|
||||
return base.Master_BeforeDeleteAction(sender, e);
|
||||
}
|
||||
protected override void SetComboxItems()
|
||||
{
|
||||
base.SetComboxItems();
|
||||
string sSQL = "select XLDYDJB_DYDJID,XLDYDJB_DYDJID as DYDJID from XLDYDJB where 1 = 1 and isnull(XLDYDJB_TYBZ,'N')='N' order by XLDYDJB_DYDJID ";
|
||||
TComboBox.SetComboBox("DBERP", cbxDYDJID, sSQL, true);
|
||||
cbxDYDJID.ShowValue = false;
|
||||
}
|
||||
#endregion
|
||||
#region 自定义事件
|
||||
private void InitControls()
|
||||
{
|
||||
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user