2026821
This commit is contained in:
@@ -0,0 +1,593 @@
|
||||
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_MODEL.Page;
|
||||
using GThinking.N_MISPRO.Utility;
|
||||
using GThinking.N_CONTROL;
|
||||
using GThinking.N_MISPRO.Data;
|
||||
using GThinking.N_MISPRO;
|
||||
|
||||
namespace GThinking.N_XLXSBJ
|
||||
{
|
||||
public partial class TZYZBJGInfo : SingleCardBase
|
||||
{
|
||||
TZYZBJG entity = new TZYZBJG();
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
this.UMID = 100860133;
|
||||
this.UMName = "按电压芯线结构导体材料主芯截面报价数量";
|
||||
this.CurMaster = Master;
|
||||
this.CurEntity = entity;
|
||||
this.PageHeight = 450;
|
||||
this.PageWidth = 500;
|
||||
|
||||
if (XLBJDUtils.GetDefaultBJU003(GetOption(100860000, "BJU003")).Equals("M"))
|
||||
{
|
||||
lblBJSLDW.Text = "M";
|
||||
}
|
||||
else
|
||||
{
|
||||
lblBJSLDW.Text = "Km";
|
||||
}
|
||||
|
||||
SetTJYZLable();
|
||||
|
||||
if (!this.IsPostBack)
|
||||
{
|
||||
InitControls();
|
||||
}
|
||||
|
||||
base.InitPage();
|
||||
}
|
||||
|
||||
|
||||
#region 模板事件继承
|
||||
protected override void ReportDataSetAdd()
|
||||
{
|
||||
TDatabase db = TContextDatabases.GetDatabase("DBERP");
|
||||
TSQL sql = new TSQL(db);
|
||||
sql.Add("select XLXSTZYZ_YZID, XLXSTZYZ_YZMC from XLXSTZYZ where XLXSTZYZ_MXBH='BJD' and XLXSTZYZ_TJYS='G' order by XLXSTZYZ_XSXH,XLXSTZYZ_YZID ");
|
||||
DataSet ds = db.OpenDataSet(sql);
|
||||
for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
|
||||
{
|
||||
string sYZID = "TZYZ_" + ds.Tables[0].Rows[i]["XLXSTZYZ_YZID"].ToString().Trim();
|
||||
string sYZMC = ds.Tables[0].Rows[i]["XLXSTZYZ_YZMC"].ToString().Trim();
|
||||
AddUserReportField("XLXSBJDYZZG", sYZID, sYZMC, "N");
|
||||
}
|
||||
|
||||
base.ReportDataSetAdd();
|
||||
}
|
||||
protected override void ReportRecordSetAdd()
|
||||
{
|
||||
TDatabase dberp = TContextDatabases.GetDatabase("DBERP");
|
||||
|
||||
TSQL sSQL = new TSQL(dberp);
|
||||
TSQL SQL = new TSQL(dberp);
|
||||
SQL.Clear();
|
||||
SQL.Add("select XLXSTZYZ_YZID, XLXSTZYZ_YZMC ");
|
||||
SQL.Add(" from XLXSTZYZ");
|
||||
SQL.Add(" where XLXSTZYZ_MXBH = 'BJD' and XLXSTZYZ_TJYS='G' order by XLXSTZYZ_XSXH,XLXSTZYZ_YZID ");
|
||||
DataSet ds = dberp.OpenDataSet(SQL);
|
||||
for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
|
||||
{
|
||||
sSQL.Add(string.Format(",sum(decode(XLXSBJDYZZG_YZID, '{0}', XLXSBJDYZZG_YZZ, 0)) as TZYZ_{0}", ds.Tables[0].Rows[i][0].ToString().Trim()));
|
||||
}
|
||||
sSQL.Text = "select 1" + sSQL.Text + " from XLXSBJDYZZG where XLXSBJDYZZG_JGBID='" + txtJGBID.Value.Trim()
|
||||
+ "' and XLXSBJDYZZG_DTCLID = '" + (cbxDTCLID.SelectedValue.Trim().Equals("") ? " " : cbxDTCLID.SelectedValue.Trim())
|
||||
+ "' and XLXSBJDYZZG_DYDJID = '" + (cbxDYDJID.SelectedValue.Trim().Equals("") ? " " : cbxDYDJID.SelectedValue.Trim())
|
||||
+ "' and XLXSBJDYZZG_XXJGID = '" + (txtXXJGID.Text.Trim().Equals("") ? " " : txtXXJGID.Text.Trim())
|
||||
+ "' and XLXSBJDYZZG_ZXJMSX= " + txtZXJMSX.Value + " and XLXSBJDYZZG_ZXJMXX= " + txtZXJMXX.Value + "' and XLXSBJDYZZG_BJSLSX= " + txtBJSLSX.Value + " and XLXSBJDYZZG_BJSLXX= " + txtBJSLXX.Value + "";
|
||||
AddUserReportSQL("XLXSBJDYZZG", sSQL);
|
||||
base.ReportRecordSetAdd();
|
||||
}
|
||||
protected override void SetControlState()
|
||||
{
|
||||
base.SetControlState();
|
||||
|
||||
txtWHR.Enabled = false;
|
||||
datWHSJ.Enabled = false;
|
||||
|
||||
# region 给调价因子控件设只读性
|
||||
if (ControlState == TControlState.ctsInsert || ControlState == TControlState.ctsCopy || ControlState == TControlState.ctsEdit)
|
||||
{
|
||||
for (int i = 1; i <= 20; i++)
|
||||
{
|
||||
gtNumTextBox txtTJYZ = (gtNumTextBox)Master.ContentFormControl.FindControl("txt" + "TJYZ" + i);
|
||||
txtTJYZ.Enabled = false;
|
||||
}
|
||||
|
||||
string[] sTJYZList = PageParam.GetRTrimString("TJYZList").Split(',');
|
||||
for (int i = 0; i < sTJYZList.Length; i++)
|
||||
{
|
||||
for (int j = 1; j <= 20; j++)
|
||||
{
|
||||
string sTZYZID = "BJ" + j.ToString().PadLeft(2, '0') + "|";
|
||||
gtNumTextBox txtTJYZ = (gtNumTextBox)Master.ContentFormControl.FindControl("txt" + "TJYZ" + j.ToString().Trim());
|
||||
if (sTJYZList[i].StartsWith(sTZYZID))
|
||||
{
|
||||
txtTJYZ.Enabled = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
protected override void LoadRecord()
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
entity.Param.Add("XLXSBJDYZZG_JGBID", PageParam.GetRTrimString("XLXSBJDYZZG_JGBID"));
|
||||
entity.Param.Add("XLXSBJDYZZG_DTCLID", PageParam.GetRTrimString("XLXSBJDYZZG_DTCLID").Equals("") ? " " : PageParam.GetRTrimString("XLXSBJDYZZG_DTCLID"));
|
||||
entity.Param.Add("XLXSBJDYZZG_DYDJID", PageParam.GetRTrimString("XLXSBJDYZZG_DYDJID").Equals("") ? " " : PageParam.GetRTrimString("XLXSBJDYZZG_DYDJID"));
|
||||
entity.Param.Add("XLXSBJDYZZG_XXJGID", PageParam.GetRTrimString("XLXSBJDYZZG_XXJGID").Equals("") ? " " : PageParam.GetRTrimString("XLXSBJDYZZG_XXJGID"));
|
||||
entity.Param.Add("XLXSBJDYZZG_ZXJMSX", PageParam.GetRTrimString("XLXSBJDYZZG_ZXJMSX"));
|
||||
entity.Param.Add("XLXSBJDYZZG_ZXJMXX", PageParam.GetRTrimString("XLXSBJDYZZG_ZXJMXX"));
|
||||
entity.Param.Add("XLXSBJDYZZG_BJSLSX", PageParam.GetRTrimString("XLXSBJDYZZG_BJSLSX"));
|
||||
entity.Param.Add("XLXSBJDYZZG_BJSLXX", PageParam.GetRTrimString("XLXSBJDYZZG_BJSLXX"));
|
||||
entity.Param.Add("XLXSBJDYZZG_YZID", PageParam.GetRTrimString("XLXSBJDYZZG_YZID"));
|
||||
}
|
||||
else
|
||||
{
|
||||
entity.Param.Add("XLXSBJDYZZG_JGBID", txtJGBID.Value.Trim());
|
||||
entity.Param.Add("XLXSBJDYZZG_DTCLID", txtOLD_DTCLID.Value.Trim().Equals("") ? " " : txtOLD_DTCLID.Value.Trim());
|
||||
entity.Param.Add("XLXSBJDYZZG_DYDJID", txtOLD_DYDJID.Value.Trim().Equals("") ? " " : txtOLD_DYDJID.Value.Trim());
|
||||
entity.Param.Add("XLXSBJDYZZG_XXJGID", txtOLD_XXJGID.Value.Trim().Equals("") ? " " : txtOLD_XXJGID.Value.Trim());
|
||||
entity.Param.Add("XLXSBJDYZZG_ZXJMSX", txtOLD_ZXJMSX.Value);
|
||||
entity.Param.Add("XLXSBJDYZZG_ZXJMXX", txtOLD_ZXJMXX.Value);
|
||||
entity.Param.Add("XLXSBJDYZZG_BJSLSX", txtOLD_BJSLSX.Value);
|
||||
entity.Param.Add("XLXSBJDYZZG_BJSLXX", txtOLD_BJSLXX.Value);
|
||||
entity.Param.Add("XLXSBJDYZZG_YZID", txtYZID.Value.Trim());
|
||||
}
|
||||
base.LoadRecord();
|
||||
|
||||
|
||||
txtOLD_DTCLID.Value = cbxDTCLID.SelectedValue.Trim().Equals("") ? " " : cbxDTCLID.SelectedValue.Trim();
|
||||
txtOLD_DYDJID.Value = cbxDYDJID.SelectedValue.Trim().Equals("") ? " " : cbxDYDJID.SelectedValue.Trim();
|
||||
txtOLD_XXJGID.Value = txtXXJGID.Text.Trim().Equals("") ? " " : txtXXJGID.Text.Trim();
|
||||
txtOLD_ZXJMSX.Value = txtZXJMSX.Value.ToString().Trim();
|
||||
txtOLD_ZXJMXX.Value = txtZXJMXX.Value.ToString().Trim();
|
||||
txtOLD_BJSLSX.Value = txtBJSLSX.Value.ToString().Trim();
|
||||
txtOLD_BJSLXX.Value = txtBJSLXX.Value.ToString().Trim();
|
||||
|
||||
# region 给调价因子控件赋值
|
||||
TDatabase dberp = TContextDatabases.GetDatabase("DBERP");
|
||||
TSQL sql = new TSQL(dberp);
|
||||
sql.Clear();
|
||||
sql.Add(string.Format(" select XLXSBJDYZZ{0}_YZID, XLXSBJDYZZ{0}_YZZ from XLXSBJDYZZ{0} ", "G"));
|
||||
sql.Add(string.Format(" where XLXSBJDYZZ{0}_JGBID=:pJGBID and XLXSBJDYZZ{0}_DTCLID=:pDTCLID ", "G"));
|
||||
sql.Add(string.Format(" and XLXSBJDYZZ{0}_DYDJID=:pDYDJID ", "G"));
|
||||
sql.Add(string.Format(" and XLXSBJDYZZ{0}_XXJGID=:pXXJGID ", "G"));
|
||||
sql.Add(string.Format(" and XLXSBJDYZZ{0}_ZXJMXX=:pZXJMXX and XLXSBJDYZZ{0}_ZXJMSX=:pZXJMSX ", "G"));
|
||||
sql.Add(string.Format(" and XLXSBJDYZZ{0}_BJSLXX=:pBJSLXX and XLXSBJDYZZ{0}_BJSLSX=:pBJSLSX ", "G"));
|
||||
sql.Add(string.Format(" order by XLXSBJDYZZ{0}_YZID", "G"));
|
||||
sql.ParamByName("pJGBID").Value = txtJGBID.Value.Trim();
|
||||
sql.ParamByName("pDTCLID").Value = cbxDTCLID.SelectedValue.Trim().Equals("") ? " " : cbxDTCLID.SelectedValue.Trim();
|
||||
sql.ParamByName("pDYDJID").Value = cbxDYDJID.SelectedValue.Trim().Equals("") ? " " : cbxDYDJID.SelectedValue.Trim();
|
||||
sql.ParamByName("pXXJGID").Value = txtXXJGID.Text.Trim().Equals("") ? " " : txtXXJGID.Text.Trim();
|
||||
sql.ParamByName("pZXJMSX").Value = txtZXJMSX.Value;
|
||||
sql.ParamByName("pZXJMXX").Value = txtZXJMXX.Value;
|
||||
sql.ParamByName("pBJSLSX").Value = txtBJSLSX.Value;
|
||||
sql.ParamByName("pBJSLXX").Value = txtBJSLXX.Value;
|
||||
DataSet ds = dberp.OpenDataSet(sql);
|
||||
for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
|
||||
{
|
||||
string sYZID = ds.Tables[0].Rows[i][0].ToString().Trim();
|
||||
double dYZZ = CMISproConvert.StrToFloat(ds.Tables[0].Rows[i][1].ToString().Trim());
|
||||
if (PageParam.GetRTrimString("TJYZList").Contains(sYZID + "|"))
|
||||
{
|
||||
for (int j = 1; j <= 20; j++)
|
||||
{
|
||||
string sTZYZID = "BJ" + j.ToString().PadLeft(2, '0');
|
||||
gtNumTextBox txtTJYZ = (gtNumTextBox)Master.ContentFormControl.FindControl("txt" + "TJYZ" + j.ToString().Trim());
|
||||
if (sYZID.Equals(sTZYZID))
|
||||
txtTJYZ.Value = dYZZ;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
protected override void OnNewRecorder()
|
||||
{
|
||||
base.OnNewRecorder();
|
||||
txtJGBID.Value = PageParam.GetRTrimString("XLXSBJDYZZG_JGBID");
|
||||
txtWHR.Text = tSession.UserName;
|
||||
txtWHRID.Value = tSession.UserId;
|
||||
datWHSJ.Text = CMISproConvert.ConvertTime(System.DateTime.Now);
|
||||
|
||||
}
|
||||
protected override void OnCopyRecorder()
|
||||
{
|
||||
base.OnCopyRecorder();
|
||||
txtJGBID.Value = PageParam.GetRTrimString("XLXSBJDYZZG_JGBID");
|
||||
txtWHR.Text = tSession.UserName;
|
||||
txtWHRID.Value = tSession.UserId;
|
||||
datWHSJ.Text = CMISproConvert.ConvertTime(System.DateTime.Now);
|
||||
}
|
||||
protected override bool DataLogicValid()
|
||||
{
|
||||
if (!base.DataLogicValid()) return false;
|
||||
if (cbxDYDJID.SelectedValue.Trim().Equals(""))
|
||||
{
|
||||
ShowMessage("电压等级不允许为空!");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (txtXXJGID.Text.Trim().Equals(""))
|
||||
{
|
||||
ShowMessage("芯线结构不允许为空!");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (txtZXJMXX.Value < 0)
|
||||
{
|
||||
ShowMessage("主芯截面下限--不允许为负数!");
|
||||
return false;
|
||||
}
|
||||
if (txtZXJMSX.Value < 0)
|
||||
{
|
||||
ShowMessage("主芯截面上限--不允许为负数!");
|
||||
return false;
|
||||
}
|
||||
if (txtZXJMSX.Value != 0)
|
||||
{
|
||||
if (txtZXJMXX.Value > txtZXJMSX.Value)
|
||||
{
|
||||
ShowMessage("主芯截面下限不允许超过主芯截面上限!");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (txtBJSLXX.Value < 0)
|
||||
{
|
||||
ShowMessage("报价数量下限--不允许为负数!");
|
||||
return false;
|
||||
}
|
||||
if (txtBJSLSX.Value < 0)
|
||||
{
|
||||
ShowMessage("报价数量上限--不允许为负数!");
|
||||
return false;
|
||||
}
|
||||
if (txtBJSLSX.Value != 0)
|
||||
{
|
||||
if (txtBJSLXX.Value > txtBJSLSX.Value)
|
||||
{
|
||||
ShowMessage("报价数量下限不允许超过报价数量上限!");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
TDatabase dberp = TContextDatabases.GetDatabase("DBERP");
|
||||
TSQL sql = new TSQL(dberp);
|
||||
string[] sTJYZList = PageParam.GetRTrimString("TJYZList").Split(',');
|
||||
for (int i = 0; i < sTJYZList.Length; i++)
|
||||
{
|
||||
if (ControlState == TControlState.ctsInsert || ControlState == TControlState.ctsCopy)
|
||||
{
|
||||
sql.Clear();
|
||||
sql.Add("select XLXSBJDYZZG_DTCLID,XLXSBJDYZZG_XXJGID, XLXSBJDYZZG_DYDJID, XLXSBJDYZZG_ZXJMXX,XLXSBJDYZZG_ZXJMSX, XLXSBJDYZZG_BJSLXX,XLXSBJDYZZG_BJSLSX ");
|
||||
sql.Add("from XLXSBJDYZZG ");
|
||||
sql.Add("where XLXSBJDYZZG_JGBID=:pJGBID and XLXSBJDYZZG_YZID=:pYZID ");
|
||||
sql.Add(" and XLXSBJDYZZG_DTCLID=:pDTCLID and XLXSBJDYZZG_DYDJID=:pDYDJID ");
|
||||
sql.Add(" and XLXSBJDYZZG_XXJGID=:pXXJGID ");
|
||||
sql.Add(" and ((XLXSBJDYZZG_ZXJMXX>=:pZXJMXX ");
|
||||
if (txtZXJMSX.Value != 0)
|
||||
{
|
||||
sql.Add(" and XLXSBJDYZZG_ZXJMXX<=:pZXJMSX ");
|
||||
}
|
||||
sql.Add(" ) ");
|
||||
sql.Add(" or (");
|
||||
if (txtZXJMSX.Value != 0)
|
||||
{
|
||||
sql.Add(" XLXSBJDYZZG_ZXJMSX>0 and XLXSBJDYZZG_ZXJMSX>=:pZXJMXX and XLXSBJDYZZG_ZXJMSX<=:pZXJMSX ");
|
||||
}
|
||||
else
|
||||
{
|
||||
sql.Add(" (XLXSBJDYZZG_ZXJMSX>0 and XLXSBJDYZZG_ZXJMSX>=:pZXJMXX) or (XLXSBJDYZZG_ZXJMSX=0) ");
|
||||
}
|
||||
sql.Add(" ) ");
|
||||
sql.Add(" or (XLXSBJDYZZG_ZXJMXX<=:pZXJMXX and (XLXSBJDYZZG_ZXJMSX=0 or XLXSBJDYZZG_ZXJMSX>=:pZXJMSX))");
|
||||
sql.Add(" ) ");
|
||||
|
||||
sql.Add(" and ((XLXSBJDYZZG_BJSLXX>=:pBJSLXX ");
|
||||
if (txtBJSLSX.Value != 0)
|
||||
{
|
||||
sql.Add(" and XLXSBJDYZZG_BJSLXX<:pBJSLSX ");
|
||||
}
|
||||
sql.Add(" ) ");
|
||||
sql.Add(" or (");
|
||||
if (txtBJSLSX.Value != 0)
|
||||
{
|
||||
sql.Add(" XLXSBJDYZZG_BJSLSX>0 and XLXSBJDYZZG_BJSLSX>:pBJSLXX and XLXSBJDYZZG_BJSLSX<=:pBJSLSX ");
|
||||
}
|
||||
else
|
||||
{
|
||||
sql.Add(" (XLXSBJDYZZG_BJSLSX>0 and XLXSBJDYZZG_BJSLSX>:pBJSLXX) or (XLXSBJDYZZG_BJSLSX=0) ");
|
||||
}
|
||||
sql.Add(" ) ");
|
||||
sql.Add(" or (XLXSBJDYZZG_BJSLXX<:pBJSLXX and (XLXSBJDYZZG_BJSLSX=0 or XLXSBJDYZZG_BJSLSX>:pBJSLSX))");
|
||||
sql.Add(" ) ");
|
||||
|
||||
sql.ParamByName("pJGBID").Value = txtJGBID.Value.Trim();
|
||||
sql.ParamByName("pYZID").Value = sTJYZList[i].Split('|')[0];
|
||||
sql.ParamByName("pDTCLID").Value = cbxDTCLID.SelectedValue.Trim().Equals("") ? " " : cbxDTCLID.SelectedValue.Trim();
|
||||
sql.ParamByName("pDYDJID").Value = cbxDYDJID.SelectedValue.Trim().Equals("") ? " " : cbxDYDJID.SelectedValue.Trim();
|
||||
sql.ParamByName("pXXJGID").Value = txtXXJGID.Text.Trim().Equals("") ? " " : txtXXJGID.Text.Trim();
|
||||
|
||||
sql.ParamByName("pZXJMXX").Value = txtZXJMXX.Value;
|
||||
if (txtZXJMSX.Value != 0)
|
||||
{
|
||||
sql.ParamByName("pZXJMSX").Value = txtZXJMSX.Value;
|
||||
}
|
||||
sql.ParamByName("pBJSLXX").Value = txtBJSLXX.Value;
|
||||
if (txtBJSLSX.Value != 0)
|
||||
{
|
||||
sql.ParamByName("pBJSLSX").Value = txtBJSLSX.Value;
|
||||
}
|
||||
DataSet ds = dberp.OpenDataSet(sql);
|
||||
if (ds.Tables[0].Rows.Count > 0)
|
||||
{
|
||||
string sZXJMQJ = "";
|
||||
string sXZXJMQJ = "";
|
||||
string sResult = "(导体材料:" + ds.Tables[0].Rows[0]["XLXSBJDYZZG_DTCLID"].ToString().Trim() + ",电压等级:" + ds.Tables[0].Rows[0]["XLXSBJDYZZG_DYDJID"].ToString().Trim()
|
||||
+ ",芯线结构:" + ds.Tables[0].Rows[0]["XLXSBJDYZZG_XXJGID"].ToString().Trim() + ")";
|
||||
if (CMISproConvert.StrToFloat(ds.Tables[0].Rows[0]["XLXSBJDYZZG_ZXJMSX"].ToString()) != 0)
|
||||
sZXJMQJ = ds.Tables[0].Rows[0]["XLXSBJDYZZG_ZXJMXX"].ToString().Trim() + "~" + ds.Tables[0].Rows[0]["XLXSBJDYZZG_ZXJMSX"].ToString().Trim();
|
||||
else
|
||||
sZXJMQJ = ds.Tables[0].Rows[0]["XLXSBJDYZZG_ZXJMXX"].ToString().Trim() + "~" + "--";
|
||||
if (txtZXJMSX.Value != 0)
|
||||
sXZXJMQJ = txtZXJMXX.Value.ToString().Trim() + "~" + txtZXJMSX.Value.ToString().Trim();
|
||||
else
|
||||
sXZXJMQJ = txtZXJMXX.Value.ToString().Trim() + "~" + "--";
|
||||
|
||||
string sBJSLQJ = "";
|
||||
if (CMISproConvert.StrToFloat(ds.Tables[0].Rows[0]["XLXSBJDYZZG_BJSLSX"].ToString()) != 0)
|
||||
sBJSLQJ = ds.Tables[0].Rows[0]["XLXSBJDYZZG_BJSLXX"].ToString().Trim() + "~" + ds.Tables[0].Rows[0]["XLXSBJDYZZG_BJSLSX"].ToString().Trim() + lblBJSLDW.Text.Trim();
|
||||
else
|
||||
sBJSLQJ = ds.Tables[0].Rows[0]["XLXSBJDYZZG_BJSLXX"].ToString().Trim() + "~" + "--" + lblBJSLDW.Text.Trim();
|
||||
|
||||
|
||||
ShowMessage(string.Format("因子{1}与已有主芯截面区间【{0}】、报价数量区间【{3}】{2}的记录有交集,不允许保存!", sZXJMQJ, sTJYZList[i].Replace("(X)", ""), sResult, sBJSLQJ));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
sql.Clear();
|
||||
sql.Add("select XLXSBJDYZZG_DTCLID,XLXSBJDYZZG_XXJGID,XLXSBJDYZZG_DYDJID,XLXSBJDYZZG_ZXJMXX,XLXSBJDYZZG_ZXJMSX,XLXSBJDYZZG_BJSLXX,XLXSBJDYZZG_BJSLSX ");
|
||||
sql.Add("from XLXSBJDYZZG ");
|
||||
sql.Add("where XLXSBJDYZZG_JGBID=:pJGBID and XLXSBJDYZZG_YZID=:pYZID ");
|
||||
sql.Add(" and (XLXSBJDYZZG_ZXJMXX<>:pOLDZXJMXX or XLXSBJDYZZG_ZXJMSX<>:pOLDZXJMSX ");
|
||||
sql.Add(" or XLXSBJDYZZG_BJSLXX<>:pOLDBJSLXX or XLXSBJDYZZG_BJSLSX<>:pOLDBJSLSX ");
|
||||
sql.Add(" or XLXSBJDYZZG_DTCLID<>:pOLDDTCLID or XLXSBJDYZZG_DYDJID<>:pOLDDYDJID ");
|
||||
sql.Add(" or XLXSBJDYZZG_XXJGID<>:pOLDXXJGID )");
|
||||
sql.Add(" and ((XLXSBJDYZZG_ZXJMXX>=:pZXJMXX ");
|
||||
if (txtZXJMSX.Value != 0)
|
||||
{
|
||||
sql.Add(" and XLXSBJDYZZG_ZXJMXX<=:pZXJMSX ");
|
||||
}
|
||||
sql.Add(" ) ");
|
||||
sql.Add(" or (");
|
||||
if (txtZXJMSX.Value != 0)
|
||||
{
|
||||
sql.Add(" XLXSBJDYZZG_ZXJMSX>0 and XLXSBJDYZZG_ZXJMSX>=:pZXJMXX and XLXSBJDYZZG_ZXJMSX<=:pZXJMSX ");
|
||||
}
|
||||
else
|
||||
{
|
||||
sql.Add(" (XLXSBJDYZZG_ZXJMSX>0 and XLXSBJDYZZG_ZXJMSX>=:pZXJMXX) or (XLXSBJDYZZG_ZXJMSX=0) ");
|
||||
}
|
||||
sql.Add(" ) ");
|
||||
sql.Add(" or (XLXSBJDYZZG_ZXJMXX<=:pZXJMXX and (XLXSBJDYZZG_ZXJMSX=0 or XLXSBJDYZZG_ZXJMSX>=:pZXJMSX))");
|
||||
sql.Add(" ) ");
|
||||
sql.Add(" and ((XLXSBJDYZZG_BJSLXX>=:pBJSLXX ");
|
||||
if (txtBJSLSX.Value != 0)
|
||||
{
|
||||
sql.Add(" and XLXSBJDYZZG_BJSLXX<:pBJSLSX ");
|
||||
}
|
||||
sql.Add(" ) ");
|
||||
sql.Add(" or (");
|
||||
if (txtBJSLSX.Value != 0)
|
||||
{
|
||||
sql.Add(" XLXSBJDYZZG_BJSLSX>0 and XLXSBJDYZZG_BJSLSX>:pBJSLXX and XLXSBJDYZZG_BJSLSX<=:pBJSLSX ");
|
||||
}
|
||||
else
|
||||
{
|
||||
sql.Add(" (XLXSBJDYZZG_BJSLSX>0 and XLXSBJDYZZG_BJSLSX>:pBJSLXX) or (XLXSBJDYZZG_BJSLSX=0) ");
|
||||
}
|
||||
sql.Add(" ) ");
|
||||
sql.Add(" or (XLXSBJDYZZG_BJSLXX<:pBJSLXX and (XLXSBJDYZZG_BJSLSX=0 or XLXSBJDYZZG_BJSLSX>:pBJSLSX))");
|
||||
sql.Add(" ) ");
|
||||
sql.Add(" and ( XLXSBJDYZZG_DTCLID=:pDTCLID and XLXSBJDYZZG_DYDJID=:pDYDJID ");
|
||||
sql.Add(" and XLXSBJDYZZG_XXJGID=:pXXJGID )");
|
||||
sql.ParamByName("pJGBID").Value = txtJGBID.Value.Trim();
|
||||
sql.ParamByName("pYZID").Value = sTJYZList[i].Split('|')[0];
|
||||
sql.ParamByName("pOLDDTCLID").Value = txtOLD_DTCLID.Value.Trim().Equals("") ? " " : txtOLD_DTCLID.Value.Trim();
|
||||
sql.ParamByName("pOLDDYDJID").Value = txtOLD_DYDJID.Value.Trim().Equals("") ? " " : txtOLD_DYDJID.Value.Trim();
|
||||
sql.ParamByName("pOLDXXJGID").Value = txtOLD_XXJGID.Value.Trim().Equals("") ? " " : txtOLD_XXJGID.Value.Trim();
|
||||
|
||||
sql.ParamByName("pOLDZXJMXX").Value = txtOLD_ZXJMXX.Value;
|
||||
sql.ParamByName("pOLDZXJMSX").Value = txtOLD_ZXJMSX.Value;
|
||||
sql.ParamByName("pZXJMXX").Value = txtZXJMXX.Value;
|
||||
sql.ParamByName("pOLDBJSLXX").Value = txtOLD_BJSLXX.Value;
|
||||
sql.ParamByName("pOLDBJSLSX").Value = txtOLD_BJSLSX.Value;
|
||||
sql.ParamByName("pDTCLID").Value = cbxDTCLID.SelectedValue.Trim().Equals("") ? " " : cbxDTCLID.SelectedValue.Trim();
|
||||
sql.ParamByName("pDYDJID").Value = cbxDYDJID.SelectedValue.Trim().Equals("") ? " " : cbxDYDJID.SelectedValue.Trim();
|
||||
sql.ParamByName("pXXJGID").Value = txtXXJGID.Text.Trim().Equals("") ? " " : txtXXJGID.Text.Trim();
|
||||
sql.ParamByName("pBJSLXX").Value = txtBJSLXX.Value;
|
||||
if (txtBJSLSX.Value != 0)
|
||||
{
|
||||
sql.ParamByName("pBJSLSX").Value = txtBJSLSX.Value;
|
||||
}
|
||||
if (txtZXJMSX.Value != 0)
|
||||
{
|
||||
sql.ParamByName("pZXJMSX").Value = txtZXJMSX.Value;
|
||||
}
|
||||
DataSet ds = dberp.OpenDataSet(sql);
|
||||
if (ds.Tables[0].Rows.Count > 0)
|
||||
{
|
||||
string sZXJMQJ = "";
|
||||
string sResult = "(导体材料:" + ds.Tables[0].Rows[0]["XLXSBJDYZZG_DTCLID"].ToString().Trim() + ",电压等级:" + ds.Tables[0].Rows[0]["XLXSBJDYZZG_DYDJID"].ToString().Trim()
|
||||
+ ",芯线结构:" + ds.Tables[0].Rows[0]["XLXSBJDYZZG_XXJGID"].ToString().Trim() + ")";
|
||||
if (CMISproConvert.StrToFloat(ds.Tables[0].Rows[0]["XLXSBJDYZZG_ZXJMSX"].ToString()) != 0)
|
||||
sZXJMQJ = ds.Tables[0].Rows[0]["XLXSBJDYZZG_ZXJMXX"].ToString().Trim() + "~" + ds.Tables[0].Rows[0]["XLXSBJDYZZG_ZXJMSX"].ToString().Trim();
|
||||
else
|
||||
sZXJMQJ = ds.Tables[0].Rows[0]["XLXSBJDYZZG_ZXJMXX"].ToString().Trim() + "~" + "--";
|
||||
|
||||
string sBJSLQJ = "";
|
||||
if (CMISproConvert.StrToFloat(ds.Tables[0].Rows[0]["XLXSBJDYZZG_BJSLSX"].ToString()) != 0)
|
||||
sBJSLQJ = ds.Tables[0].Rows[0]["XLXSBJDYZZG_BJSLXX"].ToString().Trim() + "~" + ds.Tables[0].Rows[0]["XLXSBJDYZZG_BJSLSX"].ToString().Trim() + lblBJSLDW.Text.Trim();
|
||||
else
|
||||
sBJSLQJ = ds.Tables[0].Rows[0]["XLXSBJDYZZG_BJSLXX"].ToString().Trim() + "~" + "--" + lblBJSLDW.Text.Trim();
|
||||
|
||||
ShowMessage(string.Format("因子{1}与已有主芯截面区间【{0}】、报价数量区间【{3}】{2}的记录有交集,不允许保存!", sZXJMQJ, sTJYZList[i].Replace("(X)", ""), sResult, sBJSLQJ));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
protected override bool Master_BeforeDeleteAction(object sender, EventArgs e)
|
||||
{
|
||||
string sYZIDlist = TZYZBJAInfo.GetYZIDList(PageParam.GetRTrimString("TJYZList"));
|
||||
entity.EntityTable.DeleteSql = " delete from XLXSBJDYZZG where XLXSBJDYZZG_JGBID =:XLXSBJDYZZG_JGBID "
|
||||
+ " and XLXSBJDYZZG_DTCLID=:XLXSBJDYZZG_DTCLID and XLXSBJDYZZG_DYDJID=isnull(:XLXSBJDYZZG_DYDJID,' ') and XLXSBJDYZZG_XXJGID=isnull(:XLXSBJDYZZG_XXJGID,' ') "
|
||||
+ " and XLXSBJDYZZG_ZXJMSX=:XLXSBJDYZZG_ZXJMSX and XLXSBJDYZZG_ZXJMXX=:XLXSBJDYZZG_ZXJMXX and XLXSBJDYZZG_BJSLSX=:XLXSBJDYZZG_BJSLSX and XLXSBJDYZZG_BJSLXX=:XLXSBJDYZZG_BJSLXX and "
|
||||
+ CMISproDataBase.GetWhereEqual("XLXSBJDYZZG_YZID", sYZIDlist);
|
||||
return base.Master_BeforeDeleteAction(sender, e);
|
||||
}
|
||||
protected override bool Master_BeforeSaveAction(object sender, EventArgs e)
|
||||
{
|
||||
if (!base.Master_BeforeSaveAction(sender, e)) return false;
|
||||
|
||||
string sYZIDlist = TZYZBJAInfo.GetYZIDList(PageParam.GetRTrimString("TJYZList"));
|
||||
entity.EntityTable.UpdateSql = " update XLXSBJDYZZG "
|
||||
+ " set XLXSBJDYZZG_JGBID = :XLXSBJDYZZG_JGBID, "
|
||||
+ " XLXSBJDYZZG_DTCLID=isnull(:XLXSBJDYZZG_DTCLID,' '), XLXSBJDYZZG_DYDJID=isnull(:XLXSBJDYZZG_DYDJID,' '), XLXSBJDYZZG_XXJGID=isnull(:XLXSBJDYZZG_XXJGID,' '), "
|
||||
+ " XLXSBJDYZZG_ZXJMSX=isnull(:XLXSBJDYZZG_ZXJMSX,0), XLXSBJDYZZG_ZXJMXX=isnull(:XLXSBJDYZZG_ZXJMXX,0), XLXSBJDYZZG_BJSLSX=isnull(:XLXSBJDYZZG_BJSLSX,0), XLXSBJDYZZG_BJSLXX=isnull(:XLXSBJDYZZG_BJSLXX,0),XLXSBJDYZZG_YZZ=isnull(:XLXSBJDYZZG_YZZ,0), "
|
||||
+ " XLXSBJDYZZG_WHR=:XLXSBJDYZZG_WHR, XLXSBJDYZZG_WHRID=:XLXSBJDYZZG_WHRID, XLXSBJDYZZG_WHSJ=:XLXSBJDYZZG_WHSJ "
|
||||
+ " where XLXSBJDYZZG_JGBID =:XLXSBJDYZZG_JGBID "
|
||||
+ " and XLXSBJDYZZG_DTCLID =:OLD_XLXSBJDYZZG_DTCLID and XLXSBJDYZZG_DYDJID=:OLD_XLXSBJDYZZG_DYDJID and XLXSBJDYZZG_XXJGID=:OLD_XLXSBJDYZZG_XXJGID "
|
||||
+ "and XLXSBJDYZZG_ZXJMSX=:OLD_XLXSBJDYZZG_ZXJMSX and XLXSBJDYZZG_ZXJMXX=:OLD_XLXSBJDYZZG_ZXJMXX and XLXSBJDYZZG_BJSLSX=:OLD_XLXSBJDYZZG_BJSLSX and XLXSBJDYZZG_BJSLXX=:OLD_XLXSBJDYZZG_BJSLXX and " + CMISproDataBase.GetWhereEqual("XLXSBJDYZZG_YZID", sYZIDlist);
|
||||
txtWHR.Text = tSession.UserName;
|
||||
txtWHRID.Value = tSession.UserId;
|
||||
datWHSJ.Text = CMISproConvert.ConvertTime(System.DateTime.Now);
|
||||
|
||||
return true;
|
||||
}
|
||||
protected override bool Master_AfterSaveAction(object sender, EventArgs e)
|
||||
{
|
||||
txtOLD_DTCLID.Value = cbxDTCLID.SelectedValue.Trim().Equals("") ? " " : cbxDTCLID.SelectedValue.Trim();
|
||||
txtOLD_DYDJID.Value = cbxDYDJID.SelectedValue.Trim().Equals("") ? " " : cbxDYDJID.SelectedValue.Trim();
|
||||
txtOLD_XXJGID.Value = txtXXJGID.Text.Trim().Equals("") ? " " : txtXXJGID.Text.Trim();
|
||||
|
||||
txtOLD_ZXJMSX.Value = txtZXJMSX.Value.ToString().Trim();
|
||||
txtOLD_ZXJMXX.Value = txtZXJMXX.Value.ToString().Trim();
|
||||
txtOLD_BJSLXX.Value = txtBJSLXX.Value.ToString().Trim();
|
||||
txtOLD_BJSLSX.Value = txtBJSLSX.Value.ToString().Trim();
|
||||
|
||||
|
||||
txtYZID.Value = PageParam.GetRTrimString("FirstYZID");
|
||||
|
||||
string sJGBID = txtJGBID.Value.Trim();
|
||||
string sDTCLID = cbxDTCLID.SelectedValue.Trim().Equals("") ? " " : cbxDTCLID.SelectedValue.Trim();
|
||||
string sDYDJID = cbxDYDJID.SelectedValue.Trim().Equals("") ? " " : cbxDYDJID.SelectedValue.Trim();
|
||||
string sXXJGID = txtXXJGID.Text.Trim().Equals("") ? " " : txtXXJGID.Text.Trim();
|
||||
|
||||
|
||||
# region 将调价因子控件值更新至数据库中
|
||||
TDatabase dberp = TContextDatabases.GetDatabase("DBERP");
|
||||
TSQL sql = new TSQL(dberp);
|
||||
sql.Clear();
|
||||
string sYZIDlist = TZYZBJAInfo.GetYZIDList(PageParam.GetRTrimString("TJYZList"));
|
||||
dberp.ExecSQL(string.Format("delete from XLXSBJDYZZ{0} where XLXSBJDYZZ{0}_JGBID='{1}' and XLXSBJDYZZ{0}_DTCLID='{2}' and XLXSBJDYZZ{0}_DYDJID='{3}' and XLXSBJDYZZ{0}_XXJGID='{8}' "
|
||||
+ " and XLXSBJDYZZ{0}_ZXJMSX={4} and XLXSBJDYZZ{0}_ZXJMXX={5} and XLXSBJDYZZ{0}_BJSLSX={6} and XLXSBJDYZZ{0}_BJSLXX={7} and " + CMISproDataBase.GetWhereEqual("XLXSBJDYZZ{0}_YZID", sYZIDlist)
|
||||
, "G", sJGBID, sDTCLID, sDYDJID, txtZXJMSX.Value, txtZXJMXX.Value, txtBJSLSX.Value, txtBJSLXX.Value,sXXJGID));
|
||||
|
||||
string[] sTJYZList = PageParam.GetRTrimString("TJYZList").Split(',');
|
||||
DateTime tNow = DateTime.Now;
|
||||
for (int i = 0; i < sTJYZList.Length; i++)
|
||||
{
|
||||
sql.Clear();
|
||||
sql.Add(string.Format("insert into XLXSBJDYZZ{0}(XLXSBJDYZZ{0}_JGBID, XLXSBJDYZZ{0}_DTCLID, XLXSBJDYZZ{0}_XXJGID,XLXSBJDYZZ{0}_DYDJID,XLXSBJDYZZ{0}_ZXJMSX,XLXSBJDYZZ{0}_ZXJMXX, XLXSBJDYZZ{0}_BJSLSX, XLXSBJDYZZ{0}_BJSLXX, ", "G"));
|
||||
sql.Add(string.Format(" XLXSBJDYZZ{0}_YZID, XLXSBJDYZZ{0}_YZZ, XLXSBJDYZZ{0}_WHR, XLXSBJDYZZ{0}_WHRID, XLXSBJDYZZ{0}_WHSJ)", "G"));
|
||||
sql.Add(string.Format(" values(:pJGBID,:pDTCLID,:pXXJGID, :pDYDJID,:pZXJMSX,:pZXJMXX,:pBJSLSX,:pBJSLXX,:pYZID,:pYZZ,:pWHR,:pWHRID,:pWHSJ)"));
|
||||
sql.ParamByName("pJGBID").Value = sJGBID;
|
||||
sql.ParamByName("pDTCLID").Value = sDTCLID;
|
||||
sql.ParamByName("pDYDJID").Value = sDYDJID;
|
||||
sql.ParamByName("pXXJGID").Value = sXXJGID;
|
||||
sql.ParamByName("pZXJMSX").Value = txtZXJMSX.Value.ToString().Trim();
|
||||
sql.ParamByName("pZXJMXX").Value = txtZXJMXX.Value.ToString().Trim();
|
||||
sql.ParamByName("pBJSLSX").Value = txtBJSLSX.Value.ToString().Trim();
|
||||
sql.ParamByName("pBJSLXX").Value = txtBJSLXX.Value.ToString().Trim();
|
||||
sql.ParamByName("pWHR").Value = tSession.UserName;
|
||||
sql.ParamByName("pWHRID").Value = tSession.UserId;
|
||||
sql.ParamByName("pWHSJ").Value = tNow;
|
||||
|
||||
for (int j = 1; j <= 20; j++)
|
||||
{
|
||||
string sTZYZID = "BJ" + j.ToString().PadLeft(2, '0') + "|";
|
||||
gtNumTextBox txtTJYZ = (gtNumTextBox)Master.ContentFormControl.FindControl("txt" + "TJYZ" + j.ToString().Trim());
|
||||
if (sTJYZList[i].StartsWith(sTZYZID))
|
||||
{
|
||||
sql.ParamByName("pYZID").Value = sTZYZID.TrimEnd('|');
|
||||
sql.ParamByName("pYZZ").Value = txtTJYZ.Value;
|
||||
dberp.ExecSQL(sql);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
return base.Master_AfterSaveAction(sender, e);
|
||||
}
|
||||
protected override void SetComboxItems()
|
||||
{
|
||||
TComboBox.SetComboBox("DBERP", cbxDTCLID, "select XLDTCLB_DTCLID,XLDTCLB_WLMC from XLDTCLB where XLDTCLB_WLID =' ' order by XLDTCLB_DTCLID ", false);
|
||||
TComboBox.SetComboBox("DBERP", cbxDYDJID, "select XLDYDJB_DYDJID as ID,XLDYDJB_DYDJID as Name from XLDYDJB where isnull(XLDYDJB_TYBZ,'N')<>'Y' order by XLDYDJB_XH ", true);
|
||||
base.SetComboxItems();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 自定义函数
|
||||
private void InitControls()
|
||||
{
|
||||
txtYZID.Value = PageParam.GetRTrimString("FirstYZID");
|
||||
}
|
||||
private void SetTJYZLable()
|
||||
{
|
||||
string[] sTJYZList = PageParam.GetRTrimString("TJYZList").Split(',');
|
||||
for (int i = 0; i < sTJYZList.Length; i++)
|
||||
{
|
||||
|
||||
for (int j = 1; j <= 20; j++)
|
||||
{
|
||||
string sTZYZID = "BJ" + j.ToString().PadLeft(2, '0') + "|";
|
||||
gtNumTextBox txtTJYZ = (gtNumTextBox)Master.ContentFormControl.FindControl("txt" + "TJYZ" + j.ToString().Trim());
|
||||
gtLabel lblTJYZ = (gtLabel)Master.ContentFormControl.FindControl("lbl" + "TJYZ" + j.ToString().Trim());
|
||||
if (sTJYZList[i].StartsWith(sTZYZID))
|
||||
{
|
||||
string s = sTJYZList[i].Replace(sTZYZID, "").Replace("(X)", "") + ":";
|
||||
lblTJYZ.Text = s;
|
||||
if (sTJYZList[i].EndsWith("(%)") || sTJYZList[i].EndsWith("(元)"))
|
||||
{
|
||||
txtTJYZ.DecimalPlaces = 2;
|
||||
}
|
||||
else if (sTJYZList[i].EndsWith("(X)"))
|
||||
{
|
||||
txtTJYZ.DecimalPlaces = 4;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user