Files
N_XLXSBJ----MX/TZYZBJ_YZZInfo.aspx.cs
2026-08-21 17:03:02 +08:00

183 lines
5.2 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_MISPRO.Utility;
using GThinking.N_PUBLIC;
using GThinking.N_MODEL.Dialog;
namespace GThinking.N_XLXSBJ
{
public partial class TZYZBJ_YZZInfo : SingleCardBase
{
TZYZBJ_YZZ entity = new TZYZBJ_YZZ();
protected void Page_Load(object sender, EventArgs e)
{
this.UMID = 100860005;
this.UMName = "线缆销售报价报价单调价因子";
this.CurMaster = Master;
this.CurEntity = entity;
this.PageHeight = 400;
this.PageWidth = 500;
this.Master.EnableInsertBtn = false;
this.Master.EnableCopyBtn = false;
this.Master.EnableDeleteBtn = false;
if (!this.IsPostBack)
{
InitControls();
}
base.InitPage();
}
#region 模板事件继承
protected override void SetControlState()
{
base.SetControlState();
cbxJJFS.Enabled = false;
txtWHR.Enabled = false;
datWHSJ.Enabled = false;
txtYZID.Enabled = false;
txtYZMC.Enabled = false;
if (cbxJJFS.SelectedValue.Trim().Equals("JJ"))
{
txtYZZ.DecimalPlaces = 2;
}
else if (cbxJJFS.SelectedValue.Trim().Equals("MX") || cbxJJFS.SelectedValue.Trim().Equals("DX"))
{
txtYZZ.DecimalPlaces = 4;
}
else
{
txtYZZ.DecimalPlaces = 2;
}
}
protected override void LoadRecord()
{
if (!IsPostBack)
{
entity.Param.Add("XLXSBJDYZZ_JGBID", PageParam.GetRTrimString("XLXSBJDYZZ_JGBID"));
entity.Param.Add("XLXSBJDYZZ_YZID", PageParam.GetRTrimString("XLXSBJDYZZ_YZID"));
}
else
{
entity.Param.Add("XLXSBJDYZZ_JGBID", txtJGBID.Value.Trim());
entity.Param.Add("XLXSBJDYZZ_YZID", txtYZID.Text.Trim());
}
base.LoadRecord();
}
protected override bool DataLogicValid()
{
if (!base.DataLogicValid()) return false;
if (!txtMINC.Text.Trim().Equals(""))
{
double result = 0;
try
{
result = double.Parse(txtMINC.Text.Trim());
}
catch
{
ShowMessage("最小值必须是数字!");
return false;
}
if (result > txtYZZ.Value)
{
ShowMessage("因子值小于最小值,不允许保存!");
return false;
}
}
if (!txtMAXC.Text.Trim().Equals(""))
{
double result = 0;
try
{
result = double.Parse(txtMAXC.Text.Trim());
}
catch
{
ShowMessage("最大值必须是数字!");
return false;
}
if (result < txtYZZ.Value)
{
ShowMessage("因子值大于最大值,不允许保存!");
return false;
}
}
return true;
}
protected override bool Master_BeforeSaveAction(object sender, EventArgs e)
{
if (!base.Master_BeforeSaveAction(sender, e)) return false;
txtWHR.Text = tSession.UserName;
txtWHRID.Value = tSession.UserId;
datWHSJ.Text = CMISproConvert.ConvertTime(System.DateTime.Now);
return true;
}
#endregion
#region 自定义函数
private void InitControls()
{
cbxJJFS.ClearItems();
cbxJJFS.Items.Add(new ListItem("乘以(1+加点(%))", "JD"));
cbxJJFS.Items.Add(new ListItem("加价(元)", "JJ"));
cbxJJFS.Items.Add(new ListItem("除以(1-扣点(%))", "KD"));
cbxJJFS.Items.Add(new ListItem("乘以(系数)", "MX"));
cbxJJFS.Items.Add(new ListItem("乘以(%)", "MP"));
cbxJJFS.Items.Add(new ListItem("除以(系数)", "DX"));
cbxJJFS.Items.Add(new ListItem("上点除、下点乘", "SX"));
cbxJJFS.Items.Add(new ListItem("乘以(1-下点(%))", "MD"));
cbxJJFS.Items.Add(new ListItem("除以(1+上点(%))", "DD"));
cbxJJFS.ShowValue = false;
string sJJFS = PageParam.GetRTrimString("JJFS");
if (sJJFS.Equals("JJ"))
{
txtYZZ.DecimalPlaces = 2;
}
else if (sJJFS.Equals("MX") || sJJFS.Equals("DX"))
{
txtYZZ.DecimalPlaces = 4;
}
else
{
txtYZZ.DecimalPlaces = 2;
}
}
#endregion
#region 控件事件
#endregion
}
}