提交所有文件

This commit is contained in:
2026-09-19 14:12:58 +08:00
parent 20e88479b1
commit 7b922290bb
62 changed files with 11832 additions and 131 deletions
+254
View File
@@ -0,0 +1,254 @@
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_MODEL.Page;
using GThinking.N_MISPRO.Utility;
using GThinking.N_MISPRO.Data;
using GThinking.N_MISPRO;
using GThinking.N_WORKFLOW;
using System.Collections.Generic;
namespace GThinking.N_XLXSBJ
{
public partial class TBYSList : SingleGridBase
{
TBYS entity = new TBYS();
TBYS_M queryentity = new TBYS_M();
#region Page类事件继承
protected void Page_Load(object sender, EventArgs e)
{
this.UMID = 100860168;
this.UMName = "投标预审";
this.CurMaster = Master;
this.ModuleGV = ContentGrid;
this.CurEntity = entity;
this.CurQueryEntity = queryentity;
this.PageHeight = 500;
this.PageWidth = 700;
this.sURLTarget = "TBYSInfo.aspx";
this.sQueryURLTarget = "TBYSQuery.aspx";
this.DataKeyNames = new string[] { "TBYSB_SPDH", "TBYSB_WPID" };
this.Master.EnableAttachBtn = true;
if (!IsPostBack)
{
CurQueryEntity.FieldByName("SW").Value = "W";
}
base.InitPage();
if (!IsPostBack)
{
Master_OnStandardQuery(null, null);
}
}
#endregion
#region 模板继承事件
protected override void Master_OnStandardQuery(object sender, EventArgs e)
{
base.InitEntityByCondition();
entity.EntityTable.QuerySelSql = GetQuerySql();
base.Master_OnStandardQuery(sender, e);
entity.GridDataBind(ContentGrid, tSession);
}
protected override void moduleGV_PageIndexChanging(object sender, GridViewPageEventArgs e)
{
base.InitEntityByCondition();
entity.EntityTable.QuerySelSql = GetQuerySql();
ContentGrid.SelectedIndex = -1;
base.moduleGV_PageIndexChanging(sender, e);
}
protected override void moduleGV_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
e.Row.Cells[0].Text = _curWorkFlow.GetWPName("XSBJ_TBYS", e.Row.Cells[0].Text.Trim());
int indexAwaiter = ContentGrid.Columns.IndexOf(ContentGrid.FindColumnByFieldName("TBYSB_WFAWAITER"));
int indexHandler = ContentGrid.Columns.IndexOf(ContentGrid.FindColumnByFieldName("TBYSB_WFHANDLER"));
if (indexAwaiter > -1)
{
e.Row.Cells[indexAwaiter].Text = _curWorkFlow.UserInfo.GetUserNames(e.Row.Cells[indexAwaiter].Text.Trim());
}
if (indexHandler > -1)
{
e.Row.Cells[indexHandler].Text = _curWorkFlow.UserInfo.GetUserNames(e.Row.Cells[indexHandler].Text.Trim());
}
int tbbzjxsIndex = -1;
for (int i = 0; i < ContentGrid.Columns.Count; i++)
{
if (ContentGrid.Columns[i] is BoundField && ((BoundField)ContentGrid.Columns[i]).DataField == "TBYSB_TBBZJXS")
{
tbbzjxsIndex = i;
break;
}
}
if (tbbzjxsIndex > -1)
{
string sTBBZJXS = e.Row.Cells[tbbzjxsIndex].Text.Trim();
switch (sTBBZJXS)
{
case "D": e.Row.Cells[tbbzjxsIndex].Text = "电汇"; break;
case "H": e.Row.Cells[tbbzjxsIndex].Text = "保函"; break;
case "X": e.Row.Cells[tbbzjxsIndex].Text = "保险"; break;
case "Q": e.Row.Cells[tbbzjxsIndex].Text = "其他"; break;
case "W": e.Row.Cells[tbbzjxsIndex].Text = "无"; break;
}
}
int bsjfxsIndex = -1;
for (int i = 0; i < ContentGrid.Columns.Count; i++)
{
if (ContentGrid.Columns[i] is BoundField && ((BoundField)ContentGrid.Columns[i]).DataField == "TBYSB_BSJFXS")
{
bsjfxsIndex = i;
break;
}
}
if (bsjfxsIndex > -1)
{
string sBSJFXS = e.Row.Cells[bsjfxsIndex].Text.Trim();
switch (sBSJFXS)
{
case "D": e.Row.Cells[bsjfxsIndex].Text = "电子文档"; break;
case "Z": e.Row.Cells[bsjfxsIndex].Text = "纸质"; break;
case "G": e.Row.Cells[bsjfxsIndex].Text = "光盘"; break;
}
}
LinkPageParam.AddString("TBYSB_SPDH", ContentGrid.DataKeys[e.Row.RowIndex]["TBYSB_SPDH"].ToString().Trim());
LinkPageParam.AddString("WFID", ContentGrid.DataKeys[e.Row.RowIndex]["TBYSB_WFID"].ToString().Trim());
LinkPageParam.AddString("WFINST", ContentGrid.DataKeys[e.Row.RowIndex]["TBYSB_WFINST"].ToString().Trim());
}
base.moduleGV_RowDataBound(sender, e);
}
protected override bool Master_BeforeDeleteAction(object sender, EventArgs e)
{
string sSPDH = ContentGrid.DataKeys[ContentGrid.SelectedIndex]["TBYSB_SPDH"].ToString().Trim();
CurEntity.Param.Add("TBYSB_SPDH", sSPDH);
return base.Master_BeforeDeleteAction(sender, e);
}
protected override void BeforeDelete(TDatabase db, ref bool ActionIsDone)
{
base.BeforeDelete(db, ref ActionIsDone);
}
protected override void AfterDelete(TDatabase db, ref bool ActionIsDone)
{
base.AfterDelete(db, ref ActionIsDone);
}
protected override bool Master_AfterDeleteAction(object sender, EventArgs e)
{
if (!base.Master_AfterDeleteAction(sender, e)) return false;
base.InitEntityByCondition();
entity.EntityTable.QuerySelSql = GetQuerySql();
entity.GridDataBind(ContentGrid, tSession);
ContentGrid.SelectedIndex = -1;
return true;
}
#endregion
protected override void BeforeAttach()
{
attDoc.WorkTableName = "TBYSB";
attDoc.UpdCondition = string.Format(" TBYSB_SPDH='{0}'", ContentGrid.DataKeys[ContentGrid.SelectedIndex]["TBYSB_SPDH"].ToString().Trim());
base.BeforeAttach();
}
protected override void Master_wfAfterActionEvent(TWorkflow Sender, TWFAction Action, bool ActionIsDone)
{
base.Master_wfAfterActionEvent(Sender, Action, ActionIsDone);
if (!ActionIsDone)
return;
TSQL SQL = new TSQL(Sender.dbe);
SQL.Clear();
SQL.Add(" update TBYSB");
SQL.Add(" set TBYSB_WFID = :TBYSB_WFID, ");
SQL.Add(" TBYSB_WPID = :TBYSB_WPID, ");
SQL.Add(" TBYSB_WFAWAITER = :TBYSB_WFAWAITER, ");
SQL.Add(" TBYSB_WFHANDLER = :TBYSB_WFHANDLER, ");
SQL.Add(" TBYSB_WFINST = :TBYSB_WFINST, ");
SQL.Add(" TBYSB_ACTNAME = :TBYSB_ACTNAME ");
SQL.Add(" where TBYSB_SPDH = :TBYSB_SPDH ");
SQL.ParamByName("TBYSB_WFID").Value = Sender.WFID;
SQL.ParamByName("TBYSB_WFINST").Value = Sender.WFInst;
SQL.ParamByName("TBYSB_WPID").Value = Sender.WPID;
SQL.ParamByName("TBYSB_WFAWAITER").Value = Sender.Awaiter;
SQL.ParamByName("TBYSB_WFHANDLER").Value = Sender.Handler;
SQL.ParamByName("TBYSB_ACTNAME").Value = Sender.GetWFActionName(Action);
SQL.ParamByName("TBYSB_SPDH").Value = ContentGrid.DataKeys[ContentGrid.SelectedIndex]["TBYSB_SPDH"].ToString().Trim();
Sender.dbe.ExecSQL(SQL);
}
private string GetQuerySql()
{
string sSQL = " select TBYSB_SPDH, TBYSB_FQR, "
+ " case isnull(TBYSB_SYDWID,' ') when ' ' then ' ' else (rtrim(TBYSB_SYDWID)||'|'||GS_GSMC) end as TBYSB_SYDWID, "
+ " case isnull(TBYSB_BMID,' ') when ' ' then ' ' else (rtrim(TBYSB_BMID)||'|'||BM_MC) end as TBYSB_BMID, "
+ " TBYSB_XMID, TBYSB_TBJE, TBYSB_XMMC, TBYSB_TBRQ, TBYSB_FJS, \r\n"
+ " TBYSB_DOCGRPID, TBYSB_WFID, TBYSB_WFINST, TBYSB_WPID, TBYSB_WFAWAITER, TBYSB_WFHANDLER, TBYSB_ACTNAME, TBYSB_ZBF, \r\n"
+ " TBYSB_TBDZ, TBYSB_TBJZRQ, TBYSB_XJYQ, TBYSB_BSJFXS, TBYSB_TBBZJJE, TBYSB_TBBZJXS, TBYSB_ZWFKSJ, TBYSB_TBZT, \r\n"
+ " TBYSB_SQDB, TBYSB_BSJFSJ, TBYSB_GDFKTJ, TBYSB_CNFKTJ, TBYSB_QTYQ, TBYSB_SFXYCADZYS, TBYSB_JSPCNR, \r\n"
+ " TBYSB_WHR,TBYSB_WHRID,TBYSB_WHSJ,TBYSB_GKFZR \r\n"
+ " from TBYSB \r\n"
+ " left join GS on GS_SYDWID = TBYSB_SYDWID \r\n"
+ " left join BM on BM_BMID = TBYSB_BMID \r\n"
+ " where 1=1 ";
switch (CurQueryEntity.FieldByName("SW").Value.Trim())
{
case "W":
sSQL += "\r\n and " + _curWorkFlow.GetWhereAgent("XSBJ_TBYS", tSession.UserId, "TBYSB_WFAWAITER", "TBYSB_WFID", "TBYSB_WPID");
break;
case "H":
sSQL += "\r\n and TBYSB_WFHANDLER LIKE :TBYSB_WFHANDLER ";
entity.Param.Add("TBYSB_WFHANDLER", "%," + tSession.UserId + ",%");
break;
case "A":
break;
}
if (!string.IsNullOrEmpty(CurQueryEntity.FieldByName("WFAWAITER").Value.Trim()))
{
sSQL += " \r\n and TBYSB_WFAWAITER like :pWFAWITER ";
entity.Param.Add("pWFAWITER", string.Format("%,{0},%", CurQueryEntity.FieldByName("WFAWAITER").Value.Trim()));
}
if (!string.IsNullOrEmpty(CurQueryEntity.FieldByName("STATE").Value.Trim()))
{
sSQL += "\r\n and " + CMISproDataBase.GetWhereEqual("TBYSB_WPID", CurQueryEntity.FieldByName("STATE").Value.Trim());
}
if (!string.IsNullOrEmpty(CurQueryEntity.FieldByName("ZBF").Value.Trim()))
{
sSQL += "\r\n and TBYSB_ZBF like :pZBF ";
entity.Param.Add("pZBF", string.Format("%{0}%", CurQueryEntity.FieldByName("ZBF").Value.Trim()));
}
if (!CurQueryEntity.FieldByName("XMMC").Value.Trim().Equals(""))
{
sSQL += "\r\n and " + CMISproDataBase.GetWhereLike("TBYSB_XMMC", CurQueryEntity.FieldByName("XMMC").Value.Trim());
}
sSQL += " order by TBYSB_WHSJ DESC, TBYSB_SPDH DESC ";
return sSQL;
}
protected void btnGRWJGRefer_Click(object sender, EventArgs e)
{
int tmpIndex = ContentGrid.SelectedIndex;
moduleGV_PageIndexChanging(null, null);
ContentGrid.SelectedIndex = tmpIndex;
}
}
}