2026821
This commit is contained in:
@@ -0,0 +1,154 @@
|
||||
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 System.Text;
|
||||
using GThinking.N_MISPRO.Utility;
|
||||
|
||||
namespace GThinking.N_XLXSBJ
|
||||
{
|
||||
public partial class XSBJYWPZ_MRXHDYList : SingleGridBase
|
||||
{
|
||||
XSBJYWPZ_MRXHDY entity = new XSBJYWPZ_MRXHDY();
|
||||
XSBJYWPZ_MRXHDY_M queryentity = new XSBJYWPZ_MRXHDY_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_MRXHDYInfo.aspx";
|
||||
this.sQueryURLTarget = "XSBJYWPZ_MRXHDYQuery.aspx";
|
||||
this.PageHeight = 500;
|
||||
this.PageWidth = 700;
|
||||
|
||||
base.DataKeyNames = new string[] { "XLXSBJCPMRBZDY_XLXHID", "XLXSBJCPMRBZDY_XLGGID", "XLXSBJCPMRBZDY_XLBZID", "XLXSBJCPMRBZDY_DYDJID" };
|
||||
|
||||
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("XLXSBJCPMRBZDY_XLXHID", grdGrid.DataKeys[e.Row.RowIndex]["XLXSBJCPMRBZDY_XLXHID"].ToString().Trim());
|
||||
LinkPageParam.AddString("XLXSBJCPMRBZDY_XLGGID", grdGrid.DataKeys[e.Row.RowIndex]["XLXSBJCPMRBZDY_XLGGID"].ToString().Trim());
|
||||
}
|
||||
base.moduleGV_RowDataBound(sender, e);
|
||||
}
|
||||
|
||||
protected override void BeforeDelete(TDatabase db, ref bool ActionIsDone)
|
||||
{
|
||||
entity.Param.Add("XLXSBJCPMRBZDY_XLXHID", grdGrid.DataKeys[grdGrid.SelectedIndex]["XLXSBJCPMRBZDY_XLXHID"].ToString().Trim());
|
||||
entity.Param.Add("XLXSBJCPMRBZDY_XLGGID", grdGrid.DataKeys[grdGrid.SelectedIndex]["XLXSBJCPMRBZDY_XLGGID"].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 XLXSBJCPMRBZDY_XLXHID,XLXSBJCPMRBZDY_XLGGID,XLXSBJCPMRBZDY_XLBZID,rtrim(XLXSBJCPMRBZDY_XLBZID)||'|'||XLBZ_XLBZLXMC as XLBZID,XLXSBJCPMRBZDY_DYDJID,");
|
||||
strSQL.AppendLine(" XLXSBJCPMRBZDY_WHR,XLXSBJCPMRBZDY_WHRID,XLXSBJCPMRBZDY_WHSJ ");
|
||||
strSQL.AppendLine(" from XLXSBJCPMRBZDY ");
|
||||
strSQL.AppendLine(" left join XLBZ on XLBZ_XLBZID=XLXSBJCPMRBZDY_XLBZID");
|
||||
strSQL.AppendLine(" where 1=1");
|
||||
//型号模糊
|
||||
if (!CurQueryEntity.FieldByName("XLXHIDJQPP").Value.ToString().Trim().ToUpper().Equals("TRUE"))
|
||||
{
|
||||
if (!string.IsNullOrEmpty(CurQueryEntity.FieldByName("XLXHID").Value.Trim()))
|
||||
{
|
||||
strSQL.AppendLine(" \r\n and XLXSBJCPMRBZDY_XLXHID like :pXLXHID ");
|
||||
entity.Param.Add("pXLXHID", "%" + CurQueryEntity.FieldByName("XLXHID").Value.Trim() + "%");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
string sXLXHID = CurQueryEntity.FieldByName("XLXHID").Value.Trim();
|
||||
if (!string.IsNullOrEmpty(sXLXHID))
|
||||
{
|
||||
string[] sTemp = sXLXHID.Split(new Char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
|
||||
if (sTemp.Length >= 2)
|
||||
{
|
||||
strSQL.AppendLine(" \r\n and " + CMISproDataBase.GetWhereEqual("XLXSBJCPMRBZDY_XLXHID", sXLXHID));
|
||||
}
|
||||
else
|
||||
{
|
||||
strSQL.AppendLine(" \r\n and XLXSBJCPMRBZDY_XLXHID = :pXLXHID ");
|
||||
entity.Param.Add("pXLXHID", sXLXHID);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!string.IsNullOrEmpty(CurQueryEntity.FieldByName("DYDJID").Value.Trim()))
|
||||
{
|
||||
strSQL.AppendLine(" and " + CMISproDataBase.GetWhereEqual("XLXSBJCPMRBZDY_DYDJID", CurQueryEntity.FieldByName("DYDJID").Value.Trim()));
|
||||
}
|
||||
if (!string.IsNullOrEmpty(CurQueryEntity.FieldByName("XLGG").Value.Trim()))
|
||||
{
|
||||
strSQL.AppendLine(" and XLXSBJCPMRBZDY_XLGGID like :pXLGGID ");
|
||||
entity.Param.Add("pXLGGID", "%" + CurQueryEntity.FieldByName("XLGG").Value.Trim() + "%");
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(CurQueryEntity.FieldByName("XLBZID").Value.Trim()))
|
||||
{
|
||||
strSQL.AppendLine(" and XLXSBJCPMRBZDY_XLBZID = :pXLBZID ");
|
||||
entity.Param.Add("pXLBZID", CurQueryEntity.FieldByName("XLBZID").Value.Trim());
|
||||
}
|
||||
strSQL.AppendLine(" order by XLXSBJCPMRBZDY_XLXHID,XLXSBJCPMRBZDY_XLGGID,XLXSBJCPMRBZDY_XLBZID,XLXSBJCPMRBZDY_DYDJID ");
|
||||
return strSQL.ToString();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 控件事件
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user