516 lines
22 KiB
C#
516 lines
22 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_CONTROL;
|
|
using GThinking.N_PUBLIC;
|
|
using System.Collections.Generic;
|
|
using GThinking.N_MISPRO.MISPROAS;
|
|
|
|
namespace GThinking.N_XLXSBJ
|
|
{
|
|
public partial class JGCZB_TZBJCLList : OperationBase
|
|
{
|
|
JGCZB_TZBJCL entity = new JGCZB_TZBJCL();
|
|
|
|
protected void Page_Load(object sender, EventArgs e)
|
|
{
|
|
this.UMID = 100860020;
|
|
this.UMName = "线缆销售报价结构尺重表";
|
|
this.CurMaster = Master;
|
|
this.Tabs = Tab;
|
|
this.PageHeight = 600;
|
|
this.PageWidth = 750;
|
|
AddListSetMap(new ListSet(pagSHD.ID, null, grdSHD, entity, UPSHD));
|
|
|
|
if (!IsPostBack)
|
|
{
|
|
this.Master.PnlQuery.GroupingText = "查询条件";
|
|
this.Master.PnlQuery.Visible = false;
|
|
this.Master.PnlBill.GroupingText = "查询条件";
|
|
|
|
InitControls();
|
|
}
|
|
|
|
CustomPageSize = 1000;
|
|
base.InitPage();
|
|
|
|
entity.sCZBLX = PageParam.GetRTrimString("CZBLX");
|
|
if (!IsPostBack)
|
|
{
|
|
entity.sCLYLPSQK = "Y";
|
|
chkYPSCLYL.Checked = true;
|
|
txtTZQBJCLMC_OnTextChanged(null, null);
|
|
}
|
|
}
|
|
|
|
#region 模板继承事件
|
|
|
|
protected override void Master_OnQuery()
|
|
{
|
|
if (chkYPSCLYL.Checked)
|
|
entity.sCLYLPSQK = "Y";
|
|
else
|
|
entity.sCLYLPSQK = "N";
|
|
entity.sCZBLX = PageParam.GetRTrimString("CZBLX");
|
|
if (!IsPostBack)
|
|
{
|
|
entity.sTZQBJCL = cbxTZQBJCL.SelectedValue.Trim();
|
|
base.Master_OnQuery();
|
|
}
|
|
else
|
|
{
|
|
if (!cbxCZBLMMC.SelectedValue.Trim().Equals(""))
|
|
{
|
|
entity.sCZBLMMC = cbxCZBLMMC.SelectedValue.Trim();
|
|
base.Master_OnQuery();
|
|
}
|
|
else
|
|
{
|
|
if (!cbxTZQBJCL.SelectedValue.Trim().Equals("") && !cbxTZHBJCL.SelectedValue.Trim().Equals(""))
|
|
{
|
|
entity.sTZQBJCL = cbxTZQBJCL.SelectedValue.Trim();
|
|
base.Master_OnQuery();
|
|
}
|
|
else
|
|
{
|
|
ShowMessage("需把调整前报价材料或者尺重表栏目名称、调整后报价材料设置完整。");
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
protected override void GridDataBind()
|
|
{
|
|
base.GridDataBind();
|
|
btnSelectAll_Click(null, null);
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override bool Master_OnBeforeOK(object sender, EventArgs e)
|
|
{
|
|
|
|
|
|
return base.Master_OnBeforeOK(sender, e);
|
|
}
|
|
|
|
protected override bool DataLogicValid()
|
|
{
|
|
if (!cbxCZBLMMC.SelectedValue.Trim().Equals(""))
|
|
{
|
|
if (cbxTZHBJCL.SelectedValue.Trim().Equals(""))
|
|
{
|
|
ShowMessage("需把调整后报价材料设置完整!");
|
|
return false;
|
|
}
|
|
}
|
|
else
|
|
{
|
|
if (cbxTZQBJCL.SelectedValue.Trim().Equals(""))
|
|
{
|
|
ShowMessage("需把调整前报价材料设置完整!");
|
|
return false;
|
|
}
|
|
if (cbxTZHBJCL.SelectedValue.Trim().Equals(""))
|
|
{
|
|
ShowMessage("需把调整后报价材料设置完整!");
|
|
return false;
|
|
}
|
|
}
|
|
|
|
if (cbxTZHBJCL.SelectedItem.Text.Contains("(停用)"))
|
|
{
|
|
ShowMessage("调整后报价材料已停用!");
|
|
return false;
|
|
}
|
|
|
|
Confirm.ShowBtnText = TConfirm.cBtnText.Yes_No;
|
|
Confirm.Register("IsQD", "将以“调整后报价材料”替换所选尺重表的报价材料,是否继续?");
|
|
Confirm.ShowBtnText = TConfirm.cBtnText.Yes_No;
|
|
if (Confirm.GetValue("IsQD").Trim().Equals(""))
|
|
{
|
|
Confirm.Ask("IsQD");
|
|
return false;
|
|
}
|
|
else if (Confirm.GetValue("IsQD").Trim().Equals("N"))
|
|
{
|
|
Confirm.Clear();
|
|
return false;
|
|
}
|
|
else if (Confirm.GetValue("IsQD").Trim().Equals("Y"))
|
|
{
|
|
Confirm.Clear();
|
|
}
|
|
return base.DataLogicValid();
|
|
}
|
|
|
|
protected override bool Master_OnOK()
|
|
{
|
|
TDatabase DBERP = null;
|
|
try
|
|
{
|
|
DBERP = TContextDatabases.GetDatabase("DBERP");
|
|
DBERP.BeginTrans();
|
|
UpdateXLJGCZBLM(DBERP);
|
|
DBERP.CommitTrans();
|
|
ShowMessage("调整成功!");
|
|
if (chkYPSCLYL.Checked)
|
|
entity.sCLYLPSQK = "Y";
|
|
else
|
|
entity.sCLYLPSQK = "N";
|
|
if (!cbxCZBLMMC.SelectedValue.Trim().Equals(""))
|
|
{
|
|
entity.sCZBLMMC = cbxCZBLMMC.SelectedValue.Trim();
|
|
base.Master_OnQuery();
|
|
}
|
|
else
|
|
{
|
|
entity.sTZQBJCL = cbxTZQBJCL.SelectedValue.Trim();
|
|
base.Master_OnQuery();
|
|
}
|
|
GridDataBind();
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
ShowMessage(ex.Message);
|
|
DBERP.RollbackTrans();
|
|
return false;
|
|
}
|
|
return true;
|
|
}
|
|
|
|
protected override void Grid_RowDataBound(object sender, GridViewRowEventArgs e)
|
|
{
|
|
if (e.Row.RowType == DataControlRowType.DataRow)
|
|
{
|
|
if (grdSHD.GetCellByFieldName("XLJGCZBLM_HLMLX", e.Row).Text.Trim().Equals("Z"))
|
|
grdSHD.GetCellByFieldName("XLJGCZBLM_HLMLX", e.Row).Text = "Z|主行栏目";
|
|
else if (grdSHD.GetCellByFieldName("XLJGCZBLM_HLMLX", e.Row).Text.Trim().Equals("F"))
|
|
grdSHD.GetCellByFieldName("XLJGCZBLM_HLMLX", e.Row).Text = "F|辅行栏目";
|
|
}
|
|
base.Grid_RowDataBound(sender, e);
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region 控件事件
|
|
|
|
protected void cbxTZQBJCL_OnSelectedIndexChanged(object sender, EventArgs e)
|
|
{
|
|
entity.sCZBLX = PageParam.GetRTrimString("CZBLX");
|
|
|
|
string sTZHBJCL = cbxTZHBJCL.SelectedValue.Trim();
|
|
string sSQL = "";
|
|
if (!cbxTZQBJCL.SelectedValue.Trim().Equals(""))
|
|
{
|
|
sSQL = " select XLXSBJCL_BJCLID,XLXSBJCL_BJCLMC || case when isnull(XLXSBJCL_TYBZ,'N')= 'Y' then '(停用)' else ' ' end from XLXSBJCL where 1 = 1 and XLXSBJCL_BJCLID <> '" + cbxTZQBJCL.SelectedValue.Trim() + "' ";
|
|
sSQL += " order by isnull(XLXSBJCL_TYBZ,'N'),XLXSBJCL_BJCLID ";
|
|
}
|
|
else
|
|
{
|
|
sSQL = " select XLXSBJCL_BJCLID,XLXSBJCL_BJCLMC || case when isnull(XLXSBJCL_TYBZ,'N')= 'Y' then '(停用)' else ' ' end from XLXSBJCL where 1 = 1 ";
|
|
sSQL += " order by isnull(XLXSBJCL_TYBZ,'N'),XLXSBJCL_BJCLID ";
|
|
}
|
|
cbxTZHBJCL.ClearItems();
|
|
TComboBox.SetComboBox("DBERP", cbxTZHBJCL, sSQL, false);
|
|
cbxTZHBJCL.SelectedValue = sTZHBJCL;
|
|
if (cbxTZQBJCL.SelectedValue.Trim().Equals(cbxTZHBJCL.SelectedValue.Trim()))
|
|
{
|
|
cbxTZHBJCL.SelectedValue = "";
|
|
}
|
|
if (chkYPSCLYL.Checked)
|
|
entity.sCLYLPSQK = "Y";
|
|
else
|
|
entity.sCLYLPSQK = "N";
|
|
if (!cbxTZHBJCL.SelectedValue.Equals(""))
|
|
{
|
|
Master_OnQuery();
|
|
GridDataBind();
|
|
}
|
|
else
|
|
{
|
|
entity.sTZQBJCL = cbxTZQBJCL.SelectedValue.Trim();
|
|
base.Master_OnQuery();
|
|
GridDataBind();
|
|
}
|
|
}
|
|
protected void cbxTZHBJCL_OnSelectedIndexChanged(object sender, EventArgs e)
|
|
{
|
|
entity.sCZBLX = PageParam.GetRTrimString("CZBLX");
|
|
if (chkYPSCLYL.Checked)
|
|
entity.sCLYLPSQK = "Y";
|
|
else
|
|
entity.sCLYLPSQK = "N";
|
|
Master_OnQuery();
|
|
GridDataBind();
|
|
}
|
|
|
|
//文本框---调整前
|
|
protected void txtTZQBJCLMC_OnTextChanged(object sender, EventArgs e)
|
|
{
|
|
TDatabase dberp = TContextDatabases.GetDatabase("DBERP");
|
|
TSQL SQL = new TSQL(dberp);
|
|
if (txtTZQBJCLMC.Text.Trim().Equals(""))
|
|
{
|
|
cbxTZQBJCL.Tag = gtComboBox.DTagStates.None;
|
|
cbxCZBLMMC.Tag = gtComboBox.DTagStates.Star;
|
|
cbxTZQBJCL.SelectedValue = "";
|
|
cbxTZQBJCL.ReadOnly = true;
|
|
cbxCZBLMMC.ReadOnly = false;
|
|
|
|
cbxCZBLMMC.ClearItems();
|
|
SQL.Clear();
|
|
SQL.Add(" select distinct XLJGCZBLM_CZBLMMC from XLJGCZBLM where XLJGCZBLM_zdlmlx=4 and isnull(XLJGCZBLM_BJCLID, ' ') = ' ' group by XLJGCZBLM_CZBLMMC ");
|
|
SQL.Add(" order by XLJGCZBLM_CZBLMMC ");
|
|
DataSet ds = dberp.OpenDataSet(SQL);
|
|
for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
|
|
{
|
|
cbxCZBLMMC.Items.Add(new ListItem(ds.Tables[0].Rows[i][0].ToString().Trim()));
|
|
}
|
|
cbxCZBLMMC.ShowValue = false;
|
|
|
|
txtTZHBJCLMC_OnTextChanged(null, null);
|
|
}
|
|
else
|
|
{
|
|
cbxTZQBJCL.Tag = gtComboBox.DTagStates.Star;
|
|
cbxCZBLMMC.Tag = gtComboBox.DTagStates.None;
|
|
|
|
cbxCZBLMMC.SelectedValue = "";
|
|
cbxTZQBJCL.ReadOnly = false;
|
|
cbxCZBLMMC.ReadOnly = true;
|
|
|
|
cbxTZQBJCL.ClearItems();
|
|
SQL.Clear();
|
|
SQL.Add(" select XLXSBJCL_BJCLID,XLXSBJCL_BJCLMC || case when isnull(XLXSBJCL_TYBZ,'N')= 'Y' then '(停用)' else ' ' end from XLXSBJCL ");
|
|
SQL.Add(" where 1 = 1 and XLXSBJCL_BJCLMC like :pBJCLMC");
|
|
SQL.Add(" order by isnull(XLXSBJCL_TYBZ,'N'),XLXSBJCL_BJCLID");
|
|
SQL.ParamByName("pBJCLMC").Value = "%" + txtTZQBJCLMC.Text.Trim() + "%";
|
|
DataSet ds = dberp.OpenDataSet(SQL);
|
|
for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
|
|
{
|
|
cbxTZQBJCL.Items.Add(new ListItem(ds.Tables[0].Rows[i][1].ToString().Trim(), ds.Tables[0].Rows[i][0].ToString().Trim()));
|
|
}
|
|
}
|
|
}
|
|
|
|
protected void txtTZHBJCLMC_OnTextChanged(object sender, EventArgs e)
|
|
{
|
|
TDatabase dberp = TContextDatabases.GetDatabase("DBERP");
|
|
TSQL SQL = new TSQL(dberp);
|
|
if (!txtTZHBJCLMC.Text.Trim().Equals(""))
|
|
{
|
|
cbxTZHBJCL.ClearItems();
|
|
SQL.Clear();
|
|
SQL.Add(" select XLXSBJCL_BJCLID,XLXSBJCL_BJCLMC || case when isnull(XLXSBJCL_TYBZ,'N')= 'Y' then '(停用)' else ' ' end from XLXSBJCL ");
|
|
SQL.Add(" where 1 = 1 and XLXSBJCL_BJCLMC like :pBJCLMC");
|
|
SQL.Add(" order by isnull(XLXSBJCL_TYBZ,'N'),XLXSBJCL_BJCLID");
|
|
SQL.ParamByName("pBJCLMC").Value = "%" + txtTZHBJCLMC.Text.Trim() + "%";
|
|
DataSet ds = dberp.OpenDataSet(SQL);
|
|
for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
|
|
{
|
|
cbxTZHBJCL.Items.Add(new ListItem(ds.Tables[0].Rows[i][1].ToString().Trim(), ds.Tables[0].Rows[i][0].ToString().Trim()));
|
|
}
|
|
}
|
|
else
|
|
{
|
|
cbxTZHBJCL.ClearItems();
|
|
SQL.Clear();
|
|
SQL.Add(" select XLXSBJCL_BJCLID,XLXSBJCL_BJCLMC || case when isnull(XLXSBJCL_TYBZ,'N')= 'Y' then '(停用)' else ' ' end from XLXSBJCL where 1 = 1 ");
|
|
SQL.Add(" order by isnull(XLXSBJCL_TYBZ,'N'),XLXSBJCL_BJCLID ");
|
|
DataSet ds = dberp.OpenDataSet(SQL);
|
|
for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
|
|
{
|
|
cbxTZHBJCL.Items.Add(new ListItem(ds.Tables[0].Rows[i][1].ToString().Trim(), ds.Tables[0].Rows[i][0].ToString().Trim()));
|
|
}
|
|
}
|
|
}
|
|
|
|
protected void cbxCZBLMMC_OnSelectedIndexChanged(object sender, EventArgs e)
|
|
{
|
|
if (chkYPSCLYL.Checked)
|
|
entity.sCLYLPSQK = "Y";
|
|
else
|
|
entity.sCLYLPSQK = "N";
|
|
entity.sCZBLMMC = cbxCZBLMMC.SelectedValue.Trim();
|
|
entity.sCZBLX = PageParam.GetRTrimString("CZBLX");
|
|
base.Master_OnQuery();
|
|
GridDataBind();
|
|
}
|
|
|
|
protected void chkYPSCLYL_OnCheckedChanged(object sender, EventArgs e)
|
|
{
|
|
if (chkYPSCLYL.Checked)
|
|
entity.sCLYLPSQK = "Y";
|
|
else
|
|
entity.sCLYLPSQK = "N";
|
|
|
|
entity.sCZBLMMC = cbxCZBLMMC.SelectedValue.Trim();
|
|
|
|
entity.sCZBLX = PageParam.GetRTrimString("CZBLX");
|
|
|
|
if (cbxTZHBJCL.SelectedValue.Equals(""))
|
|
entity.sTZQBJCL = cbxTZQBJCL.SelectedValue.Trim();
|
|
else if (!cbxTZQBJCL.SelectedValue.Trim().Equals("") && !cbxTZHBJCL.SelectedValue.Trim().Equals(""))
|
|
entity.sTZQBJCL = cbxTZQBJCL.SelectedValue.Trim();
|
|
|
|
base.Master_OnQuery();
|
|
GridDataBind();
|
|
}
|
|
|
|
protected void btnSelectAll_Click(object sender, EventArgs e)
|
|
{
|
|
int j = 0;
|
|
foreach (GridViewRow row in grdSHD.Rows)
|
|
{
|
|
j++;
|
|
}
|
|
string sXZ = "";
|
|
for (int i = 0; i < j; i++)
|
|
{
|
|
sXZ += i.ToString().Trim() + ",";
|
|
}
|
|
grdSHD.CheckedRows = sXZ.TrimEnd(',');
|
|
|
|
FormAreaUpdate();
|
|
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region 自定义函数
|
|
|
|
private void InitControls()
|
|
{
|
|
TComboBox.SetComboBox("DBERP", cbxTZQBJCL, "select XLXSBJCL_BJCLID,XLXSBJCL_BJCLMC || case when isnull(XLXSBJCL_TYBZ,'N')= 'Y' then '(停用)' else ' ' end from XLXSBJCL order by isnull(XLXSBJCL_TYBZ,'N'),XLXSBJCL_BJCLID ", false);
|
|
TComboBox.SetComboBox("DBERP", cbxTZHBJCL, "select XLXSBJCL_BJCLID,XLXSBJCL_BJCLMC || case when isnull(XLXSBJCL_TYBZ,'N')= 'Y' then '(停用)' else ' ' end from XLXSBJCL order by isnull(XLXSBJCL_TYBZ,'N'),XLXSBJCL_BJCLID ", false);
|
|
}
|
|
|
|
private void UpdateXLJGCZBLM(TDatabase dberp)
|
|
{
|
|
TSQL SQL = new TSQL(dberp);
|
|
string sCZBLMMC = cbxCZBLMMC.SelectedValue.Trim();
|
|
string sTZQBJCL = cbxTZQBJCL.SelectedValue.Trim();
|
|
string sTZHBJCL = cbxTZHBJCL.SelectedValue.Trim();
|
|
if (this.grdSHD.CheckBox && !String.IsNullOrEmpty(this.grdSHD.CheckedRows))
|
|
{
|
|
string[] RowsArry = this.grdSHD.CheckedRows.Split(new char[] { ',' });
|
|
foreach (string sRowIndex in RowsArry)
|
|
{
|
|
int iRowIndex = CMISproConvert.StrToInt(sRowIndex.Trim());
|
|
if (sCZBLMMC.Equals(""))
|
|
{
|
|
SQL.Clear();
|
|
SQL.Add(" update XLJGCZBLM ");
|
|
SQL.Add(" set XLJGCZBLM_BJCLID=:pTZHBJCL, ");
|
|
SQL.Add(" XLJGCZBLM_WHR= :pWHR, ");
|
|
SQL.Add(" XLJGCZBLM_WHRID= :pWHRID, ");
|
|
SQL.Add(" XLJGCZBLM_WHSJ= :pWHSJ ");
|
|
SQL.Add(" from XLJGCZBLM ");
|
|
SQL.Add(" where XLJGCZBLM_BJCLID=:pTZQBJCL ");
|
|
SQL.Add(" and XLJGCZBLM_JGCZBID=:pJGCZBID ");
|
|
SQL.Add(" and XLJGCZBLM_JGCZBBBID=:pJGCZBBBID ");
|
|
SQL.Add(" and XLJGCZBLM_CZBLMBH=:pCZBLMBH ");
|
|
SQL.Add(" and XLJGCZBLM_HLMLX=:pHLMLX ");
|
|
|
|
SQL.ParamByName("pTZHBJCL").Value = sTZHBJCL;
|
|
SQL.ParamByName("pTZQBJCL").Value = sTZQBJCL;
|
|
SQL.ParamByName("pJGCZBID").Value = grdSHD.GetValueByFieldName("XLJGCZBLM_JGCZBID", iRowIndex);
|
|
SQL.ParamByName("pJGCZBBBID").Value = grdSHD.GetValueByFieldName("XLJGCZBML_JGCZBBBID", iRowIndex);
|
|
SQL.ParamByName("pCZBLMBH").Value = grdSHD.GetValueByFieldName("XLJGCZBLM_CZBLMBH", iRowIndex);
|
|
if (grdSHD.GetValueByFieldName("XLJGCZBLM_HLMLX", iRowIndex).IndexOf('|') > 0)
|
|
{
|
|
SQL.ParamByName("pHLMLX").Value = grdSHD.GetValueByFieldName("XLJGCZBLM_HLMLX", iRowIndex).Split('|')[0];
|
|
}
|
|
else
|
|
{
|
|
SQL.ParamByName("pHLMLX").Value = grdSHD.GetValueByFieldName("XLJGCZBLM_HLMLX", iRowIndex);
|
|
}
|
|
SQL.ParamByName("pWHR").Value = CurSession.UserName;
|
|
SQL.ParamByName("pWHRID").Value = CurSession.UserId;
|
|
SQL.ParamByName("pWHSJ").Value = DateTime.Now;
|
|
dberp.ExecSQL(SQL);
|
|
}
|
|
else
|
|
{
|
|
SQL.Clear();
|
|
SQL.Add(" update XLJGCZBLM ");
|
|
SQL.Add(" set XLJGCZBLM_BJCLID=:pTZHBJCL, ");
|
|
SQL.Add(" XLJGCZBLM_WHR= :pWHR, ");
|
|
SQL.Add(" XLJGCZBLM_WHRID= :pWHRID, ");
|
|
SQL.Add(" XLJGCZBLM_WHSJ= :pWHSJ ");
|
|
SQL.Add(" from XLJGCZBLM ");
|
|
SQL.Add(" where XLJGCZBLM_JGCZBID=:pJGCZBID ");
|
|
SQL.Add(" and XLJGCZBLM_JGCZBBBID=:pJGCZBBBID ");
|
|
SQL.Add(" and XLJGCZBLM_CZBLMBH=:pCZBLMBH ");
|
|
SQL.Add(" and XLJGCZBLM_HLMLX=:pHLMLX ");
|
|
|
|
SQL.ParamByName("pTZHBJCL").Value = sTZHBJCL;
|
|
SQL.ParamByName("pJGCZBID").Value = grdSHD.GetValueByFieldName("XLJGCZBLM_JGCZBID", iRowIndex);
|
|
SQL.ParamByName("pJGCZBBBID").Value = grdSHD.GetValueByFieldName("XLJGCZBML_JGCZBBBID", iRowIndex);
|
|
SQL.ParamByName("pCZBLMBH").Value = grdSHD.GetValueByFieldName("XLJGCZBLM_CZBLMBH", iRowIndex);
|
|
if (grdSHD.GetValueByFieldName("XLJGCZBLM_HLMLX", iRowIndex).IndexOf('|') > 0)
|
|
{
|
|
SQL.ParamByName("pHLMLX").Value = grdSHD.GetValueByFieldName("XLJGCZBLM_HLMLX", iRowIndex).Split('|')[0];
|
|
}
|
|
else
|
|
{
|
|
SQL.ParamByName("pHLMLX").Value = grdSHD.GetValueByFieldName("XLJGCZBLM_HLMLX", iRowIndex);
|
|
}
|
|
SQL.ParamByName("pWHR").Value = CurSession.UserName;
|
|
SQL.ParamByName("pWHRID").Value = CurSession.UserId;
|
|
SQL.ParamByName("pWHSJ").Value = DateTime.Now;
|
|
dberp.ExecSQL(SQL);
|
|
|
|
}
|
|
SQL.Clear();
|
|
SQL.Add(" insert into XLXSBJCLDH(XLXSBJCLDH_XLCLZLID,XLXSBJCLDH_XLCLID,XLXSBJCLDH_BJCLID,XLXSBJCLDH_BZ,XLXSBJCLDH_WHR,XLXSBJCLDH_WHRID,XLXSBJCLDH_WHSJ) ");
|
|
SQL.Add(" select XLJGCZBLM_XLCLZLID,XLJGCZBLM_XLCLID,XLJGCZBLM_BJCLID,:pJGCZBID||:pJGCZBMC||'(栏目设置自动添加)',:pWHR,:pWHRID,:pWHSJ ");
|
|
SQL.Add(" from XLJGCZBLM ");
|
|
SQL.Add(" where XLJGCZBLM_JGCZBID=:pJGCZBID ");
|
|
SQL.Add(" and XLJGCZBLM_JGCZBBBID=:pJGCZBBBID ");
|
|
SQL.Add(" and XLJGCZBLM_CZBLMBH=:pCZBLMBH ");
|
|
SQL.Add(" and XLJGCZBLM_HLMLX=:pHLMLX ");
|
|
SQL.Add(" and isnull(XLJGCZBLM_XLCLZLID,' ')<>' ' ");
|
|
SQL.Add(" and isnull(XLJGCZBLM_XLCLID,' ')<>' ' ");
|
|
SQL.Add(" and not exists(select 1 from XLXSBJCLDH ");
|
|
SQL.Add(" where XLXSBJCLDH_XLCLZLID=XLJGCZBLM_XLCLZLID ");
|
|
SQL.Add(" and XLXSBJCLDH_XLCLID=XLJGCZBLM_XLCLID ");
|
|
SQL.Add(" and XLXSBJCLDH_BJCLID=XLJGCZBLM_BJCLID) ");
|
|
SQL.ParamByName("pJGCZBID").Value = grdSHD.GetValueByFieldName("XLJGCZBLM_JGCZBID", iRowIndex);
|
|
SQL.ParamByName("pJGCZBBBID").Value = grdSHD.GetValueByFieldName("XLJGCZBML_JGCZBBBID", iRowIndex);
|
|
SQL.ParamByName("pJGCZBMC").Value = grdSHD.GetValueByFieldName("XLJGCZBML_JGCZBMC", iRowIndex);
|
|
SQL.ParamByName("pCZBLMBH").Value = grdSHD.GetValueByFieldName("XLJGCZBLM_CZBLMBH", iRowIndex);
|
|
if (grdSHD.GetValueByFieldName("XLJGCZBLM_HLMLX", iRowIndex).IndexOf('|') > 0)
|
|
{
|
|
SQL.ParamByName("pHLMLX").Value = grdSHD.GetValueByFieldName("XLJGCZBLM_HLMLX", iRowIndex).Split('|')[0];
|
|
}
|
|
else
|
|
{
|
|
SQL.ParamByName("pHLMLX").Value = grdSHD.GetValueByFieldName("XLJGCZBLM_HLMLX", iRowIndex);
|
|
}
|
|
SQL.ParamByName("pWHR").Value = CurSession.UserName;
|
|
SQL.ParamByName("pWHRID").Value = CurSession.UserId;
|
|
SQL.ParamByName("pWHSJ").Value = DateTime.Now;
|
|
dberp.ExecSQL(SQL);
|
|
CLQDList.UpdatCLZL(dberp, SQL, grdSHD.GetValueByFieldName("XLJGCZBLM_JGCZBID", iRowIndex), grdSHD.GetValueByFieldName("XLJGCZBML_JGCZBBBID", iRowIndex));
|
|
}
|
|
}
|
|
}
|
|
#endregion
|
|
}
|
|
}
|