Beispiel #1
0
        public static bool IsPBSUnitNameExists(string name, string code, string ProjectCode)
        {
            bool flag2;

            try
            {
                bool flag = false;
                PBSUnitStrategyBuilder builder = new PBSUnitStrategyBuilder();
                builder.AddStrategy(new Strategy(PBSUnitStrategyName.ProjectCode, ProjectCode));
                builder.AddStrategy(new Strategy(PBSUnitStrategyName.PBSUnitName, name));
                builder.AddStrategy(new Strategy(PBSUnitStrategyName.PBSUnitCodeNot, code));
                string     queryString = builder.BuildMainQueryString();
                QueryAgent agent       = new QueryAgent();
                EntityData data        = agent.FillEntityData("PBSUnit", queryString);
                agent.Dispose();
                if (data.HasRecord())
                {
                    flag = true;
                }
                flag2 = flag;
            }
            catch (Exception exception)
            {
                throw exception;
            }
            return(flag2);
        }
        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));
            }
        }
Beispiel #3
0
        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));
            }
        }
Beispiel #4
0
        public static EntityData GetV_PBSUnitByCode(string PBSUnitCode)
        {
            EntityData data2;

            try
            {
                PBSUnitStrategyBuilder builder = new PBSUnitStrategyBuilder("V_PBSUnit");
                builder.AddStrategy(new Strategy(PBSUnitStrategyName.PBSUnitCode, PBSUnitCode));
                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);
        }