2026821
This commit is contained in:
@@ -0,0 +1,529 @@
|
||||
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;
|
||||
using GThinking.N_CONTROL;
|
||||
|
||||
namespace GThinking.N_XLXSBJ
|
||||
{
|
||||
public partial class TZYZBJBInfo : SingleCardBase
|
||||
{
|
||||
TZYZBJ_YZZB entity = new TZYZBJ_YZZB();
|
||||
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
this.UMID = 100860054;
|
||||
this.UMName = "按销售单位调报价";
|
||||
this.CurMaster = Master;
|
||||
this.CurEntity = entity;
|
||||
this.PageHeight = 400;
|
||||
this.PageWidth = 600;
|
||||
|
||||
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='B' 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("XLXSBJDYZZB", 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='B' 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(XLXSBJDYZZB_YZID, '{0}', XLXSBJDYZZB_YZZ, 0)) as TZYZ_{0}", ds.Tables[0].Rows[i][0].ToString().Trim()));
|
||||
}
|
||||
sSQL.Text = "select 1" + sSQL.Text + " from XLXSBJDYZZB where XLXSBJDYZZB_JGBID='" + txtJGBID.Value.Trim() + "' and XLXSBJDYZZB_SYDWID= '" + cbxSYDWID.SelectedValue.Trim() + "'";
|
||||
AddUserReportSQL("XLXSBJDYZZB", sSQL);
|
||||
base.ReportRecordSetAdd();
|
||||
}
|
||||
|
||||
|
||||
protected override void SetControlState()
|
||||
{
|
||||
base.SetControlState();
|
||||
|
||||
txtWHR.Enabled = false;
|
||||
datWHSJ.Enabled = false;
|
||||
cbxSYDWID.Enabled = false;
|
||||
|
||||
# region 给调价因子控件设只读性
|
||||
if (ControlState == TControlState.ctsInsert || ControlState == TControlState.ctsCopy || ControlState == TControlState.ctsEdit)
|
||||
{
|
||||
cbxSYDWID.Enabled = true;
|
||||
for (int i = 1; i <= 20; i++)
|
||||
{
|
||||
gtNumTextBox txtTJYZ = (gtNumTextBox)Master.ContentFormControl.FindControl("txt" + "TJYZ" + i);
|
||||
|
||||
|
||||
HtmlTableRow tr = (HtmlTableRow)tableYZ.FindControl("trTJYZ"+i);
|
||||
HtmlTableRow tr2 = (HtmlTableRow)tableYZ.FindControl("tr" + i);
|
||||
|
||||
if (tr != null)
|
||||
{
|
||||
|
||||
tr.Visible=false;
|
||||
tr2.Visible=false;
|
||||
}
|
||||
|
||||
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());
|
||||
gtTextBox txtTJYZMINC = (gtTextBox)Master.ContentFormControl.FindControl("txt" + "MINCTJYZ" + j.ToString().Trim());
|
||||
gtTextBox txtTJYZMAXC = (gtTextBox)Master.ContentFormControl.FindControl("txt" + "MAXCTJYZ" + j.ToString().Trim());
|
||||
if (sTJYZList[i].StartsWith(sTZYZID))
|
||||
{
|
||||
txtTJYZ.Enabled = true;
|
||||
txtTJYZMINC.Enabled = true;
|
||||
txtTJYZMAXC.Enabled = true;
|
||||
HtmlTableRow tr = (HtmlTableRow)tableYZ.FindControl("trTJYZ" + j);
|
||||
HtmlTableRow tr2 = (HtmlTableRow)tableYZ.FindControl("tr" + j);
|
||||
|
||||
|
||||
if (tr != null)
|
||||
{
|
||||
|
||||
tr.Visible = true;
|
||||
tr2.Visible = true;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (int i = 1; i <= 20; i++)
|
||||
{
|
||||
gtNumTextBox txtTJYZ = (gtNumTextBox)Master.ContentFormControl.FindControl("txt" + "TJYZ" + i);
|
||||
|
||||
|
||||
HtmlTableRow tr = (HtmlTableRow)tableYZ.FindControl("trTJYZ" + i);
|
||||
HtmlTableRow tr2 = (HtmlTableRow)tableYZ.FindControl("tr" + i);
|
||||
|
||||
if (tr != null)
|
||||
{
|
||||
|
||||
tr.Visible = false;
|
||||
tr2.Visible = false;
|
||||
}
|
||||
|
||||
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());
|
||||
gtTextBox txtTJYZMINC = (gtTextBox)Master.ContentFormControl.FindControl("txt" + "MINCTJYZ" + j.ToString().Trim());
|
||||
gtTextBox txtTJYZMAXC = (gtTextBox)Master.ContentFormControl.FindControl("txt" + "MAXCTJYZ" + j.ToString().Trim());
|
||||
if (sTJYZList[i].StartsWith(sTZYZID))
|
||||
{
|
||||
txtTJYZ.Enabled = false;
|
||||
txtTJYZMINC.Enabled = false;
|
||||
txtTJYZMAXC.Enabled = false;
|
||||
HtmlTableRow tr = (HtmlTableRow)tableYZ.FindControl("trTJYZ" + j);
|
||||
HtmlTableRow tr2 = (HtmlTableRow)tableYZ.FindControl("tr" + j);
|
||||
|
||||
if (tr != null)
|
||||
{
|
||||
|
||||
tr.Visible = true;
|
||||
tr2.Visible = true;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
||||
protected override void LoadRecord()
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
entity.Param.Add("XLXSBJDYZZB_JGBID", PageParam.GetRTrimString("XLXSBJDYZZB_JGBID"));
|
||||
entity.Param.Add("XLXSBJDYZZB_SYDWID", PageParam.GetRTrimString("XLXSBJDYZZB_SYDWID"));
|
||||
entity.Param.Add("XLXSBJDYZZB_YZID", PageParam.GetRTrimString("XLXSBJDYZZB_YZID"));
|
||||
}
|
||||
else
|
||||
{
|
||||
entity.Param.Add("XLXSBJDYZZB_JGBID", txtJGBID.Value.Trim());
|
||||
entity.Param.Add("XLXSBJDYZZB_SYDWID", txtOLD_SYDWID.Value.Trim());
|
||||
entity.Param.Add("XLXSBJDYZZB_YZID", txtYZID.Value.Trim());
|
||||
}
|
||||
base.LoadRecord();
|
||||
txtOLD_SYDWID.Value = cbxSYDWID.SelectedValue.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, XLXSBJDYZZ{0}_MINC, XLXSBJDYZZ{0}_MAXC from XLXSBJDYZZ{0} ", 'B'));
|
||||
sql.Add(string.Format(" where XLXSBJDYZZ{0}_JGBID=:pJGBID and XLXSBJDYZZ{0}_SYDWID=:pSYDWID order by XLXSBJDYZZ{0}_YZID", 'B'));
|
||||
sql.ParamByName("pJGBID").Value = txtJGBID.Value.Trim();
|
||||
sql.ParamByName("pSYDWID").Value = cbxSYDWID.SelectedValue.Trim();
|
||||
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());
|
||||
string sMINC = ds.Tables[0].Rows[i][2].ToString().Trim();
|
||||
string sMAXC = ds.Tables[0].Rows[i][3].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());
|
||||
gtTextBox txtTJYZMINC = (gtTextBox)Master.ContentFormControl.FindControl("txt" + "MINCTJYZ" + j.ToString().Trim());
|
||||
gtTextBox txtTJYZMAXC = (gtTextBox)Master.ContentFormControl.FindControl("txt" + "MAXCTJYZ" + j.ToString().Trim());
|
||||
if (sYZID.Equals(sTZYZID))
|
||||
{
|
||||
txtTJYZ.Value = dYZZ;
|
||||
txtTJYZMINC.Text = sMINC;
|
||||
txtTJYZMAXC.Text = sMAXC;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
||||
protected override void OnNewRecorder()
|
||||
{
|
||||
base.OnNewRecorder();
|
||||
txtJGBID.Value = PageParam.GetRTrimString("XLXSBJDYZZB_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("XLXSBJDYZZB_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;
|
||||
TDatabase dberp = TContextDatabases.GetDatabase("DBERP");
|
||||
TSQL sql = new TSQL(dberp);
|
||||
string[] sTJYZList = PageParam.GetRTrimString("TJYZList").Split(',');
|
||||
for (int i = 0; i < sTJYZList.Length; i++)
|
||||
{
|
||||
double dYZZXX = 0;
|
||||
double dYZZSX = 0;
|
||||
double dYZZ = 0;
|
||||
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))
|
||||
{
|
||||
dYZZ = txtTJYZ.Value;
|
||||
break;
|
||||
}
|
||||
}
|
||||
TZYZBJInfo.GetTJBYZZFW(sTJYZList[i].Split('|')[0], ref dYZZXX, ref dYZZSX);
|
||||
if (dYZZXX > 0)
|
||||
{
|
||||
if (dYZZXX > dYZZ)
|
||||
{
|
||||
ShowMessage("因子值不允许小于调价表最小因子值" + dYZZXX.ToString().Trim() + "!");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (dYZZSX > 0)
|
||||
{
|
||||
if (dYZZSX < dYZZ)
|
||||
{
|
||||
ShowMessage("因子值不允许大于调价表最大因子值" + dYZZSX.ToString().Trim() + "!");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (ControlState == TControlState.ctsInsert || ControlState == TControlState.ctsCopy)
|
||||
{
|
||||
sql.Clear();
|
||||
sql.Add("select XLXSBJDYZZB_SYDWID ");
|
||||
sql.Add("from XLXSBJDYZZB ");
|
||||
sql.Add("where XLXSBJDYZZB_JGBID=:pJGBID and XLXSBJDYZZB_YZID=:pYZID and XLXSBJDYZZB_SYDWID =:pSYDWID ");
|
||||
sql.ParamByName("pJGBID").Value = txtJGBID.Value.Trim();
|
||||
sql.ParamByName("pYZID").Value = sTJYZList[i].Split('|')[0];
|
||||
sql.ParamByName("pSYDWID").Value = cbxSYDWID.SelectedValue.Trim();
|
||||
DataSet ds = dberp.OpenDataSet(sql);
|
||||
if (ds.Tables[0].Rows.Count > 0)
|
||||
{
|
||||
string sResult = GetSYDWMC(ds.Tables[0].Rows[0]["XLXSBJDYZZB_SYDWID"].ToString().Trim());
|
||||
ShowMessage(string.Format("因子{0}已经维护了{1}销售单位,不允许保存!", sTJYZList[i].Replace("(X)", ""), sResult));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!txtOLD_SYDWID.Value.Trim().Equals(cbxSYDWID.SelectedValue.Trim()))
|
||||
{
|
||||
sql.Clear();
|
||||
sql.Add("select XLXSBJDYZZB_SYDWID ");
|
||||
sql.Add("from XLXSBJDYZZB ");
|
||||
sql.Add("where XLXSBJDYZZB_JGBID=:pJGBID and XLXSBJDYZZB_YZID=:pYZID and XLXSBJDYZZB_SYDWID =:pSYDWID ");
|
||||
sql.ParamByName("pJGBID").Value = txtJGBID.Value.Trim();
|
||||
sql.ParamByName("pYZID").Value = sTJYZList[i].Split('|')[0];
|
||||
sql.ParamByName("pSYDWID").Value = cbxSYDWID.SelectedValue.Trim();
|
||||
DataSet ds = dberp.OpenDataSet(sql);
|
||||
if (ds.Tables[0].Rows.Count > 0)
|
||||
{
|
||||
string sResult = GetSYDWMC(ds.Tables[0].Rows[0]["XLXSBJDYZZB_SYDWID"].ToString().Trim());
|
||||
ShowMessage(string.Format("因子{0}已经维护了{1}销售单位,不允许保存!", sTJYZList[i].Replace("(X)", ""), sResult));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
for (int i = 0; i < sTJYZList.Length; i++)
|
||||
{
|
||||
for (int j = 1; j <= 20; j++)
|
||||
{
|
||||
string sTZYZID = "BJ" + j.ToString().PadLeft(2, '0') + "|";
|
||||
double result = 0;
|
||||
gtNumTextBox txtTJYZ = (gtNumTextBox)Master.ContentFormControl.FindControl("txt" + "TJYZ" + j.ToString().Trim());
|
||||
gtTextBox txtTJYZMINC = (gtTextBox)Master.ContentFormControl.FindControl("txt" + "MINCTJYZ" + j.ToString().Trim());
|
||||
gtTextBox txtTJYZMAXC = (gtTextBox)Master.ContentFormControl.FindControl("txt" + "MAXCTJYZ" + j.ToString().Trim());
|
||||
if (!txtTJYZMINC.Text.Trim().Equals(""))
|
||||
{
|
||||
try
|
||||
{
|
||||
result = double.Parse(txtTJYZMINC.Text.Trim());
|
||||
}
|
||||
catch
|
||||
{
|
||||
ShowMessage("最小值必须是数字!");
|
||||
return false;
|
||||
}
|
||||
if (sTJYZList[i].StartsWith(sTZYZID))
|
||||
{
|
||||
if (result > txtTJYZ.Value)
|
||||
{
|
||||
ShowMessage("因子值小于最小值,不允许保存!");
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
if (!txtTJYZMAXC.Text.Trim().Equals(""))
|
||||
{
|
||||
try
|
||||
{
|
||||
result = double.Parse(txtTJYZMAXC.Text.Trim());
|
||||
}
|
||||
catch
|
||||
{
|
||||
ShowMessage("最大值必须是数字!");
|
||||
return false;
|
||||
}
|
||||
if (sTJYZList[i].StartsWith(sTZYZID))
|
||||
{
|
||||
if (result < txtTJYZ.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;
|
||||
}
|
||||
|
||||
protected override bool Master_AfterSaveAction(object sender, EventArgs e)
|
||||
{
|
||||
txtOLD_SYDWID.Value = cbxSYDWID.SelectedValue.Trim();
|
||||
txtYZID.Value = PageParam.GetRTrimString("FirstYZID");
|
||||
|
||||
string sJGBID = txtJGBID.Value.Trim();
|
||||
string sSYDWID = cbxSYDWID.SelectedValue.Trim();
|
||||
# region 将调价因子控件值更新至数据库中
|
||||
TDatabase dberp = TContextDatabases.GetDatabase("DBERP");
|
||||
TSQL sql = new TSQL(dberp);
|
||||
sql.Clear();
|
||||
dberp.ExecSQL(string.Format("delete from XLXSBJDYZZ{0} where XLXSBJDYZZ{0}_JGBID='{1}' and XLXSBJDYZZ{0}_SYDWID='{2}' ", 'B', sJGBID, sSYDWID));
|
||||
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}_SYDWID,XLXSBJDYZZ{0}_MINC,XLXSBJDYZZ{0}_MAXC, XLXSBJDYZZ{0}_YZID, XLXSBJDYZZ{0}_YZZ, XLXSBJDYZZ{0}_WHR, XLXSBJDYZZ{0}_WHRID, XLXSBJDYZZ{0}_WHSJ)", 'B'));
|
||||
sql.Add(string.Format(" values(:pJGBID,:SYDWID,:pMINC,:pMAXC,:pYZID,:pYZZ,:pWHR,:pWHRID,:pWHSJ)"));
|
||||
sql.ParamByName("pJGBID").Value = sJGBID;
|
||||
sql.ParamByName("SYDWID").Value = sSYDWID;
|
||||
|
||||
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());
|
||||
gtTextBox txtTJYZMINC = (gtTextBox)Master.ContentFormControl.FindControl("txt" + "MINCTJYZ" + j.ToString().Trim());
|
||||
gtTextBox txtTJYZMAXC = (gtTextBox)Master.ContentFormControl.FindControl("txt" + "MAXCTJYZ" + j.ToString().Trim());
|
||||
if (sTJYZList[i].StartsWith(sTZYZID))
|
||||
{
|
||||
sql.ParamByName("pYZID").Value = sTZYZID.TrimEnd('|');
|
||||
sql.ParamByName("pYZZ").Value = txtTJYZ.Value;
|
||||
sql.ParamByName("pMINC").Value = txtTJYZMINC.Text.Trim();
|
||||
sql.ParamByName("pMAXC").Value = txtTJYZMAXC.Text.Trim();
|
||||
dberp.ExecSQL(sql);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
return base.Master_AfterSaveAction(sender, e);
|
||||
}
|
||||
|
||||
protected override void SetComboxItems()
|
||||
{
|
||||
TComboBox.SetComboBox("DBERP", cbxSYDWID, "select GS_SYDWID,GS_GSMC from GS where 1=1 order by GS_SYDWID", false);
|
||||
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;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private string GetSYDWMC(string sSYDWID)
|
||||
{
|
||||
string sSYDWMC = "";
|
||||
TDatabase dberp = TContextDatabases.GetDatabase("DBERP");
|
||||
TSQL sSQL = new TSQL(dberp);
|
||||
sSQL.Clear();
|
||||
sSQL.Add("select GS_SYDWID,GS_GSMC from GS where GS_SYDWID =:pSYDWID ");
|
||||
sSQL.ParamByName("pSYDWID").Value = sSYDWID;
|
||||
DataSet ds = dberp.OpenDataSet(sSQL);
|
||||
if (ds.Tables[0].Rows.Count > 0)
|
||||
{
|
||||
sSYDWMC = ds.Tables[0].Rows[0]["GS_GSMC"].ToString().Trim();
|
||||
}
|
||||
if (!sSYDWID.Equals(""))
|
||||
{
|
||||
sSYDWMC = sSYDWID + "|" + sSYDWMC;
|
||||
}
|
||||
return sSYDWMC;
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user