提交所有文件
This commit is contained in:
+29
-17
@@ -76,7 +76,7 @@ namespace GThinking.N_XLXSBJ
|
||||
{
|
||||
sSQL.Add(string.Format(",sum(decode(XLXSJGBYZZC_YZID, '{0}', XLXSJGBYZZC_YZZ, 0)) as TZYZ_{0}", ds.Tables[0].Rows[i][0].ToString().Trim()));
|
||||
}
|
||||
sSQL.Text = "select 1" + sSQL.Text + " from XLXSJGBYZZC where XLXSJGBYZZC_JGBID='" + txtJGBID.Value.Trim() + "' and XLXSJGBYZZC_CPTX='" + cbxCPTX.SelectedValue.Trim() + "' ";
|
||||
sSQL.Text = "select 1" + sSQL.Text + " from XLXSJGBYZZC where XLXSJGBYZZC_JGBID='" + txtJGBID.Value.Trim() + "' and XLXSJGBYZZC_CPTX='" + cbxCPTX.SelectedValue.Trim() + "' and XLXSJGBYZZC_ZXJM="+txtZXJM.Value.ToString();
|
||||
AddUserReportSQL("XLXSJGBYZZC", sSQL);
|
||||
base.ReportRecordSetAdd();
|
||||
}
|
||||
@@ -161,6 +161,7 @@ namespace GThinking.N_XLXSBJ
|
||||
{
|
||||
entity.Param.Add("XLXSJGBYZZC_JGBID", PageParam.GetRTrimString("XLXSJGBYZZC_JGBID"));
|
||||
entity.Param.Add("XLXSJGBYZZC_CPTX", PageParam.GetRTrimString("XLXSJGBYZZC_CPTX"));
|
||||
entity.Param.Add("XLXSJGBYZZC_ZXJM", PageParam.GetRTrimString("XLXSJGBYZZC_ZXJM"));
|
||||
|
||||
entity.Param.Add("XLXSJGBYZZC_YZID", PageParam.GetRTrimString("XLXSJGBYZZC_YZID"));
|
||||
}
|
||||
@@ -168,6 +169,7 @@ namespace GThinking.N_XLXSBJ
|
||||
{
|
||||
entity.Param.Add("XLXSJGBYZZC_JGBID", txtJGBID.Value.Trim());
|
||||
entity.Param.Add("XLXSJGBYZZC_CPTX", txtOLD_CPTX.Value.Trim());
|
||||
entity.Param.Add("XLXSJGBYZZC_ZXJM", txtOLD_ZXJM.Value.Trim());
|
||||
|
||||
entity.Param.Add("XLXSJGBYZZC_YZID", txtYZID.Value.Trim());
|
||||
}
|
||||
@@ -175,13 +177,16 @@ namespace GThinking.N_XLXSBJ
|
||||
|
||||
txtOLD_CPTX.Value = cbxCPTX.SelectedValue.Trim();
|
||||
|
||||
txtOLD_ZXJM.Value = txtZXJM.Value.ToString();
|
||||
|
||||
# region 给调价因子控件赋值
|
||||
TDatabase dberp = TContextDatabases.GetDatabase("DBERP");
|
||||
TSQL sql = new TSQL(dberp);
|
||||
sql.Add("select XLXSJGBYZZC_YZID, XLXSJGBYZZC_YZZ, XLXSJGBYZZC_WHR, XLXSJGBYZZC_WHRID, XLXSJGBYZZC_WHSJ from XLXSJGBYZZC ");
|
||||
sql.Add("where XLXSJGBYZZC_JGBID=:pJGBID and XLXSJGBYZZC_CPTX=:pCPTX order by XLXSJGBYZZC_YZID");
|
||||
sql.Add("where XLXSJGBYZZC_JGBID=:pJGBID and XLXSJGBYZZC_CPTX=:pCPTX and XLXSJGBYZZC_ZXJM=:pZXJM order by XLXSJGBYZZC_YZID");
|
||||
sql.ParamByName("pJGBID").Value = txtJGBID.Value.Trim();
|
||||
sql.ParamByName("pCPTX").Value = cbxCPTX.SelectedValue.Trim();
|
||||
sql.ParamByName("pZXJM").Value = txtZXJM.Value;
|
||||
|
||||
DataSet ds = dberp.OpenDataSet(sql);
|
||||
for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
|
||||
@@ -256,6 +261,10 @@ namespace GThinking.N_XLXSBJ
|
||||
{
|
||||
cbxCPTX.SelectedValue = PageParam.GetRTrimString("XLXSJGBYZZC_CPTX");
|
||||
}
|
||||
if (!PageParam.GetRTrimString("XLXSJGBYZZC_ZXJM").Equals(""))
|
||||
{
|
||||
txtZXJM.Value = CMISproConvert.StrToFloat(PageParam.GetRTrimString("XLXSJGBYZZC_ZXJM"));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -278,8 +287,8 @@ namespace GThinking.N_XLXSBJ
|
||||
|
||||
if (ControlState == TControlState.ctsInsert || ControlState == TControlState.ctsCopy)
|
||||
{
|
||||
if (CMISproDataBase.ExistsRecord("DBERP", string.Format("select 1 from XLXSJGBYZZC where XLXSJGBYZZC_JGBID='{0}' and XLXSJGBYZZC_CPTX='{1}' and XLXSJGBYZZC_YZID='{2}'",
|
||||
txtJGBID.Value.Trim(), cbxCPTX.SelectedValue.Trim(), sTJYZList[i].Split('|')[0])))
|
||||
if (CMISproDataBase.ExistsRecord("DBERP", string.Format("select 1 from XLXSJGBYZZC where XLXSJGBYZZC_JGBID='{0}' and XLXSJGBYZZC_CPTX='{1}' and XLXSJGBYZZC_ZXJM={2} and XLXSJGBYZZC_YZID='{3}'",
|
||||
txtJGBID.Value.Trim(), cbxCPTX.SelectedValue.Trim(),txtZXJM.Value.ToString(), sTJYZList[i].Split('|')[0])))
|
||||
{
|
||||
ShowMessage("已存在编号相同的记录,不允许保存!");
|
||||
return false;
|
||||
@@ -287,10 +296,10 @@ namespace GThinking.N_XLXSBJ
|
||||
}
|
||||
else
|
||||
{
|
||||
if (CMISproDataBase.ExistsRecord("DBERP", string.Format(@"select 1 from XLXSJGBYZZC where XLXSJGBYZZC_JGBID='{0}' and XLXSJGBYZZC_CPTX='{1}' and XLXSJGBYZZC_YZID='{3}'
|
||||
and XLXSJGBYZZC_CPTX<>'{2}' ",
|
||||
txtJGBID.Value.Trim(), cbxCPTX.SelectedValue.Trim(),
|
||||
txtOLD_CPTX.Value.Trim(), sTJYZList[i].Split('|')[0])))
|
||||
if (CMISproDataBase.ExistsRecord("DBERP", string.Format(@"select 1 from XLXSJGBYZZC where XLXSJGBYZZC_JGBID='{0}' and XLXSJGBYZZC_CPTX='{1}' and XLXSJGBYZZC_ZXJM={2} and XLXSJGBYZZC_YZID='{3}'
|
||||
and XLXSJGBYZZC_CPTX<>'{4}' and XLXSJGBYZZC_ZXJM<>{5} ",
|
||||
txtJGBID.Value.Trim(), cbxCPTX.SelectedValue.Trim(),txtZXJM.Value.ToString(),
|
||||
sTJYZList[i].Split('|')[0],txtOLD_CPTX.Value.Trim(),txtOLD_ZXJM.Value.Trim())))
|
||||
{
|
||||
ShowMessage("已存在编号相同的记录,不允许保存!");
|
||||
return false;
|
||||
@@ -308,7 +317,7 @@ namespace GThinking.N_XLXSBJ
|
||||
protected override bool Master_BeforeDeleteAction(object sender, EventArgs e)
|
||||
{
|
||||
string sYZIDlist = TZYZBJAInfo.GetYZIDList(PageParam.GetRTrimString("TJYZList"));
|
||||
entity.EntityTable.DeleteSql = " delete from XLXSJGBYZZC where XLXSJGBYZZC_JGBID=:XLXSJGBYZZC_JGBID and XLXSJGBYZZC_CPTX =:XLXSJGBYZZC_CPTX and "
|
||||
entity.EntityTable.DeleteSql = " delete from XLXSJGBYZZC where XLXSJGBYZZC_JGBID=:XLXSJGBYZZC_JGBID and XLXSJGBYZZC_CPTX =:XLXSJGBYZZC_CPTX and XLXSJGBYZZC_ZXJM =:XLXSJGBYZZC_ZXJM and "
|
||||
+ CMISproDataBase.GetWhereEqual("XLXSJGBYZZC_YZID", sYZIDlist);
|
||||
return base.Master_BeforeDeleteAction(sender, e);
|
||||
}
|
||||
@@ -319,9 +328,9 @@ namespace GThinking.N_XLXSBJ
|
||||
|
||||
string sYZIDlist = TZYZBJAInfo.GetYZIDList(PageParam.GetRTrimString("TJYZList"));
|
||||
entity.EntityTable.UpdateSql = " update XLXSJGBYZZC "
|
||||
+ " set XLXSJGBYZZC_CPTX= :XLXSJGBYZZC_CPTX "
|
||||
+ " set XLXSJGBYZZC_CPTX= :XLXSJGBYZZC_CPTX,XLXSJGBYZZC_ZXJM=:XLXSJGBYZZC_ZXJM "
|
||||
|
||||
+ " where XLXSJGBYZZC_JGBID=:XLXSJGBYZZC_JGBID and XLXSJGBYZZC_CPTX =:OLD_XLXSJGBYZZC_CPTX "
|
||||
+ " where XLXSJGBYZZC_JGBID=:XLXSJGBYZZC_JGBID and XLXSJGBYZZC_CPTX =:OLD_XLXSJGBYZZC_CPTX and XLXSJGBYZZC_ZXJM=:OLD_XLXSJGBYZZC_ZXJM"
|
||||
+ " and " + CMISproDataBase.GetWhereEqual("XLXSJGBYZZC_YZID", sYZIDlist);
|
||||
|
||||
txtWHR.Text = tSession.UserName;
|
||||
@@ -334,27 +343,30 @@ namespace GThinking.N_XLXSBJ
|
||||
protected override bool Master_AfterSaveAction(object sender, EventArgs e)
|
||||
{
|
||||
txtOLD_CPTX.Value = cbxCPTX.SelectedValue.Trim();
|
||||
txtOLD_ZXJM.Value = txtZXJM.Value.ToString();
|
||||
txtYZID.Value = PageParam.GetRTrimString("FirstYZID");
|
||||
|
||||
string sJGBID = txtJGBID.Value.Trim();
|
||||
string sCPTX = cbxCPTX.SelectedValue.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 XLXSJGBYZZC where XLXSJGBYZZC_JGBID='{0}' and XLXSJGBYZZC_CPTX='{1}' and " + CMISproDataBase.GetWhereEqual("XLXSJGBYZZC_YZID", sYZIDlist)
|
||||
, sJGBID, sCPTX));
|
||||
dberp.ExecSQL(string.Format("delete from XLXSJGBYZZC where XLXSJGBYZZC_JGBID='{0}' and XLXSJGBYZZC_CPTX='{1}' and XLXSJGBYZZC_ZXJM={2} and " + CMISproDataBase.GetWhereEqual("XLXSJGBYZZC_YZID", sYZIDlist)
|
||||
, sJGBID, sCPTX,txtZXJM.Value.ToString()));
|
||||
|
||||
string[] sTJYZList = PageParam.GetRTrimString("TJYZList").Split(',');
|
||||
DateTime tNow = DateTime.Now;
|
||||
for (int i = 0; i < sTJYZList.Length; i++)
|
||||
{
|
||||
sql.Clear();
|
||||
sql.Add("insert into XLXSJGBYZZC(XLXSJGBYZZC_JGBID,XLXSJGBYZZC_CPTX,XLXSJGBYZZC_YZID,XLXSJGBYZZC_YZZ,XLXSJGBYZZC_WHR,XLXSJGBYZZC_WHRID,XLXSJGBYZZC_WHSJ)");
|
||||
sql.Add(" values(:pJGBID,:pCPTX,:pYZID,:pYZZ,:pWHR,:pWHRID,:pWHSJ)");
|
||||
sql.Add("insert into XLXSJGBYZZC(XLXSJGBYZZC_JGBID,XLXSJGBYZZC_CPTX,XLXSJGBYZZC_ZXJM,XLXSJGBYZZC_YZID,XLXSJGBYZZC_YZZ,XLXSJGBYZZC_WHR,XLXSJGBYZZC_WHRID,XLXSJGBYZZC_WHSJ)");
|
||||
sql.Add(" values(:pJGBID,:pCPTX,:pZXJM,:pYZID,:pYZZ,:pWHR,:pWHRID,:pWHSJ)");
|
||||
sql.ParamByName("pJGBID").Value = sJGBID;
|
||||
sql.ParamByName("pCPTX").Value = sCPTX;
|
||||
sql.ParamByName("pZXJM").Value = txtZXJM.Value;
|
||||
sql.ParamByName("pWHR").Value = tSession.UserName;
|
||||
sql.ParamByName("pWHRID").Value = tSession.UserId;
|
||||
sql.ParamByName("pWHSJ").Value = tNow;
|
||||
@@ -426,8 +438,8 @@ namespace GThinking.N_XLXSBJ
|
||||
|
||||
protected override void SetComboxItems()
|
||||
{
|
||||
TComboBox.SetComboBox("DBERP", cbxCPTX, "select distinct XLXSBJCPYS_XXJGID as ID, XLXSBJCPYS_XXJGID as Name from XLXSBJCPYS where 1=1 order by XLXSBJCPYS_XXJGID ", false);
|
||||
|
||||
TComboBox.SetComboBox("DBERP", cbxCPTX, "select distinct XLXHB_XLTXID as ID, XLXHB_XLTXID as Name from XLXHB where 1=1 and isnull(XLXHB_XLTXID,' ')<>' ' order by XLXHB_XLTXID ", false);
|
||||
|
||||
base.SetComboxItems();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user