139 lines
10 KiB
C#
139 lines
10 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_MODEL.Page;
|
|
using GThinking.N_WORKFLOW;
|
|
using GThinking.N_MISPRO;
|
|
using GThinking.N_MISPRO.Data;
|
|
using GThinking.N_MISPRO.Utility;
|
|
using System.Text;
|
|
|
|
|
|
namespace GThinking.N_XLXSBJ
|
|
{
|
|
public partial class BJFL_KHList : SingleGridBase
|
|
{
|
|
BJFL_KH entity = new BJFL_KH();
|
|
#region Page事件继承
|
|
string sBJFLID = "";
|
|
protected void Page_Load(object sender, EventArgs e)
|
|
{
|
|
this.UMID = 100860023;
|
|
this.UMName = "适用客户";
|
|
this.CurMaster = Master;
|
|
this.ModuleGV = grdContentGrid;
|
|
this.CurEntity = entity;
|
|
this.sURLTarget = "BJFL_KHInfo.aspx";
|
|
this.PageWidth = 750;
|
|
this.PageHeight = 600;
|
|
|
|
base.DataKeyNames = new string[] { "XLXSBJFLKH_BJFLID", "XLXSBJFLKH_KHID" };
|
|
|
|
this.Master.EnableQueryBtn = false;
|
|
this.Master.EnableAttachBtn = false;
|
|
|
|
if (PageParam.ContainsKey("BJFLID"))
|
|
{
|
|
sBJFLID = PageParam.GetRTrimString("BJFLID");
|
|
TPageParams pageParams = new TPageParams();
|
|
pageParams.AddString("FromBJFLID", sBJFLID);
|
|
SetNewFormParam(pageParams);
|
|
}
|
|
|
|
base.InitPage();
|
|
|
|
if (!IsPostBack)
|
|
{
|
|
Master_OnStandardQuery(null, null);
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region 模板事件继承
|
|
|
|
protected override void Master_OnStandardQuery(object sender, EventArgs e)
|
|
{
|
|
entity.EntityTable.QuerySelSql = GetQuerySelSQL().ToString();
|
|
base.Master_OnStandardQuery(sender, e);
|
|
entity.GridDataBind(grdContentGrid, tSession);
|
|
}
|
|
|
|
protected override void moduleGV_RowDataBound(object sender, GridViewRowEventArgs e)
|
|
{
|
|
if (e.Row.RowType == DataControlRowType.DataRow)
|
|
{
|
|
LinkPageParam.AddString("XLXSBJFLKH_BJFLID", grdContentGrid.DataKeys[e.Row.RowIndex]["XLXSBJFLKH_BJFLID"].ToString().Trim());
|
|
LinkPageParam.AddString("XLXSBJFLKH_KHID", grdContentGrid.DataKeys[e.Row.RowIndex]["XLXSBJFLKH_KHID"].ToString().Trim());
|
|
LinkPageParam.AddString("FromBJFLID", grdContentGrid.DataKeys[e.Row.RowIndex]["XLXSBJFLKH_BJFLID"].ToString().Trim());
|
|
}
|
|
base.moduleGV_RowDataBound(sender, e);
|
|
}
|
|
protected override void moduleGV_PageIndexChanging(object sender, GridViewPageEventArgs e)
|
|
{
|
|
entity.EntityTable.QuerySelSql = GetQuerySelSQL().ToString();
|
|
grdContentGrid.SelectedIndex = -1;
|
|
base.moduleGV_PageIndexChanging(sender, e);
|
|
}
|
|
|
|
protected override void BeforeDelete(TDatabase db, ref bool ActionIsDone)
|
|
{
|
|
entity.Param.Add("XLXSBJFLKH_BJFLID", grdContentGrid.DataKeys[grdContentGrid.SelectedIndex]["XLXSBJFLKH_BJFLID"].ToString().Trim());
|
|
entity.Param.Add("XLXSBJFLKH_KHID", grdContentGrid.DataKeys[grdContentGrid.SelectedIndex]["XLXSBJFLKH_KHID"].ToString().Trim());
|
|
base.BeforeDelete(db, ref ActionIsDone);
|
|
}
|
|
|
|
protected override bool Master_AfterDeleteAction(object sender, EventArgs e)
|
|
{
|
|
if (!base.Master_AfterDeleteAction(sender, e)) { return false; }
|
|
entity.EntityTable.QuerySelSql = GetQuerySelSQL().ToString();
|
|
entity.GridDataBind(grdContentGrid, tSession);
|
|
grdContentGrid.SelectedIndex = -1;
|
|
return true;
|
|
}
|
|
|
|
|
|
|
|
protected override void AfterDelete(TDatabase db, ref bool ActionIsDone)
|
|
{
|
|
base.AfterDelete(db, ref ActionIsDone);
|
|
}
|
|
#endregion
|
|
|
|
#region 私有函数
|
|
private string AddCondition()
|
|
{
|
|
entity.Param.Clear();
|
|
StringBuilder sSQL = new StringBuilder();
|
|
|
|
//如果是跳转,则限制查询
|
|
if (PageParam.ContainsKey("BJFLID"))
|
|
{
|
|
sSQL.AppendLine(" and XLXSBJFLKH_BJFLID = :pBJFLID");
|
|
entity.Param.Add("pBJFLID", sBJFLID);
|
|
}
|
|
return sSQL.ToString();
|
|
}
|
|
|
|
private StringBuilder GetQuerySelSQL()
|
|
{
|
|
StringBuilder strSQL = new StringBuilder();
|
|
strSQL.AppendLine(" select XLXSBJFLKH_BJFLID, XLXSBJFLKH_KHID, XLXSBJFLKH_BZ,KH_MC, ");
|
|
strSQL.AppendLine(" XLXSBJFLKH_WHR, XLXSBJFLKH_WHRID,XLXSBJFLKH_WHSJ from XLXSBJFLKH ");
|
|
strSQL.AppendLine(" LEFT JOIN KH ON KH_KHID = XLXSBJFLKH_KHID ");
|
|
strSQL.AppendLine("where 1=1 ");
|
|
strSQL.AppendLine(AddCondition());
|
|
strSQL.AppendLine(" order by XLXSBJFLKH_BJFLID, XLXSBJFLKH_KHID desc ");
|
|
return strSQL;
|
|
}
|
|
#endregion
|
|
}
|
|
}
|