Esempio n. 1
0
        public static EntityData GetLastConstructProgressReport(string PBSUnitCode, string EndDate, int n)
        {
            EntityData data2;

            try
            {
                ConstructProgressStrategyBuilder builder = new ConstructProgressStrategyBuilder();
                builder.AddStrategy(new Strategy(ConstructProgressStrategyName.PBSUnitCode, PBSUnitCode));
                ArrayList pas = new ArrayList();
                pas.Add("");
                pas.Add(EndDate);
                builder.AddStrategy(new Strategy(ConstructProgressStrategyName.ReportDateRange, pas));
                builder.AddOrder("ReportDate", false);
                builder.AddOrder("ProgressCode", false);
                string     queryString = builder.BuildQueryViewString();
                QueryAgent agent       = new QueryAgent();
                agent.SetTopNumber(n);
                EntityData data = agent.FillEntityData("ConstructProgress", queryString);
                agent.Dispose();
                data2 = data;
            }
            catch (Exception exception)
            {
                throw exception;
            }
            return(data2);
        }
Esempio n. 2
0
        public static EntityData GetConstructProgressReportFirstKg(string PBSUnitCode)
        {
            EntityData data2;

            try
            {
                string visualProgressNotStartInStr       = PBSRule.GetVisualProgressNotStartInStr();
                ConstructProgressStrategyBuilder builder = new ConstructProgressStrategyBuilder();
                builder.AddStrategy(new Strategy(ConstructProgressStrategyName.PBSUnitCode, PBSUnitCode));
                builder.AddStrategy(new Strategy(ConstructProgressStrategyName.VisualProgressNotIn, visualProgressNotStartInStr));
                builder.AddOrder("ReportDate", true);
                builder.AddOrder("ProgressCode", true);
                string     queryString = builder.BuildQueryViewString();
                QueryAgent agent       = new QueryAgent();
                agent.SetTopNumber(1);
                EntityData data = agent.FillEntityData("ConstructProgress", queryString);
                agent.Dispose();
                data2 = data;
            }
            catch (Exception exception)
            {
                throw exception;
            }
            return(data2);
        }
Esempio n. 3
0
        public static EntityData GetV_ConstructProgressByPBSUnit(string PBSUnitCode)
        {
            EntityData data2;

            try
            {
                ConstructProgressStrategyBuilder builder = new ConstructProgressStrategyBuilder();
                builder.AddStrategy(new Strategy(ConstructProgressStrategyName.PBSUnitCode, PBSUnitCode));
                builder.AddOrder("ReportDate", true);
                builder.AddOrder("ProgressCode", true);
                string     queryString = builder.BuildQueryViewString();
                QueryAgent agent       = new QueryAgent();
                EntityData data        = agent.FillEntityData("ConstructProgress", queryString);
                agent.Dispose();
                data2 = data;
            }
            catch (Exception exception)
            {
                throw exception;
            }
            return(data2);
        }
Esempio n. 4
0
        public static EntityData GetLastConstructProgressReportByVisualProgress(string PBSUnitCode, string VisualProgress)
        {
            EntityData data2;

            try
            {
                ConstructProgressStrategyBuilder builder = new ConstructProgressStrategyBuilder();
                builder.AddStrategy(new Strategy(ConstructProgressStrategyName.PBSUnitCode, PBSUnitCode));
                builder.AddStrategy(new Strategy(ConstructProgressStrategyName.VisualProgress, VisualProgress));
                builder.AddOrder("ReportDate", false);
                builder.AddOrder("ProgressCode", false);
                string     queryString = builder.BuildQueryViewString();
                QueryAgent agent       = new QueryAgent();
                agent.SetTopNumber(1);
                EntityData data = agent.FillEntityData("ConstructProgress", queryString);
                agent.Dispose();
                data2 = data;
            }
            catch (Exception exception)
            {
                throw exception;
            }
            return(data2);
        }
Esempio n. 5
0
        private void LoadDataGrid()
        {
            try
            {
                string PBSUnitCode = this.sltSearchPBSUnitCode.Value.Trim();

                ConstructProgressStrategyBuilder sb = new ConstructProgressStrategyBuilder();

                sb.AddStrategy(new Strategy(ConstructProgressStrategyName.ProjectCode, this.txtProjectCode.Value));
                if (PBSUnitCode.Length > 0)
                {
                    sb.AddStrategy(new Strategy(ConstructProgressStrategyName.PBSUnitCode, PBSUnitCode));
                }

                if (this.dtSearchReportDateBegin.Value != "" || this.dtSearchReportDateEnd.Value != "")
                {
                    ArrayList ar = new ArrayList();
                    ar.Add(this.dtSearchReportDateBegin.Value);
                    ar.Add(this.dtSearchReportDateEnd.Value);
                    sb.AddStrategy(new Strategy(ConstructProgressStrategyName.ReportDateRange, ar));
                }

                if (this.txtReportPerson.Value != "")
                {
                    sb.AddStrategy(new Strategy(ConstructProgressStrategyName.ReportPerson, this.txtReportPerson.Value));
                }

                if (this.sltSearchVisualProgress.Value != "")
                {
                    sb.AddStrategy(new Strategy(ConstructProgressStrategyName.VisualProgress, this.sltSearchVisualProgress.Value));
                }

                if (this.txtSearchContent.Value != "")
                {
                    sb.AddStrategy(new Strategy(ConstructProgressStrategyName.Content, this.txtSearchContent.Value));
                }

                if (this.txtSearchRiskRemark.Value != "")
                {
                    sb.AddStrategy(new Strategy(ConstructProgressStrategyName.RiskRemark, this.txtSearchRiskRemark.Value));
                }

                //排序
                string sortsql = BLL.GridSort.GetSortSQL(ViewState);
                if (sortsql == "")
                {
                    //缺省排序
                    sb.AddOrder("ReportDate", false);
                    sb.AddOrder("ProgressCode", false);
                }

                string sql = sb.BuildQueryViewString();

                if (sortsql != "")
                {
                    //点列标题排序
                    sql = sql + " order by " + sortsql;
                }

                QueryAgent qa     = new QueryAgent();
                EntityData entity = qa.FillEntityData("ConstructProgress", sql);
                qa.Dispose();

                //				EntityData entity = DAL.EntityDAO.ConstructDAO.GetConstructProgressByPBSUnit(PBSUnitCode);

                this.dgList.DataSource = entity;
                this.dgList.DataBind();
                entity.Dispose();
            }
            catch (Exception ex)
            {
                ApplicationLog.WriteLog(this.ToString(), ex, "");
                Response.Write(Rms.Web.JavaScript.Alert(true, "初始化页面出错:" + ex.Message));
            }
        }