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 XLBJD_WBBJDMX_XHZZTHList : SingleGridBase { XLBJD_WBBJDMX_XHZZTH entity = new XLBJD_WBBJDMX_XHZZTH(); XLBJD_WBBJDMX_XHZZTH_M queryentity = new XLBJD_WBBJDMX_XHZZTH_M(); protected void Page_Load(object sender, EventArgs e) { this.UMID = 100860043; this.UMName = "外部线缆产品导入"; this.CurMaster = Master; this.ModuleGV = grdContentGrid; this.CurEntity = entity; this.CurQueryEntity = queryentity; this.sURLTarget = "XLBJD_WBBJDMX_XHZZTHInfo.aspx"; this.sQueryURLTarget = "XLBJD_WBBJDMX_XHZZTHQuery.aspx"; this.PageWidth = 850; this.PageHeight = 600; base.DataKeyNames = new string[] { "XLXSBJDXTHDZQD_XH", "XLXSBJDXTHDZQD_THLX" }; this.Master.EnablePrintBtn = false; this.Master.EnableAttachBtn = false; base.InitPage(); if (!IsPostBack) { Master_OnStandardQuery(null, null); } } protected override void Master_OnStandardQuery(object sender, EventArgs e) { base.InitEntityByCondition(); 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("XLXSBJDXTHDZQD_XH", grdContentGrid.DataKeys[e.Row.RowIndex]["XLXSBJDXTHDZQD_XH"].ToString().Trim()); LinkPageParam.AddString("XLXSBJDXTHDZQD_THLX", grdContentGrid.DataKeys[e.Row.RowIndex]["XLXSBJDXTHDZQD_THLX"].ToString().Trim()); } base.moduleGV_RowDataBound(sender, e); } protected override void moduleGV_PageIndexChanging(object sender, GridViewPageEventArgs e) { base.InitEntityByCondition(); 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("XLXSBJDXTHDZQD_XH", grdContentGrid.DataKeys[grdContentGrid.SelectedIndex]["XLXSBJDXTHDZQD_XH"].ToString().Trim()); entity.Param.Add("XLXSBJDXTHDZQD_THLX", grdContentGrid.DataKeys[grdContentGrid.SelectedIndex]["XLXSBJDXTHDZQD_THLX"].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; } private StringBuilder GetQuerySelSQL() { StringBuilder strSQL = new StringBuilder(); strSQL.AppendLine("select XLXSBJDXTHDZQD_XH, XLXSBJDXTHDZQD_THLX, XLXSBJDXTHDZQD_THQGGZF, XLXSBJDXTHDZQD_THHGGZF, XLXSBJDXTHDZQD_WHR, XLXSBJDXTHDZQD_WHRID,XLXSBJDXTHDZQD_WHSJ from XLXSBJDXTHDZQD"); strSQL.AppendLine("where XLXSBJDXTHDZQD_THLX = 'XHZZTH' "); if (!string.IsNullOrEmpty(CurQueryEntity.FieldByName("THQXH").Value.Trim())) { strSQL.AppendLine(" and XLXSBJDXTHDZQD_THQGGZF like :pTHQXH "); entity.Param.Add("pTHQXH", "%" + CurQueryEntity.FieldByName("THQXH").Value.Trim() + "%"); } if (!string.IsNullOrEmpty(CurQueryEntity.FieldByName("THHXH").Value.Trim())) { strSQL.AppendLine(" and XLXSBJDXTHDZQD_THHGGZF like :pTHHXH "); entity.Param.Add("pTHHXH", "%" + CurQueryEntity.FieldByName("THHXH").Value.Trim() + "%"); } strSQL.AppendLine(" order by XLXSBJDXTHDZQD_XH "); return strSQL; } } }