580 lines
26 KiB
C#
580 lines
26 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;
|
||
using System.Collections.Generic;
|
||
|
||
namespace GThinking.N_XLXSBJ
|
||
{
|
||
public partial class XLBJD_JMBGSTZ : SingleCardBase
|
||
{
|
||
XLBJD_MX_YZ entity = new XLBJD_MX_YZ();
|
||
protected void Page_Load(object sender, EventArgs e)
|
||
{
|
||
this.UMID = 100860000;
|
||
this.UMName = "线缆销售报价单";
|
||
base.CurMaster = Master;
|
||
base.CurEntity = entity;
|
||
this.PageHeight = 180;
|
||
this.PageWidth = 420;
|
||
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();
|
||
}
|
||
}
|
||
|
||
#region 模板
|
||
|
||
protected override void SetControlState()
|
||
{
|
||
base.SetControlState();
|
||
if (PageParam.ContainsKey("YZID") || PageParam.GetRTrimString("TZBZ").Trim().Equals("JGBBJTZ"))
|
||
{
|
||
chkWG.Enabled = true;
|
||
chkFWG.Enabled = true;
|
||
}
|
||
else
|
||
{
|
||
chkWG.Enabled = false;
|
||
chkFWG.Enabled = false;
|
||
}
|
||
if (PageParam.GetRTrimString("JMBGS").Equals("Y"))
|
||
{
|
||
txtYZZ.Visible = false;
|
||
txtJMBGS.Visible = true;
|
||
}
|
||
else
|
||
{
|
||
txtYZZ.Visible = true;
|
||
txtJMBGS.Visible = false;
|
||
}
|
||
}
|
||
|
||
protected override void SetComboxItems()
|
||
{
|
||
if (PageParam.GetRTrimString("TZBZ").Trim().Equals("BJJCLLX") || PageParam.GetRTrimString("TZBZ").Trim().Equals("LJJCLLX"))
|
||
{
|
||
string sBJFLID = PageParam.GetRTrimString("BJFLID");
|
||
List<TZYZXX> yzxx_List = XLBJDUtils.GetBJFLYZOrderByXSXH(sBJFLID);
|
||
cbxCZLM.ClearItems();
|
||
|
||
foreach (TZYZXX yzxx in yzxx_List)
|
||
{
|
||
if (yzxx.XLXSTZYZ_BCYTJ == "Y")
|
||
cbxCZLM.Items.Add(new ListItem(yzxx.XLXSTZYZ_YZMC.Trim(), yzxx.XLXSTZYZ_YZID.Trim()));
|
||
}
|
||
|
||
if (PageParam.GetRTrimString("TZBZ").Trim().Equals("BJJCLLX"))
|
||
{
|
||
cbxCZLM.Items.Add(new ListItem("表价价差率", "BJ"));
|
||
}
|
||
else if (PageParam.GetRTrimString("TZBZ").Trim().Equals("LJJCLLX"))
|
||
{
|
||
cbxCZLM.Items.Add(new ListItem("料价价差率", "LJ"));
|
||
}
|
||
|
||
cbxCZLM.SelectedIndex = 0;
|
||
|
||
cbxCLCBLX.ClearItems();
|
||
cbxCLCBLX.Items.Add(new ListItem("相对值", "XDZ"));
|
||
cbxCLCBLX.Items.Add(new ListItem("固定值", "GDZ"));
|
||
cbxCLCBLX.SelectedIndex = 0;
|
||
}
|
||
|
||
base.SetComboxItems();
|
||
}
|
||
|
||
#endregion
|
||
|
||
#region 自定义函数
|
||
|
||
private void InitControl()
|
||
{
|
||
string sJGBBJBM = string.IsNullOrEmpty(PageParam.GetRTrimString("JGBBJBM")) ? "表价" : PageParam.GetRTrimString("JGBBJBM");
|
||
lblCZLM.Style["display"] = "none";
|
||
cbxCZLM.Style["display"] = "none";
|
||
cbxCLCBLX.Style["display"] = "none";
|
||
chkJTZCEWF.Style["display"] = "none";
|
||
txtYZZ2.Style["display"] = "none";
|
||
tr2.Style["height"] = "15px";
|
||
|
||
//lblSZFW.Style["display"] = "none";
|
||
//cbxSZFW.Style["display"] = "none";
|
||
tr3.Style["height"] = "15px";
|
||
tr3.Style["display"] = "none";
|
||
|
||
cbxSZFW.ClearItems();
|
||
if (PageParam.GetRTrimString("PLSZAll").Equals("N"))
|
||
cbxSZFW.Items.Add(new ListItem("勾选记录", "N"));
|
||
cbxSZFW.Items.Add(new ListItem("整单记录", "Y"));
|
||
|
||
if (PageParam.ContainsKey("FromXHDYSX"))
|
||
cbxSZFW.Items.Add(new ListItem("所查记录", "C"));
|
||
|
||
if (PageParam.GetRTrimString("PLSZAll").Equals("D"))
|
||
cbxSZFW.Items.Add(new ListItem("当前记录", "D"));
|
||
|
||
cbxSZFW.SelectedValue = PageParam.GetRTrimString("PLSZAll");
|
||
|
||
chkYBJ.Text = "有" + sJGBBJBM;
|
||
if (PageParam.ContainsKey("YZID"))
|
||
{
|
||
|
||
lblYZID.Text = PageParam.GetRTrimString("YZMC") + ":";
|
||
if (PageParam.GetRTrimString("JMBGS").Equals("Y"))
|
||
{
|
||
lblDW.Text = "";
|
||
txtYZZ.Visible = false;
|
||
txtJMBGS.Visible = true;
|
||
}
|
||
else
|
||
{
|
||
string sJJFS = PageParam.GetRTrimString("JJFS");
|
||
if (sJJFS.Equals("JD") || sJJFS.Equals("KD") || sJJFS.Equals("SX") || sJJFS.Equals("DD") || sJJFS.Equals("MD"))
|
||
{
|
||
lblDW.Text = "%";
|
||
}
|
||
else if (sJJFS.Equals("JJ"))
|
||
{
|
||
if (XLBJDUtils.GetYZXXByYZID(PageParam.GetRTrimString("YZID")).XLXSTZYZ_TJLX == "1")
|
||
lblDW.Text = "元";
|
||
else
|
||
lblDW.Text = "";
|
||
}
|
||
else if (sJJFS.Equals("MX") || sJJFS.Equals("DX"))
|
||
{
|
||
//乘以系数/除以系数
|
||
lblDW.Text = "";
|
||
txtYZZ.DecimalPlaces = 4;
|
||
}
|
||
//赋值放在设置完小数位数之后
|
||
txtYZZ.Value = CMISproConvert.StrToFloat(PageParam.GetRTrimString("DefYZZ"), 0);
|
||
}
|
||
string sMRTJFW = "," + PageParam.GetRTrimString("MRTJFW") + ",";
|
||
if (sMRTJFW.Contains(",1,"))
|
||
chkYBJ.Checked = true;
|
||
if (sMRTJFW.Contains(",2,"))
|
||
chkWG.Checked = true;
|
||
if (sMRTJFW.Contains(",3,"))
|
||
chkFWG.Checked = true;
|
||
}
|
||
else
|
||
{
|
||
//默认不显示
|
||
chkYBJ.Style["display"] = "none";
|
||
chkWG.Style["display"] = "none";
|
||
chkFWG.Style["display"] = "none";
|
||
if (PageParam.GetRTrimString("TZBZ").Trim().Equals("BJSL"))
|
||
{
|
||
//报价数量
|
||
int iBJU030 = CMISproConvert.StrToInt(GetOption("BJU030"));
|
||
if (iBJU030 >= 0)
|
||
{
|
||
txtYZZ.DecimalPlaces = iBJU030;
|
||
}
|
||
else
|
||
{
|
||
txtYZZ.IsQuantity = true;
|
||
}
|
||
lblYZID.Text = "报价数量:";
|
||
lblDW.Text = "";
|
||
chkYBJ.Style["display"] = "block";
|
||
chkWG.Style["display"] = "block";
|
||
chkFWG.Style["display"] = "block";
|
||
chkYBJ.Checked = true;
|
||
}
|
||
else if (PageParam.GetRTrimString("TZBZ").Trim().Equals("JGBBJTZ"))
|
||
{
|
||
//表价
|
||
lblYZID.Text = "表价(相对值):";
|
||
lblDW.Text = "";
|
||
chkYBJ.Style["display"] = "block";
|
||
chkWG.Style["display"] = "block";
|
||
chkFWG.Style["display"] = "block";
|
||
string sXSWS = PageParam.GetRTrimString("JGBBJXSWS");
|
||
txtYZZ.DecimalPlaces = CMISproConvert.StrToInt(sXSWS, 2);
|
||
}
|
||
else if (PageParam.GetRTrimString("TZBZ").Trim().Equals("BJSF"))
|
||
{
|
||
//上浮
|
||
string sBJSFTJFS = XLBJDUtils.GetBJSFTJFS();
|
||
if (sBJSFTJFS.Equals("UM"))
|
||
lblYZID.Text = "新报价=原报价*(1+";
|
||
else
|
||
lblYZID.Text = "新报价=原报价/(1-";
|
||
lblDW.Text = "%)";
|
||
|
||
}
|
||
else if (PageParam.GetRTrimString("TZBZ").Trim().Equals("BJXF"))
|
||
{
|
||
//下浮
|
||
string sBJXFTJFS = XLBJDUtils.GetBJXFTJFS();
|
||
if (sBJXFTJFS.Equals("DD"))
|
||
lblYZID.Text = "新报价=原报价/(1+";
|
||
else
|
||
lblYZID.Text = "新报价=原报价*(1-";
|
||
lblDW.Text = "%)";
|
||
|
||
}
|
||
else if (PageParam.GetRTrimString("TZBZ").Trim().Equals("BJJCLLX"))
|
||
{
|
||
//料价价差率
|
||
tr2.Style["height"] = "5px";
|
||
lblCZLM.Style["display"] = "block";
|
||
cbxCZLM.Style["display"] = "block";
|
||
lblYZID.Text = "调整比率:";
|
||
lblDW.Text = "%";
|
||
|
||
chkYBJ.Style["display"] = "block";
|
||
chkYBJ.Checked = true;
|
||
chkYBJ.Text = "仅调整外购产品";
|
||
}
|
||
else if (PageParam.GetRTrimString("TZBZ").Trim().Equals("LJJCLLX"))
|
||
{
|
||
//料价价差率
|
||
|
||
//lblSZFW.Style["display"] = "block";
|
||
//cbxSZFW.Style["display"] = "block";
|
||
tr3.Style["height"] = "10px";
|
||
tr3.Style["display"] = "block";
|
||
|
||
tr2.Style["height"] = "10px";
|
||
lblCZLM.Style["display"] = "block";
|
||
cbxCZLM.Style["display"] = "block";
|
||
lblYZID.Text = "调整比率:";
|
||
lblDW.Text = "%";
|
||
cbxCLCBLX.Style["display"] = "block";
|
||
chkYBJ.Style["display"] = "block";
|
||
chkFWG.Style["display"] = "block";
|
||
if (CMISproDataBase.ExistsRecord("DBERP", string.Format("select 1 from XLXSBJFL where XLXSBJFL_BJFLID = '{0}' and ',' || RTRIM(XLXSBJFL_LJJCLPLTJFW) || ',' like '%,1,%'", PageParam.GetRTrimString("BJFLID"))))
|
||
{
|
||
chkYBJ.Checked = true;
|
||
}
|
||
else
|
||
{
|
||
chkYBJ.Checked = false;
|
||
}
|
||
chkFWG.Checked = true;
|
||
chkYBJ.Text = "无" + sJGBBJBM;
|
||
}
|
||
else if (PageParam.GetRTrimString("TZBZ").Trim().Equals("BJXJ"))
|
||
{
|
||
chkJTZCEWF.Style["display"] = "block";
|
||
txtYZZ2.Style["display"] = "block";
|
||
lblYZID.Text = "新报价=限价*(1-";
|
||
lblDW.Text = "%)+";
|
||
txtYZZ.Style["Width"] = "60px";
|
||
txtYZZ2.Style["Width"] = "60px";
|
||
chkJTZCEWF.Checked = true;
|
||
}
|
||
|
||
}
|
||
}
|
||
|
||
#endregion
|
||
|
||
#region 自定义按钮
|
||
|
||
protected void btnOK_Click(object sender, EventArgs e)
|
||
{
|
||
if (cbxSZFW.SelectedValue.Trim().Equals(""))
|
||
{
|
||
ShowMessage("调价范围--不允许为空!");
|
||
return;
|
||
}
|
||
|
||
if (PageParam.ContainsKey("TZBZ"))
|
||
{
|
||
DialogOperationScript dos = new DialogOperationScript(this);
|
||
dos.SetOwnerControlValue(PageParam.GetRTrimString("txtPLSZAllCID"), cbxSZFW.SelectedValue.Trim());
|
||
|
||
if (PageParam.GetRTrimString("TZBZ").Trim().Equals("BJSL"))
|
||
{
|
||
//报价数量
|
||
if (txtYZZ.Value <= 0)
|
||
{
|
||
ShowMessage("报价数量必须大于0!");
|
||
return;
|
||
}
|
||
dos.SetOwnerControlValue(PageParam.GetRTrimString("txtBJSLCID"), txtYZZ.Value.ToString() + "|" + (chkYBJ.Checked ? "Y" : "N") + "," + (chkWG.Checked ? "Y" : "N") + "," + (chkFWG.Checked ? "Y" : "N"));
|
||
dos.ClickOwnerButton(PageParam.GetRTrimString("btnRefreshBJSL"));
|
||
}
|
||
else if (PageParam.GetRTrimString("TZBZ").Trim().Equals("JGBBJTZ"))
|
||
{
|
||
string sJGBBJBM = string.IsNullOrEmpty(PageParam.GetRTrimString("JGBBJBM")) ? "表价" : PageParam.GetRTrimString("JGBBJBM");
|
||
string sTZJGBBJ = PageParam.GetRTrimString("TZJGBBJ");
|
||
string sBJDID = PageParam.GetRTrimString("BJDID");
|
||
string sBJDXHList = PageParam.GetRTrimString("sBJDXHList");
|
||
if (sTZJGBBJ.Equals("3"))
|
||
{
|
||
TDatabase dberp = TContextDatabases.GetDatabase("DBERP");
|
||
TSQL SQL = new TSQL(dberp);
|
||
if (cbxSZFW.SelectedValue.Equals("Y"))
|
||
{
|
||
SQL.Add("SELECT XLXSBJDMX_XH FROM XLXSBJDMX LEFT JOIN XLXSCLQD ON XLXSCLQD_XLXHID=XLXSBJDMX_XLXHID AND XLXSCLQD_XLGGID=XLXSBJDMX_XLGGID AND XLXSCLQD_XLBZID=XLXSBJDMX_XLBZID AND XLXSCLQD_DYDJID=XLXSBJDMX_DYDJID ");
|
||
SQL.Add(" WHERE ISNULL(XLXSCLQD_XLXHID,' ') <> ' ' AND XLXSBJDMX_BJDID=:pBJDID ");
|
||
SQL.ParamByName("pBJDID").Value = sBJDID;
|
||
DataSet ds = dberp.OpenDataSet(SQL);
|
||
string XHList = "";
|
||
for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
|
||
{
|
||
XHList += ds.Tables[0].Rows[i]["XLXSBJDMX_XH"].ToString().Trim() + ",";
|
||
}
|
||
XHList = XHList.TrimEnd(',');
|
||
if (!XHList.Equals(""))
|
||
{
|
||
ShowMessage(string.Format("序号为{0}的明细记录不允许调整{1}!", XHList, sJGBBJBM));
|
||
return;
|
||
}
|
||
|
||
}
|
||
else
|
||
{
|
||
SQL.Add("SELECT XLXSBJDMX_XH FROM XLXSBJDMX LEFT JOIN XLXSCLQD ON XLXSCLQD_XLXHID=XLXSBJDMX_XLXHID AND XLXSCLQD_XLGGID=XLXSBJDMX_XLGGID AND XLXSCLQD_XLBZID=XLXSBJDMX_XLBZID AND XLXSCLQD_DYDJID=XLXSBJDMX_DYDJID ");
|
||
SQL.Add(" WHERE ISNULL(XLXSCLQD_XLXHID,' ') <> ' ' AND XLXSBJDMX_BJDID=:pBJDID ");
|
||
if (!sBJDXHList.Equals(""))
|
||
SQL.Add(" and " + CMISproDataBase.GetWhereEqual("XLXSBJDMX_XH", sBJDXHList));
|
||
SQL.ParamByName("pBJDID").Value = sBJDID;
|
||
DataSet ds = dberp.OpenDataSet(SQL);
|
||
string XHList = "";
|
||
for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
|
||
{
|
||
XHList += ds.Tables[0].Rows[i]["XLXSBJDMX_XH"].ToString().Trim() + ",";
|
||
}
|
||
XHList = XHList.TrimEnd(',');
|
||
if (!XHList.Equals(""))
|
||
{
|
||
ShowMessage(string.Format("序号为{0}的明细记录不允许调整{1}!", XHList, sJGBBJBM));
|
||
return;
|
||
}
|
||
}
|
||
|
||
}
|
||
else if (sTZJGBBJ.Equals("4"))
|
||
{
|
||
TDatabase dberp = TContextDatabases.GetDatabase("DBERP");
|
||
TSQL SQL = new TSQL(dberp);
|
||
if (cbxSZFW.SelectedValue.Equals("Y"))
|
||
{
|
||
SQL.Add("SELECT XLXSBJDMX_XH FROM XLXSBJDMX ");
|
||
SQL.Add(" WHERE ISNULL(XLXSBJDMX_JGBBJ,0) <> 0 AND XLXSBJDMX_BJDID=:pBJDID ");
|
||
SQL.ParamByName("pBJDID").Value = sBJDID;
|
||
DataSet ds = dberp.OpenDataSet(SQL);
|
||
string XHList = "";
|
||
for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
|
||
{
|
||
XHList += ds.Tables[0].Rows[i]["XLXSBJDMX_XH"].ToString().Trim() + ",";
|
||
}
|
||
XHList = XHList.TrimEnd(',');
|
||
if (!XHList.Equals(""))
|
||
{
|
||
ShowMessage(string.Format("序号为{0}的明细记录不允许调整{1}!", XHList, sJGBBJBM));
|
||
return;
|
||
}
|
||
|
||
}
|
||
else
|
||
{
|
||
SQL.Add("SELECT XLXSBJDMX_XH FROM XLXSBJDMX ");
|
||
SQL.Add(" WHERE ISNULL(XLXSBJDMX_JGBBJ,0) <> 0 AND XLXSBJDMX_BJDID=:pBJDID ");
|
||
if (!sBJDXHList.Equals(""))
|
||
SQL.Add(" and " + CMISproDataBase.GetWhereEqual("XLXSBJDMX_XH", sBJDXHList));
|
||
SQL.ParamByName("pBJDID").Value = sBJDID;
|
||
DataSet ds = dberp.OpenDataSet(SQL);
|
||
string XHList = "";
|
||
for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
|
||
{
|
||
XHList += ds.Tables[0].Rows[i]["XLXSBJDMX_XH"].ToString().Trim() + ",";
|
||
}
|
||
XHList = XHList.TrimEnd(',');
|
||
if (!XHList.Equals(""))
|
||
{
|
||
ShowMessage(string.Format("序号为{0}的明细记录不允许调整{1}!", XHList, sJGBBJBM));
|
||
return;
|
||
}
|
||
}
|
||
}
|
||
dos.SetOwnerControlValue(PageParam.GetRTrimString("txtJGBBJTZCID"), txtYZZ.Value.ToString() + "|" + (chkYBJ.Checked ? "Y" : "N") + "," + (chkWG.Checked ? "Y" : "N") + "," + (chkFWG.Checked ? "Y" : "N"));
|
||
dos.ClickOwnerButton(PageParam.GetRTrimString("btnRefreshJGBBJTZ"));
|
||
}
|
||
else if (PageParam.GetRTrimString("TZBZ").Trim().Equals("BJSF"))
|
||
{
|
||
//上浮
|
||
if (txtYZZ.Value <= 0 || txtYZZ.Value >= 100)
|
||
{
|
||
ShowMessage("上浮系数只允许在0 - 100之间!");
|
||
return;
|
||
}
|
||
dos.SetOwnerControlValue(PageParam.GetRTrimString("txtBJSFCID"), txtYZZ.Value.ToString());
|
||
dos.ClickOwnerButton(PageParam.GetRTrimString("btnRefreshBJSF"));
|
||
}
|
||
else if (PageParam.GetRTrimString("TZBZ").Trim().Equals("BJXF"))
|
||
{
|
||
if (txtYZZ.Value <= 0 || txtYZZ.Value >= 100)
|
||
{
|
||
ShowMessage("下浮系数只允许在0 - 100之间!");
|
||
return;
|
||
}
|
||
dos.SetOwnerControlValue(PageParam.GetRTrimString("txtBJXFCID"), txtYZZ.Value.ToString());
|
||
dos.ClickOwnerButton(PageParam.GetRTrimString("btnRefreshBJXF"));
|
||
|
||
}
|
||
else if (PageParam.GetRTrimString("TZBZ").Trim().Equals("BJJCLLX"))
|
||
{
|
||
dos.SetOwnerControlValue(PageParam.GetRTrimString("txtTZZCID"), cbxCZLM.SelectedValue.Trim() + "|" + txtYZZ.Value.ToString() + "|" + (chkYBJ.Checked ? "Y" : "N"));
|
||
dos.ClickOwnerButton(PageParam.GetRTrimString("btnRefreshBJJCL"));
|
||
|
||
}
|
||
else if (PageParam.GetRTrimString("TZBZ").Trim().Equals("LJJCLLX"))
|
||
{
|
||
dos.SetOwnerControlValue(PageParam.GetRTrimString("txtTZZCID"), cbxSZFW.SelectedValue.Trim() + "|" + cbxCZLM.SelectedValue.Trim() + "|" + txtYZZ.Value.ToString() + "|" + cbxCLCBLX.SelectedValue.Trim() + "|" + (chkYBJ.Checked ? "Y" : "N") + "," + (chkFWG.Checked ? "Y" : "N"));
|
||
dos.ClickOwnerButton(PageParam.GetRTrimString("btnRefreshLJJCL"));
|
||
|
||
}
|
||
else if (PageParam.GetRTrimString("TZBZ").Trim().Equals("BJXJ"))
|
||
{
|
||
dos.SetOwnerControlValue(PageParam.GetRTrimString("txtTZZCID"), cbxSZFW.SelectedValue.Trim() + "|" + txtYZZ.Value.ToString() + "|" + txtYZZ2.Value.ToString() + "|" + (chkJTZCEWF.Checked ? "Y" : "N"));
|
||
dos.ClickOwnerButton(PageParam.GetRTrimString("btnRefreshBJXJ"));
|
||
|
||
}
|
||
dos.CloseSelf();
|
||
dos.Execute();
|
||
}
|
||
//批量调整截面比公式
|
||
else if (PageParam.GetRTrimString("JMBGS").Equals("Y"))
|
||
{
|
||
string sJMBYZJJFS = PageParam.GetRTrimString("JJFS");
|
||
double dJGBGSResult = 0;
|
||
gtExpression exp = new gtExpression();
|
||
if (!txtJMBGS.Text.Trim().Equals(""))
|
||
{
|
||
try
|
||
{
|
||
dJGBGSResult = NumberUtils.RoundX(exp.Evaluate(txtJMBGS.Text.Trim()), 6);
|
||
if (sJMBYZJJFS == "JD")
|
||
dJGBGSResult = NumberUtils.RoundX((dJGBGSResult - 1) * 100, 2);
|
||
if (sJMBYZJJFS == "MD")
|
||
dJGBGSResult = NumberUtils.RoundX((1 - dJGBGSResult) * 100, 2);
|
||
if (sJMBYZJJFS == "MX")
|
||
dJGBGSResult = NumberUtils.RoundX(dJGBGSResult, 4);
|
||
}
|
||
catch
|
||
{
|
||
string sJMBGS = PageParam.GetRTrimString("YZMC");
|
||
ShowMessage(string.Format(sJMBGS + "设置有误,请修正!"));
|
||
return;
|
||
}
|
||
}
|
||
if (!PageParam.GetRTrimString("MinYZZ").Equals(""))
|
||
{
|
||
if (dJGBGSResult < CMISproConvert.StrToFloat(PageParam.GetRTrimString("MinYZZ"), 0))
|
||
{
|
||
ShowMessage(string.Format("公式计算结果为{0},不允许低于设置的调价最小值{1}!", dJGBGSResult.ToString(), PageParam.GetRTrimString("MinYZZ")));
|
||
return;
|
||
}
|
||
}
|
||
|
||
if (!PageParam.GetRTrimString("MaxYZZ").Equals(""))
|
||
{
|
||
if (dJGBGSResult > CMISproConvert.StrToFloat(PageParam.GetRTrimString("MaxYZZ"), 0))
|
||
{
|
||
ShowMessage(string.Format("公式计算结果为{0},不允许高于设置的调价最大值{2}!", dJGBGSResult.ToString(), PageParam.GetRTrimString("MaxYZZ")));
|
||
return;
|
||
}
|
||
}
|
||
|
||
string sYZID = PageParam.GetRTrimString("YZID");
|
||
string sYZZList = sYZID + "|" + dJGBGSResult.ToString() + "|" + (chkYBJ.Checked ? "Y" : "N") + "," + (chkWG.Checked ? "Y" : "N") + "," + (chkFWG.Checked ? "Y" : "N");
|
||
//使用脚本给父页面的隐藏控件赋值,调用父页面的控件事件
|
||
DialogOperationScript dos = new DialogOperationScript(this);
|
||
dos.SetOwnerControlValue(PageParam.GetRTrimString("txtPLSZAllCID"), cbxSZFW.SelectedValue.Trim());
|
||
dos.SetOwnerControlValue(PageParam.GetRTrimString("txtPLSZYZListCID"), sYZZList);
|
||
dos.SetOwnerControlValue(PageParam.GetRTrimString("txtPLSZJMBGSCID"), txtJMBGS.Text.Trim());
|
||
dos.ClickOwnerButton(PageParam.GetRTrimString("btnRefreshCID"));
|
||
dos.CloseSelf();
|
||
dos.Execute();
|
||
|
||
|
||
}
|
||
else
|
||
{
|
||
if (!PageParam.GetRTrimString("MinYZZ").Equals(""))
|
||
{
|
||
if (txtYZZ.Value < CMISproConvert.StrToFloat(PageParam.GetRTrimString("MinYZZ"), 0))
|
||
{
|
||
ShowMessage(string.Format("不允许低于设置的调价最小值{0}!", PageParam.GetRTrimString("MinYZZ")));
|
||
return;
|
||
}
|
||
}
|
||
|
||
if (!PageParam.GetRTrimString("MaxYZZ").Equals(""))
|
||
{
|
||
if (txtYZZ.Value > CMISproConvert.StrToFloat(PageParam.GetRTrimString("MaxYZZ"), 0))
|
||
{
|
||
ShowMessage(string.Format("不允许高于设置的调价最大值{0}!", PageParam.GetRTrimString("MaxYZZ")));
|
||
return;
|
||
}
|
||
}
|
||
|
||
string sYZID = PageParam.GetRTrimString("YZID");
|
||
string sYZZList = sYZID + "|" + txtYZZ.Value.ToString() + "|" + (chkYBJ.Checked ? "Y" : "N") + "," + (chkWG.Checked ? "Y" : "N") + "," + (chkFWG.Checked ? "Y" : "N");
|
||
//使用脚本给父页面的隐藏控件赋值,调用父页面的控件事件
|
||
DialogOperationScript dos = new DialogOperationScript(this);
|
||
dos.SetOwnerControlValue(PageParam.GetRTrimString("txtPLSZAllCID"), cbxSZFW.SelectedValue.Trim());
|
||
dos.SetOwnerControlValue(PageParam.GetRTrimString("txtPLSZYZListCID"), sYZZList);
|
||
dos.ClickOwnerButton(PageParam.GetRTrimString("btnRefreshCID"));
|
||
dos.CloseSelf();
|
||
dos.Execute();
|
||
}
|
||
}
|
||
|
||
protected void btnQX_Click(object sender, EventArgs e)
|
||
{
|
||
CloseWindow();
|
||
}
|
||
|
||
#endregion
|
||
|
||
#region 控件事件
|
||
|
||
protected void chkWG_OnCheckedChanged(object sender, EventArgs e)
|
||
{
|
||
if (chkWG.Checked)
|
||
chkFWG.Checked = false;
|
||
}
|
||
|
||
protected void chkFWG_OnCheckedChanged(object sender, EventArgs e)
|
||
{
|
||
if (chkFWG.Checked)
|
||
chkWG.Checked = false;
|
||
}
|
||
|
||
#endregion
|
||
}
|
||
}
|