915 lines
32 KiB
C#
915 lines
32 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_CONTROL;
|
||
using GThinking.N_PUBLIC;
|
||
using GThinking.N_MISPRO.Caching;
|
||
using GThinking.N_MISPRO.Utility;
|
||
|
||
namespace GThinking.N_XLXSBJ
|
||
{
|
||
[TableMap(DB = "DBERP", DbTableName = "XLXSTZYZ", Umid = 100860000, IsWorkFlow = false)]
|
||
public class XLBJD_MX_YZS : EntityManager
|
||
{
|
||
|
||
}
|
||
|
||
|
||
|
||
public partial class XLBJD_MX_YZSInfo : SingleCardBase
|
||
{
|
||
XLBJD_MX_YZS entity = new XLBJD_MX_YZS();
|
||
|
||
protected void Page_Load(object sender, EventArgs e)
|
||
{
|
||
this.UMID = 100860000;
|
||
this.UMName = "线缆销售报价单";
|
||
base.CurMaster = Master;
|
||
base.CurEntity = entity;
|
||
this.PageHeight = 400;
|
||
this.PageWidth = 500;
|
||
Master.EnableAttachBtn = false;
|
||
Master.EnableCancelBtn = false;
|
||
Master.EnableCopyBtn = false;
|
||
Master.EnableDeleteBtn = false;
|
||
Master.EnableEditBtn = false;
|
||
Master.EnableInsertBtn = false;
|
||
Master.EnablePrintBtn = false;
|
||
Master.EnableRefreshBtn = false;
|
||
Master.EnableSaveBtn = false;
|
||
|
||
base.InitPage();
|
||
|
||
if (!IsPostBack)
|
||
{
|
||
InitControl();
|
||
}
|
||
}
|
||
|
||
protected override void SetControlState()
|
||
{
|
||
base.SetControlState();
|
||
}
|
||
|
||
#region 自定义函数
|
||
|
||
private void InitControl()
|
||
{
|
||
cbxTJFW.ClearItems();
|
||
if (PageParam.GetRTrimString("PLSZAll").Equals("N"))
|
||
cbxTJFW.Items.Add(new ListItem("勾选记录", "N"));
|
||
cbxTJFW.Items.Add(new ListItem("整单记录", "Y"));
|
||
if (cbxTJFW.ItemsCount == 1)
|
||
cbxTJFW.SelectedIndex = 0;
|
||
|
||
string sPLTJKXX = XLBJDUtils.GetPLTJKXX();
|
||
if (!sPLTJKXX.Contains(",BJXF,"))
|
||
{
|
||
chkBJXF.Style["display"] = "none";
|
||
txtBJXFYZZ.Style["display"] = "none";
|
||
lblBJXFYZZ.Style["display"] = "none";
|
||
|
||
}
|
||
if (!sPLTJKXX.Contains(",BJSF,"))
|
||
{
|
||
chkBJSF.Style["display"] = "none";
|
||
txtBJSFYZZ.Style["display"] = "none";
|
||
lblBJSFYZZ.Style["display"] = "none";
|
||
}
|
||
if (!sPLTJKXX.Contains(",BJXF,") && !sPLTJKXX.Contains(",BJSF,"))
|
||
{
|
||
tr1.Style["display"] = "none";
|
||
tr2.Style["display"] = "none";
|
||
}
|
||
|
||
TDatabase dberp = TContextDatabases.GetDatabase("DBERP");
|
||
TSQL SQL = new TSQL(dberp);
|
||
string sBJFLID = PageParam.GetRTrimString("BJFLID");
|
||
|
||
string sYZWPIDList = PageParam.GetRTrimString("YZWPIDList");
|
||
string sReadOnlyYZ = PageParam.GetRTrimString("ReadOnlyYZ");
|
||
string sZDWPIDList = PageParam.GetRTrimString("ZDWPIDList");
|
||
string sWPID = PageParam.GetRTrimString("WPID");
|
||
string sJGBBJBM = string.IsNullOrEmpty(PageParam.GetRTrimString("JGBBJBM")) ? "表价" : PageParam.GetRTrimString("JGBBJBM");
|
||
|
||
string[] sReadOnly = sReadOnlyYZ.Split(new Char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
|
||
string[] sZDWPIDs = sZDWPIDList.Split(new Char[] { ';' }, StringSplitOptions.RemoveEmptyEntries);
|
||
|
||
|
||
trYZZ01.Style["display"] = "none";
|
||
trYZZ02.Style["display"] = "none";
|
||
trYZZ03.Style["display"] = "none";
|
||
trYZZ04.Style["display"] = "none";
|
||
trYZZ05.Style["display"] = "none";
|
||
trYZZ06.Style["display"] = "none";
|
||
trYZZ07.Style["display"] = "none";
|
||
trYZZ08.Style["display"] = "none";
|
||
trYZZ09.Style["display"] = "none";
|
||
trYZZ10.Style["display"] = "none";
|
||
trYZZ11.Style["display"] = "none";
|
||
trYZZ12.Style["display"] = "none";
|
||
trYZZ13.Style["display"] = "none";
|
||
trYZZ14.Style["display"] = "none";
|
||
trYZZ15.Style["display"] = "none";
|
||
trYZZ16.Style["display"] = "none";
|
||
trYZZ17.Style["display"] = "none";
|
||
trYZZ18.Style["display"] = "none";
|
||
trYZZ19.Style["display"] = "none";
|
||
trYZZ20.Style["display"] = "none";
|
||
SQL.Clear();
|
||
SQL.Add("select XLXSBJFLYZ_YZID,XLXSTZYZ_YZMC,XLXSTZYZ_MRTJFW,XLXSTZYZ_JJFS,isnull(XLXSTZYZ_BCYTJ,'N') as XLXSTZYZ_BCYTJ from XLXSBJFLYZ");
|
||
SQL.Add(" left join XLXSTZYZ on XLXSTZYZ_MXBH='BJD' and XLXSTZYZ_YZID=XLXSBJFLYZ_YZID");
|
||
SQL.Add(" where XLXSBJFLYZ_BJFLID=:pBJFLID");
|
||
//只取调价因素为空的、调价模块为空的,而且需要过滤不参与调价的因子
|
||
SQL.Add(" and isnull(XLXSTZYZ_TJYS,' ') = ' ' and XLXSTZYZ_TJMDID=0 and isnull(XLXSTZYZ_BCYTJ,'N') <> 'Y'");
|
||
SQL.Add(" and (isnull(XLXSTZYZ_YZZZD, 'N')='N' or ");
|
||
SQL.Add(" ( isnull(XLXSTZYZ_YZZZD, 'N')='Y' and isnull(XLXSTZYZ_ZDWPIDLIST,' ')<>' ' and ','||rtrim(isnull(XLXSTZYZ_ZDWPIDLIST,' '))||',' not like :pCurWPID ) ");
|
||
SQL.Add(" ) ");
|
||
SQL.Add(" order by XLXSTZYZ_XSXH,XLXSTZYZ_YZID");
|
||
SQL.ParamByName("pBJFLID").Value = sBJFLID;
|
||
SQL.ParamByName("pCurWPID").Value = "%," + sWPID + ",%";
|
||
DataSet ds = dberp.OpenDataSet(SQL);
|
||
for (int i = 1; i <= ds.Tables[0].Rows.Count; i++)
|
||
{
|
||
|
||
string sYZID = ds.Tables[0].Rows[i-1]["XLXSBJFLYZ_YZID"].ToString().Trim();
|
||
string sYZMC = ds.Tables[0].Rows[i-1]["XLXSTZYZ_YZMC"].ToString().Trim();
|
||
string sJJFS = ds.Tables[0].Rows[i-1]["XLXSTZYZ_JJFS"].ToString().Trim();
|
||
string sMRTJFW = "," + ds.Tables[0].Rows[i - 1]["XLXSTZYZ_MRTJFW"].ToString().Trim() + ",";
|
||
//System.Web.UI.HtmlControls.HtmlTableRow trYZZ = FindControl("trYZZ" + i.ToString().PadLeft(2, '0')) as HtmlTableRow;
|
||
gtCheckBox chkYZZ = (gtCheckBox)Master.ContentFormControl.FindControl("chkYZZ" + i.ToString().PadLeft(2, '0'));
|
||
gtNumTextBox txtYZZ = (gtNumTextBox)Master.ContentFormControl.FindControl("txtYZZ" + i.ToString().PadLeft(2, '0'));
|
||
gtLabel lblYZZ = (gtLabel)Master.ContentFormControl.FindControl("lblYZZ" + i.ToString().PadLeft(2, '0'));
|
||
HiddenField txtYZID = (HiddenField)Master.ContentFormControl.FindControl("txtYZID" + i.ToString().PadLeft(2, '0'));
|
||
HtmlTableRow trYZZ = (HtmlTableRow)Master.ContentFormControl.FindControl("trYZZ" + i.ToString().PadLeft(2, '0'));
|
||
gtCheckBox chkYBJ = (gtCheckBox)Master.ContentFormControl.FindControl("chkYBJ" + i.ToString().PadLeft(2, '0'));
|
||
gtCheckBox chkWG = (gtCheckBox)Master.ContentFormControl.FindControl("chkWG" + i.ToString().PadLeft(2, '0'));
|
||
gtCheckBox chkFWG = (gtCheckBox)Master.ContentFormControl.FindControl("chkFWG" + i.ToString().PadLeft(2, '0'));
|
||
//界面的因子按照查询的因子排序,名称不是一一对应的关系
|
||
trYZZ.Style["display"] = "block";
|
||
txtYZID.Value = sYZID;
|
||
chkYZZ.Text = sYZMC + ":";
|
||
if (sJJFS.Equals("JD") || sJJFS.Equals("KD") || sJJFS.Equals("SX") || sJJFS.Equals("DD") || sJJFS.Equals("MD") || sJJFS.Equals("MP"))
|
||
{
|
||
lblYZZ.Text = "%";
|
||
}
|
||
else if (sJJFS.Equals("JJ"))
|
||
{
|
||
if (XLBJDUtils.GetYZXXByYZID(sYZID).XLXSTZYZ_TJLX == "1")
|
||
lblYZZ.Text = "元";
|
||
}
|
||
else if (sJJFS.Equals("MX") || sJJFS.Equals("DX"))
|
||
{
|
||
txtYZZ.DecimalPlaces = 4;
|
||
}
|
||
txtYZZ.Enabled = false;
|
||
if (sMRTJFW.Contains(",1,"))
|
||
chkYBJ.Checked = true;
|
||
if (sMRTJFW.Contains(",2,"))
|
||
chkWG.Checked = true;
|
||
if (sMRTJFW.Contains(",3,"))
|
||
chkFWG.Checked = true;
|
||
chkYBJ.Text = "有" + sJGBBJBM;
|
||
}
|
||
txtBJXFYZZ.Enabled = false;
|
||
txtBJSFYZZ.Enabled = false;
|
||
|
||
//上浮
|
||
string sBJSFTJFS = XLBJDUtils.GetBJSFTJFS();
|
||
if (sBJSFTJFS.Equals("UM"))
|
||
chkBJSF.Text = "报价上浮:新报价=原报价*(1+";
|
||
else
|
||
chkBJSF.Text = "报价上浮:新报价=原报价/(1-";
|
||
|
||
//下浮
|
||
string sBJXFTJFS = XLBJDUtils.GetBJXFTJFS();
|
||
if (sBJXFTJFS.Equals("DD"))
|
||
chkBJXF.Text = "报价下浮:新报价=原报价/(1+";
|
||
else
|
||
chkBJXF.Text = "报价下浮:新报价=原报价*(1-";
|
||
}
|
||
private double GetDefYZZ(string sYZID)
|
||
{
|
||
double sDefYZZ = 0;
|
||
TDatabase dberp = TContextDatabases.GetDatabase("DBERP");
|
||
TSQL SQL = new TSQL(dberp);
|
||
SQL.Add("select XLXSBJDYZZ_YZZ from XLXSTZYZ");
|
||
SQL.Add(" left join XLXSBJDYZZ on XLXSBJDYZZ_JGBID=XLXSTZYZ_JGBID and XLXSBJDYZZ_YZID=XLXSTZYZ_YZID");
|
||
SQL.Add(" where XLXSTZYZ_MXBH='BJD' and XLXSTZYZ_YZID=:pYZID ");
|
||
SQL.ParamByName("pYZID").Value = sYZID;
|
||
DataSet ds = dberp.OpenDataSet(SQL);
|
||
if (ds.Tables[0].Rows.Count > 0)
|
||
{
|
||
sDefYZZ = CMISproConvert.StrToFloat(ds.Tables[0].Rows[0]["XLXSBJDYZZ_YZZ"].ToString().Trim());
|
||
}
|
||
return sDefYZZ;
|
||
}
|
||
|
||
#endregion
|
||
#region 勾选框点击事件
|
||
//下浮
|
||
protected void chkBJXF_OnCheckedChanged(object sender, EventArgs e)
|
||
{
|
||
if (chkBJXF.Checked)
|
||
{
|
||
txtBJXFYZZ.Enabled = true;
|
||
}
|
||
else
|
||
{
|
||
txtBJXFYZZ.Value = 0;
|
||
txtBJXFYZZ.Enabled = false;
|
||
}
|
||
}
|
||
|
||
//上浮
|
||
protected void chkBJSF_OnCheckedChanged(object sender, EventArgs e)
|
||
{
|
||
if (chkBJSF.Checked)
|
||
{
|
||
txtBJSFYZZ.Enabled = true;
|
||
}
|
||
else
|
||
{
|
||
txtBJSFYZZ.Value = 0;
|
||
txtBJSFYZZ.Enabled = false;
|
||
}
|
||
|
||
}
|
||
|
||
//因子值01
|
||
protected void chkYZZ01_OnCheckedChanged(object sender, EventArgs e)
|
||
{
|
||
if (chkYZZ01.Checked)
|
||
{
|
||
txtYZZ01.Enabled = true;
|
||
txtYZZ01.Value = GetDefYZZ(txtYZID01.Value);
|
||
}
|
||
else
|
||
{
|
||
txtYZZ01.Value = 0;
|
||
txtYZZ01.Enabled = false;
|
||
}
|
||
}
|
||
//因子值02
|
||
protected void chkYZZ02_OnCheckedChanged(object sender, EventArgs e)
|
||
{
|
||
if (chkYZZ02.Checked)
|
||
{
|
||
txtYZZ02.Enabled = true;
|
||
txtYZZ02.Value = GetDefYZZ(txtYZID02.Value);
|
||
}
|
||
else
|
||
{
|
||
txtYZZ02.Value = 0;
|
||
txtYZZ02.Enabled = false;
|
||
}
|
||
}
|
||
//因子值03
|
||
protected void chkYZZ03_OnCheckedChanged(object sender, EventArgs e)
|
||
{
|
||
if (chkYZZ03.Checked)
|
||
{
|
||
txtYZZ03.Enabled = true;
|
||
txtYZZ03.Value = GetDefYZZ(txtYZID03.Value);
|
||
}
|
||
else
|
||
{
|
||
txtYZZ03.Value = 0;
|
||
txtYZZ03.Enabled = false;
|
||
}
|
||
}
|
||
//因子值04
|
||
protected void chkYZZ04_OnCheckedChanged(object sender, EventArgs e)
|
||
{
|
||
if (chkYZZ04.Checked)
|
||
{
|
||
txtYZZ04.Enabled = true;
|
||
txtYZZ04.Value = GetDefYZZ(txtYZID04.Value);
|
||
}
|
||
else
|
||
{
|
||
txtYZZ04.Value = 0;
|
||
txtYZZ04.Enabled = false;
|
||
}
|
||
}
|
||
//因子值05
|
||
protected void chkYZZ05_OnCheckedChanged(object sender, EventArgs e)
|
||
{
|
||
if (chkYZZ05.Checked)
|
||
{
|
||
txtYZZ05.Enabled = true;
|
||
txtYZZ05.Value = GetDefYZZ(txtYZID05.Value);
|
||
}
|
||
else
|
||
{
|
||
txtYZZ05.Value = 0;
|
||
txtYZZ05.Enabled = false;
|
||
}
|
||
}
|
||
//因子值06
|
||
protected void chkYZZ06_OnCheckedChanged(object sender, EventArgs e)
|
||
{
|
||
if (chkYZZ06.Checked)
|
||
{
|
||
txtYZZ06.Enabled = true;
|
||
txtYZZ06.Value = GetDefYZZ(txtYZID06.Value);
|
||
}
|
||
else
|
||
{
|
||
txtYZZ06.Value = 0;
|
||
txtYZZ06.Enabled = false;
|
||
}
|
||
}
|
||
//因子值07
|
||
protected void chkYZZ07_OnCheckedChanged(object sender, EventArgs e)
|
||
{
|
||
if (chkYZZ07.Checked)
|
||
{
|
||
txtYZZ07.Enabled = true;
|
||
txtYZZ07.Value = GetDefYZZ(txtYZID07.Value);
|
||
}
|
||
else
|
||
{
|
||
txtYZZ07.Value = 0;
|
||
txtYZZ07.Enabled = false;
|
||
}
|
||
}
|
||
//因子值08
|
||
protected void chkYZZ08_OnCheckedChanged(object sender, EventArgs e)
|
||
{
|
||
if (chkYZZ08.Checked)
|
||
{
|
||
txtYZZ08.Enabled = true;
|
||
txtYZZ08.Value = GetDefYZZ(txtYZID08.Value);
|
||
}
|
||
else
|
||
{
|
||
txtYZZ08.Value = 0;
|
||
txtYZZ08.Enabled = false;
|
||
}
|
||
}
|
||
//因子值09
|
||
protected void chkYZZ09_OnCheckedChanged(object sender, EventArgs e)
|
||
{
|
||
if (chkYZZ09.Checked)
|
||
{
|
||
txtYZZ09.Enabled = true;
|
||
txtYZZ09.Value = GetDefYZZ(txtYZID09.Value);
|
||
}
|
||
else
|
||
{
|
||
txtYZZ09.Value = 0;
|
||
txtYZZ09.Enabled = false;
|
||
}
|
||
}
|
||
//因子值10
|
||
protected void chkYZZ10_OnCheckedChanged(object sender, EventArgs e)
|
||
{
|
||
if (chkYZZ10.Checked)
|
||
{
|
||
txtYZZ10.Enabled = true;
|
||
txtYZZ10.Value = GetDefYZZ(txtYZID10.Value);
|
||
}
|
||
else
|
||
{
|
||
txtYZZ10.Value = 0;
|
||
txtYZZ10.Enabled = false;
|
||
}
|
||
}
|
||
|
||
protected void chkWG01_OnCheckedChanged(object sender, EventArgs e)
|
||
{
|
||
if (chkWG01.Checked)
|
||
chkFWG01.Checked = false;
|
||
}
|
||
|
||
protected void chkWG02_OnCheckedChanged(object sender, EventArgs e)
|
||
{
|
||
if (chkWG02.Checked)
|
||
chkFWG02.Checked = false;
|
||
}
|
||
|
||
protected void chkWG03_OnCheckedChanged(object sender, EventArgs e)
|
||
{
|
||
if (chkWG03.Checked)
|
||
chkFWG03.Checked = false;
|
||
}
|
||
|
||
protected void chkWG04_OnCheckedChanged(object sender, EventArgs e)
|
||
{
|
||
if (chkWG04.Checked)
|
||
chkFWG04.Checked = false;
|
||
}
|
||
|
||
protected void chkWG05_OnCheckedChanged(object sender, EventArgs e)
|
||
{
|
||
if (chkWG05.Checked)
|
||
chkFWG05.Checked = false;
|
||
}
|
||
|
||
protected void chkWG06_OnCheckedChanged(object sender, EventArgs e)
|
||
{
|
||
if (chkWG06.Checked)
|
||
chkFWG06.Checked = false;
|
||
}
|
||
|
||
protected void chkWG07_OnCheckedChanged(object sender, EventArgs e)
|
||
{
|
||
if (chkWG07.Checked)
|
||
chkFWG07.Checked = false;
|
||
}
|
||
|
||
protected void chkWG08_OnCheckedChanged(object sender, EventArgs e)
|
||
{
|
||
if (chkWG08.Checked)
|
||
chkFWG08.Checked = false;
|
||
}
|
||
|
||
protected void chkWG09_OnCheckedChanged(object sender, EventArgs e)
|
||
{
|
||
if (chkWG09.Checked)
|
||
chkFWG09.Checked = false;
|
||
}
|
||
|
||
protected void chkWG10_OnCheckedChanged(object sender, EventArgs e)
|
||
{
|
||
if (chkWG10.Checked)
|
||
chkFWG10.Checked = false;
|
||
}
|
||
|
||
protected void chkFWG01_OnCheckedChanged(object sender, EventArgs e)
|
||
{
|
||
if (chkFWG01.Checked)
|
||
chkWG01.Checked = false;
|
||
}
|
||
|
||
protected void chkFWG02_OnCheckedChanged(object sender, EventArgs e)
|
||
{
|
||
if (chkFWG02.Checked)
|
||
chkWG02.Checked = false;
|
||
}
|
||
|
||
protected void chkFWG03_OnCheckedChanged(object sender, EventArgs e)
|
||
{
|
||
if (chkFWG03.Checked)
|
||
chkWG03.Checked = false;
|
||
}
|
||
|
||
protected void chkFWG04_OnCheckedChanged(object sender, EventArgs e)
|
||
{
|
||
if (chkFWG04.Checked)
|
||
chkWG04.Checked = false;
|
||
}
|
||
|
||
protected void chkFWG05_OnCheckedChanged(object sender, EventArgs e)
|
||
{
|
||
if (chkFWG05.Checked)
|
||
chkWG05.Checked = false;
|
||
}
|
||
|
||
protected void chkFWG06_OnCheckedChanged(object sender, EventArgs e)
|
||
{
|
||
if (chkFWG06.Checked)
|
||
chkWG06.Checked = false;
|
||
}
|
||
|
||
protected void chkFWG07_OnCheckedChanged(object sender, EventArgs e)
|
||
{
|
||
if (chkFWG07.Checked)
|
||
chkWG07.Checked = false;
|
||
}
|
||
|
||
protected void chkFWG08_OnCheckedChanged(object sender, EventArgs e)
|
||
{
|
||
if (chkFWG08.Checked)
|
||
chkWG08.Checked = false;
|
||
}
|
||
|
||
protected void chkFWG09_OnCheckedChanged(object sender, EventArgs e)
|
||
{
|
||
if (chkFWG09.Checked)
|
||
chkWG09.Checked = false;
|
||
}
|
||
|
||
protected void chkFWG10_OnCheckedChanged(object sender, EventArgs e)
|
||
{
|
||
if (chkFWG10.Checked)
|
||
chkWG10.Checked = false;
|
||
}
|
||
|
||
//因子值11
|
||
protected void chkYZZ11_OnCheckedChanged(object sender, EventArgs e)
|
||
{
|
||
if (chkYZZ11.Checked)
|
||
{
|
||
txtYZZ11.Enabled = true;
|
||
txtYZZ11.Value = GetDefYZZ(txtYZID11.Value);
|
||
}
|
||
else
|
||
{
|
||
txtYZZ11.Value = 0;
|
||
txtYZZ11.Enabled = false;
|
||
}
|
||
}
|
||
//因子值12
|
||
protected void chkYZZ12_OnCheckedChanged(object sender, EventArgs e)
|
||
{
|
||
if (chkYZZ12.Checked)
|
||
{
|
||
txtYZZ12.Enabled = true;
|
||
txtYZZ12.Value = GetDefYZZ(txtYZID12.Value);
|
||
}
|
||
else
|
||
{
|
||
txtYZZ12.Value = 0;
|
||
txtYZZ12.Enabled = false;
|
||
}
|
||
}
|
||
//因子值13
|
||
protected void chkYZZ13_OnCheckedChanged(object sender, EventArgs e)
|
||
{
|
||
if (chkYZZ13.Checked)
|
||
{
|
||
txtYZZ13.Enabled = true;
|
||
txtYZZ13.Value = GetDefYZZ(txtYZID13.Value);
|
||
}
|
||
else
|
||
{
|
||
txtYZZ13.Value = 0;
|
||
txtYZZ13.Enabled = false;
|
||
}
|
||
}
|
||
//因子值14
|
||
protected void chkYZZ14_OnCheckedChanged(object sender, EventArgs e)
|
||
{
|
||
if (chkYZZ14.Checked)
|
||
{
|
||
txtYZZ14.Enabled = true;
|
||
txtYZZ14.Value = GetDefYZZ(txtYZID14.Value);
|
||
}
|
||
else
|
||
{
|
||
txtYZZ14.Value = 0;
|
||
txtYZZ14.Enabled = false;
|
||
}
|
||
}
|
||
//因子值15
|
||
protected void chkYZZ15_OnCheckedChanged(object sender, EventArgs e)
|
||
{
|
||
if (chkYZZ15.Checked)
|
||
{
|
||
txtYZZ15.Enabled = true;
|
||
txtYZZ15.Value = GetDefYZZ(txtYZID15.Value);
|
||
}
|
||
else
|
||
{
|
||
txtYZZ15.Value = 0;
|
||
txtYZZ15.Enabled = false;
|
||
}
|
||
}
|
||
//因子值16
|
||
protected void chkYZZ16_OnCheckedChanged(object sender, EventArgs e)
|
||
{
|
||
if (chkYZZ16.Checked)
|
||
{
|
||
txtYZZ16.Enabled = true;
|
||
txtYZZ16.Value = GetDefYZZ(txtYZID16.Value);
|
||
}
|
||
else
|
||
{
|
||
txtYZZ16.Value = 0;
|
||
txtYZZ16.Enabled = false;
|
||
}
|
||
}
|
||
//因子值17
|
||
protected void chkYZZ17_OnCheckedChanged(object sender, EventArgs e)
|
||
{
|
||
if (chkYZZ17.Checked)
|
||
{
|
||
txtYZZ17.Enabled = true;
|
||
txtYZZ17.Value = GetDefYZZ(txtYZID17.Value);
|
||
}
|
||
else
|
||
{
|
||
txtYZZ17.Value = 0;
|
||
txtYZZ17.Enabled = false;
|
||
}
|
||
}
|
||
//因子值18
|
||
protected void chkYZZ18_OnCheckedChanged(object sender, EventArgs e)
|
||
{
|
||
if (chkYZZ18.Checked)
|
||
{
|
||
txtYZZ18.Enabled = true;
|
||
txtYZZ18.Value = GetDefYZZ(txtYZID18.Value);
|
||
}
|
||
else
|
||
{
|
||
txtYZZ18.Value = 0;
|
||
txtYZZ18.Enabled = false;
|
||
}
|
||
}
|
||
//因子值19
|
||
protected void chkYZZ19_OnCheckedChanged(object sender, EventArgs e)
|
||
{
|
||
if (chkYZZ19.Checked)
|
||
{
|
||
txtYZZ19.Enabled = true;
|
||
txtYZZ19.Value = GetDefYZZ(txtYZID19.Value);
|
||
}
|
||
else
|
||
{
|
||
txtYZZ19.Value = 0;
|
||
txtYZZ19.Enabled = false;
|
||
}
|
||
}
|
||
//因子值20
|
||
protected void chkYZZ20_OnCheckedChanged(object sender, EventArgs e)
|
||
{
|
||
if (chkYZZ20.Checked)
|
||
{
|
||
txtYZZ20.Enabled = true;
|
||
txtYZZ20.Value = GetDefYZZ(txtYZID20.Value);
|
||
}
|
||
else
|
||
{
|
||
txtYZZ20.Value = 0;
|
||
txtYZZ20.Enabled = false;
|
||
}
|
||
}
|
||
|
||
protected void chkWG11_OnCheckedChanged(object sender, EventArgs e)
|
||
{
|
||
if (chkWG11.Checked)
|
||
chkFWG11.Checked = false;
|
||
}
|
||
|
||
protected void chkWG12_OnCheckedChanged(object sender, EventArgs e)
|
||
{
|
||
if (chkWG12.Checked)
|
||
chkFWG12.Checked = false;
|
||
}
|
||
|
||
protected void chkWG13_OnCheckedChanged(object sender, EventArgs e)
|
||
{
|
||
if (chkWG13.Checked)
|
||
chkFWG13.Checked = false;
|
||
}
|
||
|
||
protected void chkWG14_OnCheckedChanged(object sender, EventArgs e)
|
||
{
|
||
if (chkWG14.Checked)
|
||
chkFWG14.Checked = false;
|
||
}
|
||
|
||
protected void chkWG15_OnCheckedChanged(object sender, EventArgs e)
|
||
{
|
||
if (chkWG15.Checked)
|
||
chkFWG15.Checked = false;
|
||
}
|
||
|
||
protected void chkWG16_OnCheckedChanged(object sender, EventArgs e)
|
||
{
|
||
if (chkWG16.Checked)
|
||
chkFWG16.Checked = false;
|
||
}
|
||
|
||
protected void chkWG17_OnCheckedChanged(object sender, EventArgs e)
|
||
{
|
||
if (chkWG17.Checked)
|
||
chkFWG17.Checked = false;
|
||
}
|
||
|
||
protected void chkWG18_OnCheckedChanged(object sender, EventArgs e)
|
||
{
|
||
if (chkWG18.Checked)
|
||
chkFWG18.Checked = false;
|
||
}
|
||
|
||
protected void chkWG19_OnCheckedChanged(object sender, EventArgs e)
|
||
{
|
||
if (chkWG19.Checked)
|
||
chkFWG19.Checked = false;
|
||
}
|
||
|
||
protected void chkWG20_OnCheckedChanged(object sender, EventArgs e)
|
||
{
|
||
if (chkWG20.Checked)
|
||
chkFWG20.Checked = false;
|
||
}
|
||
|
||
protected void chkFWG11_OnCheckedChanged(object sender, EventArgs e)
|
||
{
|
||
if (chkFWG11.Checked)
|
||
chkWG11.Checked = false;
|
||
}
|
||
|
||
protected void chkFWG12_OnCheckedChanged(object sender, EventArgs e)
|
||
{
|
||
if (chkFWG12.Checked)
|
||
chkWG12.Checked = false;
|
||
}
|
||
|
||
protected void chkFWG13_OnCheckedChanged(object sender, EventArgs e)
|
||
{
|
||
if (chkFWG13.Checked)
|
||
chkWG13.Checked = false;
|
||
}
|
||
|
||
protected void chkFWG14_OnCheckedChanged(object sender, EventArgs e)
|
||
{
|
||
if (chkFWG14.Checked)
|
||
chkWG14.Checked = false;
|
||
}
|
||
|
||
protected void chkFWG15_OnCheckedChanged(object sender, EventArgs e)
|
||
{
|
||
if (chkFWG15.Checked)
|
||
chkWG15.Checked = false;
|
||
}
|
||
|
||
protected void chkFWG16_OnCheckedChanged(object sender, EventArgs e)
|
||
{
|
||
if (chkFWG16.Checked)
|
||
chkWG16.Checked = false;
|
||
}
|
||
|
||
protected void chkFWG17_OnCheckedChanged(object sender, EventArgs e)
|
||
{
|
||
if (chkFWG17.Checked)
|
||
chkWG17.Checked = false;
|
||
}
|
||
|
||
protected void chkFWG18_OnCheckedChanged(object sender, EventArgs e)
|
||
{
|
||
if (chkFWG18.Checked)
|
||
chkWG18.Checked = false;
|
||
}
|
||
|
||
protected void chkFWG19_OnCheckedChanged(object sender, EventArgs e)
|
||
{
|
||
if (chkFWG19.Checked)
|
||
chkWG19.Checked = false;
|
||
}
|
||
|
||
protected void chkFWG20_OnCheckedChanged(object sender, EventArgs e)
|
||
{
|
||
if (chkFWG20.Checked)
|
||
chkWG20.Checked = false;
|
||
}
|
||
|
||
#endregion
|
||
|
||
#region 确认/取消
|
||
|
||
protected void btnOK_Click(object sender, EventArgs e)
|
||
{
|
||
if (cbxTJFW.SelectedValue.Trim().Equals(""))
|
||
{
|
||
ShowMessage("调价范围--不允许为空!");
|
||
return;
|
||
}
|
||
|
||
#region 先校验因子最值是否满足
|
||
if (chkBJSF.Checked && chkBJXF.Checked)
|
||
{
|
||
ShowMessage("报价下浮和报价上浮不允许同时选中!");
|
||
return;
|
||
}
|
||
|
||
bool bchkYZZ = false;
|
||
for (int i = 1; i <= 10; i++)
|
||
{
|
||
gtCheckBox chkYZZ = (gtCheckBox)Master.ContentFormControl.FindControl("chkYZZ" + i.ToString().PadLeft(2, '0'));
|
||
if (chkYZZ.Checked)
|
||
{
|
||
bchkYZZ = true;
|
||
}
|
||
}
|
||
if (bchkYZZ && (chkBJSF.Checked || chkBJXF.Checked))
|
||
{
|
||
ShowMessage("报价上下浮和调价不允许同时选中!");
|
||
return;
|
||
}
|
||
|
||
//下浮
|
||
if (chkBJXF.Checked)
|
||
{
|
||
if (txtBJXFYZZ.Value <= 0 || txtBJXFYZZ.Value >= 100)
|
||
{
|
||
ShowMessage("下浮系数只允许在0 - 100之间!");
|
||
return;
|
||
}
|
||
}
|
||
//上浮
|
||
if (chkBJSF.Checked)
|
||
{
|
||
if (txtBJSFYZZ.Value <= 0 || txtBJSFYZZ.Value >= 100)
|
||
{
|
||
ShowMessage("上浮系数只允许在0 - 100之间!");
|
||
return;
|
||
}
|
||
}
|
||
//因子最值的校验
|
||
|
||
TDatabase dberp = TContextDatabases.GetDatabase("DBERP");
|
||
TSQL SQL = new TSQL(dberp);
|
||
SQL.Clear();
|
||
SQL.Add("select XLXSTZYZ_YZID, XLXSBJDYZZ_YZZ,XLXSBJDYZZ_MINC,XLXSBJDYZZ_MAXC,XLXSTZYZ_YZMC,XLXSTZYZ_JJFS,XLXSTZYZ_TJYS,isnull(XLXSTZYZ_BCYTJ,'N') as XLXSTZYZ_BCYTJ from XLXSTZYZ");
|
||
SQL.Add(" left join XLXSBJDYZZ on XLXSBJDYZZ_JGBID=XLXSTZYZ_JGBID and XLXSBJDYZZ_YZID=XLXSTZYZ_YZID");
|
||
SQL.Add(" where XLXSTZYZ_MXBH='BJD' and isnull(XLXSTZYZ_BCYTJ,'N') <> 'Y' and isnull(XLXSTZYZ_TJYS,' ')=' ' ");
|
||
DataSet ds = dberp.OpenDataSet(SQL);
|
||
if (ds.Tables[0].Rows.Count > 0)
|
||
{
|
||
for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
|
||
{
|
||
string sYZID = ds.Tables[0].Rows[i]["XLXSTZYZ_YZID"].ToString().Trim();
|
||
string sYZMC = ds.Tables[0].Rows[i]["XLXSTZYZ_YZMC"].ToString().Trim();
|
||
string sDefYZZ = ds.Tables[0].Rows[i]["XLXSBJDYZZ_YZZ"].ToString().Trim();
|
||
string sMinYZZ = ds.Tables[0].Rows[i]["XLXSBJDYZZ_MINC"].ToString().Trim();
|
||
string sMaxYZZ = ds.Tables[0].Rows[i]["XLXSBJDYZZ_MAXC"].ToString().Trim();
|
||
|
||
for (int j = 1; j <= 10; j++)
|
||
{
|
||
gtCheckBox chkYZZ = (gtCheckBox)Master.ContentFormControl.FindControl("chkYZZ" + j.ToString().PadLeft(2, '0'));
|
||
gtNumTextBox txtYZZ = (gtNumTextBox)Master.ContentFormControl.FindControl("txtYZZ" + j.ToString().PadLeft(2, '0'));
|
||
HiddenField txtYZID = (HiddenField)Master.ContentFormControl.FindControl("txtYZID" + j.ToString().PadLeft(2, '0'));
|
||
if (chkYZZ.Checked)
|
||
{
|
||
if (txtYZID.Value.Equals(sYZID))
|
||
{
|
||
if (!sMinYZZ.Equals(""))
|
||
{
|
||
if (txtYZZ.Value < CMISproConvert.StrToFloat(sMinYZZ, 0))
|
||
{
|
||
ShowMessage(string.Format("{0}不允许低于设置的调价最小值{1}!", sYZMC, sMinYZZ));
|
||
return;
|
||
}
|
||
}
|
||
|
||
if (!sMaxYZZ.Equals(""))
|
||
{
|
||
if (txtYZZ.Value > CMISproConvert.StrToFloat(sMaxYZZ, 0))
|
||
{
|
||
ShowMessage(string.Format("{0}不允许高于设置的调价最大值{1}!", sYZMC, sMaxYZZ));
|
||
return;
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
}
|
||
#endregion
|
||
|
||
string sYZIDList = "";
|
||
string sTJFW = "";
|
||
for (int i = 1; i <= 10; i++)
|
||
{
|
||
gtCheckBox chkYZZ = (gtCheckBox)Master.ContentFormControl.FindControl("chkYZZ" + i.ToString().PadLeft(2, '0'));
|
||
gtNumTextBox txtYZZ = (gtNumTextBox)Master.ContentFormControl.FindControl("txtYZZ" + i.ToString().PadLeft(2, '0'));
|
||
HiddenField txtYZID = (HiddenField)Master.ContentFormControl.FindControl("txtYZID" + i.ToString().PadLeft(2, '0'));
|
||
gtCheckBox chkYBJ = (gtCheckBox)Master.ContentFormControl.FindControl("chkYBJ" + i.ToString().PadLeft(2, '0'));
|
||
gtCheckBox chkWG = (gtCheckBox)Master.ContentFormControl.FindControl("chkWG" + i.ToString().PadLeft(2, '0'));
|
||
gtCheckBox chkFWG = (gtCheckBox)Master.ContentFormControl.FindControl("chkFWG" + i.ToString().PadLeft(2, '0'));
|
||
sTJFW = (chkYBJ.Checked ? "Y" : "N") + "," + (chkWG.Checked ? "Y" : "N") + "," + (chkFWG.Checked ? "Y" : "N");
|
||
if (chkYZZ.Checked)
|
||
{
|
||
sYZIDList = sYZIDList + "|" + txtYZID.Value + "|" + txtYZZ.Value.ToString().Trim() + "|" + sTJFW;
|
||
}
|
||
}
|
||
sYZIDList = sYZIDList.TrimStart('|').TrimEnd('|');
|
||
//string sYZZList = sYZID + "|" + txtYZZ.Value.ToString() + "|" + ();
|
||
//使用脚本给父页面的隐藏控件赋值,调用父页面的控件事件
|
||
DialogOperationScript dos = new DialogOperationScript(this);
|
||
dos.SetOwnerControlValue(PageParam.GetRTrimString("txtBJXFCID"), txtBJXFYZZ.Value.ToString());
|
||
dos.SetOwnerControlValue(PageParam.GetRTrimString("txtBJSFCID"), txtBJSFYZZ.Value.ToString());
|
||
|
||
dos.SetOwnerControlValue(PageParam.GetRTrimString("txtPLSZYZListCID"), sYZIDList);
|
||
dos.SetOwnerControlValue(PageParam.GetRTrimString("txtPLSZAllCID"), cbxTJFW.SelectedValue.Trim());
|
||
dos.ClickOwnerButton(PageParam.GetRTrimString("btnRefreshBJPLTJ"));
|
||
dos.CloseSelf();
|
||
dos.Execute();
|
||
|
||
}
|
||
|
||
protected void btnQX_Click(object sender, EventArgs e)
|
||
{
|
||
CloseWindow();
|
||
}
|
||
|
||
#endregion
|
||
}
|
||
}
|