2026821
This commit is contained in:
@@ -0,0 +1,136 @@
|
||||
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.Data;
|
||||
using GThinking.N_MISPRO;
|
||||
using GThinking.N_MISPRO.Utility;
|
||||
using System.Text;
|
||||
using GThinking.N_CONTROL;
|
||||
|
||||
namespace GThinking.N_XLXSBJ
|
||||
{
|
||||
public partial class XSBJYWPZ_CPYSList : SingleGridBase
|
||||
{
|
||||
XSBJYWPZ_CPYS entity = new XSBJYWPZ_CPYS();
|
||||
XSBJYWPZ_CPYS_M queryentity = new XSBJYWPZ_CPYS_M();
|
||||
|
||||
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
this.UMID = 100860062;
|
||||
this.UMName = "销售报价业务配置";
|
||||
this.CurMaster = Master;
|
||||
this.ModuleGV = grdGrid;
|
||||
this.CurEntity = entity;
|
||||
this.CurQueryEntity = queryentity;
|
||||
this.sURLTarget = "XSBJYWPZ_CPYSInfo.aspx";
|
||||
this.sQueryURLTarget = "XSBJYWPZ_CPYSQuery.aspx";
|
||||
this.PageHeight = 500;
|
||||
this.PageWidth = 700;
|
||||
|
||||
base.DataKeyNames = new string[] { "XLXSBJCPYS_CPYT", "XLXSBJCPYS_XLJBXHID", "XLXSBJCPYS_XXJGID" };
|
||||
|
||||
base.InitPage();
|
||||
|
||||
if (!IsPostBack)
|
||||
{
|
||||
Master_OnStandardQuery(null, null);
|
||||
}
|
||||
}
|
||||
|
||||
#region 模板事件
|
||||
protected override void Master_OnStandardQuery(object sender, EventArgs e)
|
||||
{
|
||||
base.InitEntityByCondition();
|
||||
entity.EntityTable.QuerySelSql = GetSql();
|
||||
base.Master_OnStandardQuery(sender, e);
|
||||
entity.GridDataBind(grdGrid, tSession);
|
||||
}
|
||||
|
||||
protected override void moduleGV_PageIndexChanging(object sender, GridViewPageEventArgs e)
|
||||
{
|
||||
base.InitEntityByCondition();
|
||||
entity.EntityTable.QuerySelSql = GetSql();
|
||||
base.moduleGV_PageIndexChanging(sender, e);
|
||||
grdGrid.SelectedIndex = -1;
|
||||
}
|
||||
|
||||
protected override void moduleGV_RowDataBound(object sender, GridViewRowEventArgs e)
|
||||
{
|
||||
if (e.Row.RowType == DataControlRowType.DataRow)
|
||||
{
|
||||
LinkPageParam.AddString("XLXSBJCPYS_CPYT", grdGrid.DataKeys[e.Row.RowIndex]["XLXSBJCPYS_CPYT"].ToString().Trim());
|
||||
LinkPageParam.AddString("XLXSBJCPYS_XLJBXHID", grdGrid.DataKeys[e.Row.RowIndex]["XLXSBJCPYS_XLJBXHID"].ToString().Trim());
|
||||
LinkPageParam.AddString("XLXSBJCPYS_XXJGID", grdGrid.DataKeys[e.Row.RowIndex]["XLXSBJCPYS_XXJGID"].ToString().Trim());
|
||||
}
|
||||
base.moduleGV_RowDataBound(sender, e);
|
||||
}
|
||||
|
||||
protected override void BeforeDelete(TDatabase db, ref bool ActionIsDone)
|
||||
{
|
||||
entity.Param.Add("XLXSBJCPYS_CPYT", grdGrid.DataKeys[grdGrid.SelectedIndex]["XLXSBJCPYS_CPYT"].ToString().Trim());
|
||||
entity.Param.Add("XLXSBJCPYS_XLJBXHID", grdGrid.DataKeys[grdGrid.SelectedIndex]["XLXSBJCPYS_XLJBXHID"].ToString().Trim().Equals("") ? " " : grdGrid.DataKeys[grdGrid.SelectedIndex]["XLXSBJCPYS_XLJBXHID"].ToString().Trim());
|
||||
entity.Param.Add("XLXSBJCPYS_XXJGID", grdGrid.DataKeys[grdGrid.SelectedIndex]["XLXSBJCPYS_XXJGID"].ToString().Trim().Equals("") ? " " : grdGrid.DataKeys[grdGrid.SelectedIndex]["XLXSBJCPYS_XXJGID"].ToString().Trim());
|
||||
base.BeforeDelete(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 = GetSql();
|
||||
entity.GridDataBind(grdGrid, tSession);
|
||||
grdGrid.SelectedIndex = -1;
|
||||
return true;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 自定义函数
|
||||
|
||||
private string GetSql()
|
||||
{
|
||||
StringBuilder strSQL = new StringBuilder();
|
||||
strSQL.AppendLine(" select XLXSBJCPYS_CPYT,XLXSBJCPYS_XLJBXHID,XLXSBJCPYS_XXJGID,XLXSBJCPYS_XLYSID,XLXSBJCPYS_WHR,XLXSBJCPYS_WHRID,XLXSBJCPYS_WHSJ,");
|
||||
strSQL.AppendLine(" case when XLXSBJCPYS_CPYT=' ' then ' ' else rtrim(XLXSBJCPYS_CPYT)||'|'||XLCPYT_CPYTMC end as CPYT,");
|
||||
strSQL.AppendLine(" XLXSBJCPYS_XLJBXHID as XLJBXHID,");
|
||||
strSQL.AppendLine(" rtrim(XLXSBJCPYS_XLYSID)||'|'||XLYSB_XLYSMC as XLYS");
|
||||
strSQL.AppendLine(" from XLXSBJCPYS ");
|
||||
strSQL.AppendLine(" left join XLCPYT on XLCPYT_CPYT=XLXSBJCPYS_CPYT");
|
||||
strSQL.AppendLine(" left join XLYSB on XLYSB_XLYSID=XLXSBJCPYS_XLYSID");
|
||||
strSQL.AppendLine(" where 1=1");
|
||||
if (!CurQueryEntity.FieldByName("XLXHID").Value.Trim().Equals(""))
|
||||
{
|
||||
strSQL.AppendLine(" AND XLXSBJCPYS_XLJBXHID=:XLXSBJCPYS_XLJBXHID");
|
||||
entity.Param.Add("XLXSBJCPYS_XLJBXHID", CurQueryEntity.FieldByName("XLXHID").Value.Trim());
|
||||
}
|
||||
if (!CurQueryEntity.FieldByName("XLYSID").Value.Trim().Equals(""))
|
||||
{
|
||||
strSQL.AppendLine(" AND XLXSBJCPYS_XLYSID=:XLXSBJCPYS_XLYSID");
|
||||
entity.Param.Add("XLXSBJCPYS_XLYSID", CurQueryEntity.FieldByName("XLYSID").Value.Trim());
|
||||
}
|
||||
if (!CurQueryEntity.FieldByName("XXJGID").Value.Trim().Equals(""))
|
||||
{
|
||||
strSQL.AppendLine(" AND XLXSBJCPYS_XXJGID LIKE :XLXSBJCPYS_XXJGID");
|
||||
entity.Param.Add("XLXSBJCPYS_XXJGID", "%"+CurQueryEntity.FieldByName("XXJGID").Value.Trim()+"%");
|
||||
}
|
||||
strSQL.AppendLine(" order by isnull(XLCPYT_XSSX,0),XLXSBJCPYS_CPYT,XLXSBJCPYS_XLJBXHID ");
|
||||
return strSQL.ToString();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 控件事件
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user