private void LoadDataGrid() { try { PBSUnitStrategyBuilder sb = new PBSUnitStrategyBuilder(); string ProjectCode = this.txtProjectCode.Value; if (ProjectCode != "") { sb.AddStrategy(new Strategy(PBSUnitStrategyName.ProjectCode, ProjectCode)); } sb.AddOrder("PBSUnitName", true); string sql = sb.BuildMainQueryString(); QueryAgent qa = new QueryAgent(); EntityData entity = qa.FillEntityData("PBSUnit", sql); qa.Dispose(); dgList.DataSource = entity; dgList.DataBind(); entity.Dispose(); } catch (Exception ex) { ApplicationLog.WriteLog(this.ToString(), ex, ""); Response.Write(Rms.Web.JavaScript.Alert(true, "初始化页面出错:" + ex.Message)); } }
private void LoadDataGrid() { try { PBSUnitStrategyBuilder sb = new PBSUnitStrategyBuilder("V_PBSUnit"); string ProjectCode = this.txtProjectCode.Value; if (ProjectCode != "") { sb.AddStrategy(new Strategy(PBSUnitStrategyName.ProjectCode, ProjectCode)); } // string PBSUnitCode = this.txtSearchPBSUnitCode.Value.Trim(); // if (PBSUnitCode != "") // sb.AddStrategy(new Strategy(PBSUnitStrategyName.PBSUnitCode, PBSUnitCode)); string PBSUnitName = this.txtSearchPBSUnitName.Value.Trim(); if (PBSUnitName != "") { sb.AddStrategy(new Strategy(PBSUnitStrategyName.PBSUnitNameLike, PBSUnitName)); } sb.AddOrder("PBSUnitName", true); string sql = sb.BuildMainQueryString(); QueryAgent qa = new QueryAgent(); EntityData entity = qa.FillEntityData("PBSUnit", sql); qa.Dispose(); string[] arrField = { "TotalBuildArea", "PInvest", "Invest" }; decimal[] arrValue = BLL.MathRule.SumColumn(entity.CurrentTable, arrField); dgList.Columns[3].FooterText = arrValue[0].ToString("N"); dgList.Columns[4].FooterText = arrValue[1].ToString("N"); dgList.Columns[5].FooterText = arrValue[2].ToString("N"); dgList.DataSource = entity; dgList.DataBind(); entity.Dispose(); } catch (Exception ex) { ApplicationLog.WriteLog(this.ToString(), ex, ""); Response.Write(Rms.Web.JavaScript.Alert(true, "初始化页面出错:" + ex.Message)); } }
public static EntityData GetV_PBSUnitByProject(string ProjectCode) { EntityData data2; try { PBSUnitStrategyBuilder builder = new PBSUnitStrategyBuilder("V_PBSUnit"); builder.AddStrategy(new Strategy(PBSUnitStrategyName.ProjectCode, ProjectCode)); builder.AddOrder("PBSUnitName", true); string queryString = builder.BuildMainQueryString(); QueryAgent agent = new QueryAgent(); EntityData data = agent.FillEntityData("PBSUnit", queryString); agent.Dispose(); data2 = data; } catch (Exception exception) { throw exception; } return(data2); }