2026821
This commit is contained in:
@@ -0,0 +1,280 @@
|
||||
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_MODEL.Page;
|
||||
using GThinking.N_MISPRO.Data;
|
||||
using System.Drawing;
|
||||
using GThinking.N_MODEL.Dialog;
|
||||
using GThinking.N_PUBLIC;
|
||||
using GThinking.N_MISPRO.Utility;
|
||||
using GThinking.N_MISPRO.MISPROAS;
|
||||
using GThinking.N_WORKFLOW;
|
||||
using System.Text;
|
||||
using GThinking.N_PUBLIC2;
|
||||
|
||||
|
||||
namespace GThinking.N_XLXSBJ
|
||||
{
|
||||
public partial class XLBJD_BDBJSelList : SingleGridBase
|
||||
{
|
||||
XLBJD_BDBJSel entity = new XLBJD_BDBJSel();
|
||||
XLBJD_BDBJSel_M queryentity = new XLBJD_BDBJSel_M();
|
||||
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
this.UMID = 100860000;
|
||||
this.UMName = "线缆销售报价单";
|
||||
this.CurMaster = Master;
|
||||
this.ModuleGV = grdContentGrid;
|
||||
this.CurEntity = entity;
|
||||
this.CurQueryEntity = queryentity;
|
||||
this.sQueryURLTarget = "XLBJD_BDBJSelQuery.aspx";
|
||||
this.PageHeight = 600;
|
||||
this.PageWidth = 750;
|
||||
base.DataKeyNames = new string[] { "XLXSBJD_BJDID" };
|
||||
|
||||
this.Master.EnableNewBtn = false;
|
||||
this.Master.EnableDeleteBtn = false;
|
||||
this.Master.EnableViewBtn = false;
|
||||
this.Master.EnableAttachBtn = false;
|
||||
this.Master.EnableCopyBtn = false;
|
||||
this.Master.EnableEditBtn = false;
|
||||
if (PageParam.GetRTrimString("BJDLX").Equals("ZBJD"))
|
||||
{
|
||||
grdContentGrid.CheckBox = false;
|
||||
|
||||
}
|
||||
|
||||
if (!IsPostBack)
|
||||
{
|
||||
if (PageParam.GetRTrimString("BJDLX").Equals("DBBJD") && !IsPostBack)
|
||||
{
|
||||
if (!PageParam.GetRTrimString("txtBJFLID").Equals(""))
|
||||
CurQueryEntity.FieldByName("BJFLID").Value = PageParam.GetRTrimString("txtBJFLID");
|
||||
if (!PageParam.GetRTrimString("txtKH").Equals(""))
|
||||
CurQueryEntity.FieldByName("KH").Value = PageParam.GetRTrimString("txtKH");
|
||||
if (!PageParam.GetRTrimString("txtXM").Equals(""))
|
||||
CurQueryEntity.FieldByName("XM").Value = PageParam.GetRTrimString("txtXM");
|
||||
}
|
||||
}
|
||||
base.InitPage();
|
||||
|
||||
if (!IsPostBack)
|
||||
{
|
||||
if (base.IsDefaultExecute)
|
||||
{
|
||||
Master_OnStandardQuery(null, null);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#region 模板事件继承
|
||||
protected override void Master_OnStandardQuery(object sender, EventArgs e)
|
||||
{
|
||||
base.InitEntityByCondition();
|
||||
entity.EntityTable.QuerySelSql = QuerySql();
|
||||
base.Master_OnStandardQuery(sender, e);
|
||||
entity.GridDataBind(grdContentGrid, tSession);
|
||||
}
|
||||
|
||||
protected override void moduleGV_RowDataBound(object sender, GridViewRowEventArgs e)
|
||||
{
|
||||
if (e.Row.RowType == DataControlRowType.DataRow)
|
||||
{
|
||||
}
|
||||
base.moduleGV_RowDataBound(sender, e);
|
||||
}
|
||||
|
||||
|
||||
protected override void moduleGV_PageIndexChanging(object sender, GridViewPageEventArgs e)
|
||||
{
|
||||
base.InitEntityByCondition();
|
||||
entity.EntityTable.QuerySelSql = QuerySql();
|
||||
grdContentGrid.SelectedIndex = -1;
|
||||
base.moduleGV_PageIndexChanging(sender, e);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 自定义函数
|
||||
|
||||
private string QuerySql()
|
||||
{
|
||||
string sSQL = " select XLXSBJD_BJDID, rtrim(XLXSBJD_BJFLID)||'|'||XLXSBJFL_BJFLMC as XLXSBJD_BJFLID, "
|
||||
+ " case isnull(XLXSBJD_JGBID,' ') when ' ' then ' ' else rtrim(XLXSBJD_JGBID)||'|'||XLXSJGB_JGBMC end as XSJGB,XLXSBJD_CLHQJGBID,"
|
||||
+ " case isnull(XLXSBJD_KHID,' ') when ' ' then rtrim(XLXSBJD_SYDWID)||'|'||GS_GSMC else rtrim(XLXSBJD_KHID)||'|'||KH_MC end as XHDW, XLXSBJD_BJRQ, XLXSBJD_XSJLMC,"
|
||||
+ " case isnull(XLXSBJD_XSQYID,' ') when ' ' then ' ' else rtrim(XLXSBJD_XSQYID)||'|'||XSQY_XSQYMC end as XSQY, "
|
||||
+ " XLXSBJD_TXY, XLXSBJD_KH, XLXSBJD_KHLXR, XLXSBJD_LXDH, XLXSBJD_CZ, XLXSBJD_XMMC, XLXSBJD_XXDZ, XLXSBJD_BZ,XLXSBJD_ZJE,XLXSBJD_LRL, XLXSBJD_DOCGRPID,XLXSBJD_FJS,XLXSBJD_WHR, XLXSBJD_WHRID, XLXSBJD_WHSJ, XLXSBJD_WFID, XLXSBJD_WFINST, XLXSBJD_WPID, XLXSBJD_WFAWAITER, XLXSBJD_WFHANDLER, XLXSBJD_ACTNAME "
|
||||
+ " from XLXSBJD "
|
||||
+ " left join GS on GS_SYDWID=XLXSBJD_SYDWID"
|
||||
+ " left join XLXSBJFL on XLXSBJD_BJFLID=XLXSBJFL_BJFLID"
|
||||
+ " left join XSQY on XSQY_XSQYID=XLXSBJD_XSQYID"
|
||||
+ " left join KH on KH_KHID=XLXSBJD_KHID"
|
||||
+ " left join XLXSJGB on XLXSJGB_JGBID=XLXSBJD_JGBID and XLXSJGB_MXBH='JGB'"
|
||||
+ " where 1=1 and XLXSBJD_BJDID <> :pBJDID ";
|
||||
entity.Param.Add("pBJDID", PageParam.GetRTrimString("BJDID"));
|
||||
|
||||
if (!CurQueryEntity.FieldByName("BJFLID").Value.Trim().Equals(""))
|
||||
{
|
||||
sSQL += "\r\n and (XLXSBJD_BJFLID = :pBJFLID) ";
|
||||
entity.Param.Add("pBJFLID", CurQueryEntity.FieldByName("BJFLID").Value.Trim());
|
||||
}
|
||||
|
||||
if (!CurQueryEntity.FieldByName("KH").Value.Trim().Equals(""))
|
||||
{
|
||||
sSQL += "\r\n and (XLXSBJD_KH like :pKH) ";
|
||||
entity.Param.Add("pKH", "%" + CurQueryEntity.FieldByName("KH").Value.Trim() + "%");
|
||||
}
|
||||
if (!CurQueryEntity.FieldByName("XM").Value.Trim().Equals(""))
|
||||
{
|
||||
sSQL += "\r\n and (XLXSBJD_XMMC like :pXM) ";
|
||||
entity.Param.Add("pXM", "%" + CurQueryEntity.FieldByName("XM").Value.Trim() + "%");
|
||||
}
|
||||
|
||||
|
||||
//sSQL += CMISproDataBase.GetTimeConditionSQL("XLXSBJD_BJRQ",
|
||||
// CurQueryEntity.FieldByName("BJRQS").Value.ToString().Trim(),
|
||||
// CurQueryEntity.FieldByName("BJRQZ").Value.ToString().Trim(),
|
||||
// DateTimeType.dtDate, DateTimeType.dtDate);
|
||||
|
||||
|
||||
sSQL += " order by XLXSBJD_BJRQ desc,XLXSBJD_BJDID desc ";
|
||||
|
||||
return sSQL;
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region 回填报价单
|
||||
//确认
|
||||
protected void btnQD_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
string sBJDIDS = "";
|
||||
if (this.grdContentGrid.CheckBox && !String.IsNullOrEmpty(this.grdContentGrid.CheckedRowIndexs))
|
||||
{
|
||||
string[] RowsArry = this.grdContentGrid.CheckedRowIndexs.Split(new char[] { ',' });
|
||||
try
|
||||
{
|
||||
foreach (string sRowIndex in RowsArry)
|
||||
{
|
||||
int iRowIndex = CMISproConvert.StrToInt(sRowIndex.Trim());
|
||||
sBJDIDS = sBJDIDS + "," + grdContentGrid.DataKeys[iRowIndex]["XLXSBJD_BJDID"].ToString().Trim();
|
||||
}
|
||||
sBJDIDS = sBJDIDS.TrimStart(',').TrimEnd(',');
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
ShowMessage("操作出现异常,请关闭后重试。原因:" + ex.Message);
|
||||
}
|
||||
}
|
||||
else if (!this.grdContentGrid.CheckBox && grdContentGrid.SelectedIndex != -1)
|
||||
{
|
||||
int rowIndex = grdContentGrid.SelectedIndex; // 获取选中行索引
|
||||
if (rowIndex >= 0)
|
||||
{
|
||||
try
|
||||
{
|
||||
sBJDIDS = grdContentGrid.DataKeys[rowIndex]["XLXSBJD_BJDID"].ToString().Trim();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
ShowMessage("操作出现异常,请关闭后重试。原因:" + ex.Message);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ShowMessage("请先选择记录!");
|
||||
return;
|
||||
}
|
||||
//使用脚本给父页面的隐藏控件赋值,调用父页面的控件事件
|
||||
|
||||
if (PageParam.GetRTrimString("BJDLX").Equals("ZBJD"))
|
||||
{
|
||||
|
||||
int recordCount = sBJDIDS.Split(',').Length;
|
||||
if (recordCount > 1)
|
||||
{
|
||||
ShowMessage("主报价单最多选择1份,请重新勾选!");
|
||||
return;
|
||||
}
|
||||
|
||||
base.InitEntityByCondition();
|
||||
DialogOperationScript dos = new DialogOperationScript(this);
|
||||
dos.SetOwnerControlValue(PageParam.GetRTrimString("txtZBJDIDJL"), sBJDIDS);
|
||||
dos.SetOwnerControlValue(PageParam.GetRTrimString("txtBJFLID"), CurQueryEntity.FieldByName("BJFLID").Value.Trim());
|
||||
dos.SetOwnerControlValue(PageParam.GetRTrimString("txtKH"), CurQueryEntity.FieldByName("KH").Value.Trim());
|
||||
dos.SetOwnerControlValue(PageParam.GetRTrimString("txtXM"), CurQueryEntity.FieldByName("XM").Value.Trim());
|
||||
dos.SetOwnerControlValue(PageParam.GetRTrimString("txtOPEN"), "run");
|
||||
dos.CloseSelf();
|
||||
dos.Execute();
|
||||
}
|
||||
else if (PageParam.GetRTrimString("BJDLX").Equals("DBBJD"))
|
||||
{
|
||||
int recordCount = sBJDIDS.Split(',').Length;
|
||||
if (recordCount > 4)
|
||||
{
|
||||
ShowMessage("对比报价单最多选择4份,请重新勾选!");
|
||||
return;
|
||||
}
|
||||
DialogOperationScript dos = new DialogOperationScript(this);
|
||||
dos.SetOwnerControlValue(PageParam.GetRTrimString("txtDBBJDIDJL"), sBJDIDS);
|
||||
dos.SetOwnerControlValue(PageParam.GetRTrimString("txtOPEN"), "run");
|
||||
dos.CloseSelf();
|
||||
dos.Execute();
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
DialogOperationScript dos = new DialogOperationScript(this);
|
||||
dos.SetOwnerControlValue(PageParam.GetRTrimString("txtZBBJDIDCID"), sBJDIDS);
|
||||
dos.CloseSelf();
|
||||
dos.Execute();
|
||||
}
|
||||
|
||||
}
|
||||
//取消
|
||||
protected void btnQX_Click(object sender, EventArgs e)
|
||||
{
|
||||
CloseWindow();
|
||||
}
|
||||
|
||||
protected void grdContentGrid_RowDoubleClick(object sender, GThinking.N_CONTROL.RowDoubleClickEventArgs e)
|
||||
{
|
||||
string sBJDID = grdContentGrid.DataKeys[grdContentGrid.SelectedIndex]["XLXSBJD_BJDID"].ToString().Trim();
|
||||
string sWFID = "";
|
||||
string sWFINST = "";
|
||||
|
||||
TDatabase dberp = TContextDatabases.GetDatabase("DBERP");
|
||||
TSQL SQL = new TSQL(dberp);
|
||||
SQL.Clear();
|
||||
SQL.Add(" SELECT XLXSBJD_BJDID,XLXSBJD_WFID,XLXSBJD_WFINST FROM XLXSBJD WHERE XLXSBJD_BJDID = :pBJDID ");
|
||||
SQL.ParamByName("pBJDID").Value = grdContentGrid.DataKeys[grdContentGrid.SelectedIndex]["XLXSBJD_BJDID"].ToString().Trim();
|
||||
DataSet ds = dberp.OpenDataSet(SQL);
|
||||
if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
|
||||
{
|
||||
sWFID = ds.Tables[0].Rows[0]["XLXSBJD_WFID"].ToString().Trim();
|
||||
sWFINST = ds.Tables[0].Rows[0]["XLXSBJD_WFINST"].ToString().Trim();
|
||||
}
|
||||
|
||||
TPageParams tpp = new TPageParams();
|
||||
tpp.UrlPath = "XLBJDInfo.aspx";
|
||||
tpp.AddString("XLXSBJD_BJDID", sBJDID);
|
||||
tpp.AddString("WFID", sWFID);
|
||||
tpp.AddString("WFINST", sWFINST);
|
||||
tpp.CallAction = TPageCallAction.pcaBrowse;
|
||||
OpenDialog(tpp);
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user