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_XHGZList : SingleGridBase { XLBJD_WBBJDMX_XHGZ entity = new XLBJD_WBBJDMX_XHGZ(); XLBJD_WBBJDMX_XHGZ_M queryentity = new XLBJD_WBBJDMX_XHGZ_M(); #region Page事件继承 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_XHGZInfo.aspx"; this.sQueryURLTarget = "XLBJD_WBBJDMX_XHGZQuery.aspx"; this.PageWidth = 750; this.PageHeight = 600; base.DataKeyNames = new string[] { "XLXHTHGZ_XH"}; this.Master.EnablePrintBtn = false; this.Master.EnableAttachBtn = false; base.InitPage(); if (!IsPostBack) { Master_OnStandardQuery(null, null); } } #endregion #region 模板事件继承 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("XLXHTHGZ_XH", grdContentGrid.DataKeys[e.Row.RowIndex]["XLXHTHGZ_XH"].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("XLXHTHGZ_XH", grdContentGrid.DataKeys[grdContentGrid.SelectedIndex]["XLXHTHGZ_XH"].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 = 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 StringBuilder GetQuerySelSQL() { StringBuilder strSQL = new StringBuilder(); strSQL.AppendLine(" select XLXHTHGZ_XH,XLXHTHGZ_BZ,XLXHTHGZ_THQ, XLXHTHGZ_THH, "); strSQL.AppendLine(" XLXHTHGZ_WHR, XLXHTHGZ_WHRID,XLXHTHGZ_WHSJ from XLXHTHGZ "); strSQL.AppendLine("where 1=1 "); if (!CurQueryEntity.FieldByName("THQ").Value.Trim().Equals("")) { strSQL.AppendLine(" AND XLXHTHGZ_THQ LIKE :XLXHTHGZ_THQ "); entity.Param.Add("XLXHTHGZ_THQ", "%"+CurQueryEntity.FieldByName("THQ").Value.Trim()+"%"); } if (!CurQueryEntity.FieldByName("THH").Value.Trim().Equals("")) { strSQL.AppendLine(" AND XLXHTHGZ_THH LIKE :XLXHTHGZ_THH "); entity.Param.Add("XLXHTHGZ_THH", "%" + CurQueryEntity.FieldByName("THH").Value.Trim() + "%"); } strSQL.AppendLine(" order by XLXHTHGZ_XH "); return strSQL; } #endregion #region 控件事件 #endregion } }