private void LoadData()
        {
            string projectCode = Request["ProjectCode"] + "";

            try
            {
                string isDynamic         = Request["IsDynamic"] + "";
                BudgetStrategyBuilder sb = new BudgetStrategyBuilder();
                sb.AddStrategy(new Strategy(BudgetStrategyName.ProjectCode, projectCode));
                if (isDynamic != "")
                {
                    sb.AddStrategy(new Strategy(BudgetStrategyName.IsDynamic, isDynamic));
                }

                string     sql = sb.BuildMainQueryString();
                QueryAgent qa  = new QueryAgent();
                qa.SetTopNumber(1);
                EntityData budget = qa.FillEntityData("Budget", sql);
                qa.Dispose();

                this.dgList.DataSource = budget.CurrentTable;
                this.dgList.DataBind();
                budget.Dispose();
            }
            catch (Exception ex)
            {
                ApplicationLog.WriteLog(this.ToString(), ex, "加载列表错误");
            }
        }
Beispiel #2
0
        public static EntityData GetLastVisualProgress(string ProgressType)
        {
            EntityData data2;

            try
            {
                VisualProgressStrategyBuilder builder = new VisualProgressStrategyBuilder();
                if (ProgressType != "")
                {
                    builder.AddStrategy(new Strategy(VisualProgressStrategyName.ProgressType, ProgressType.ToString()));
                }
                builder.AddOrder("SortID", false);
                string     queryString = builder.BuildMainQueryString();
                QueryAgent agent       = new QueryAgent();
                agent.SetTopNumber(1);
                EntityData data = agent.FillEntityData("VisualProgress", queryString);
                agent.Dispose();
                data2 = data;
            }
            catch (Exception exception)
            {
                throw exception;
            }
            return(data2);
        }
Beispiel #3
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);
        }
Beispiel #4
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);
        }
Beispiel #5
0
        public static object GetConstructProgressStepFirstKg(string PBSUnitCode)
        {
            object obj3;

            try
            {
                object obj2 = DBNull.Value;
                string visualProgressNotStartInStr           = PBSRule.GetVisualProgressNotStartInStr();
                ConstructProgressStepStrategyBuilder builder = new ConstructProgressStepStrategyBuilder();
                builder.AddStrategy(new Strategy(ConstructProgressStepStrategyName.PBSUnitCode, PBSUnitCode));
                builder.AddStrategy(new Strategy(ConstructProgressStepStrategyName.VisualProgressNotIn, visualProgressNotStartInStr));
                builder.AddStrategy(new Strategy(ConstructProgressStepStrategyName.StartDateNotNull));
                builder.AddOrder("StartDate", true);
                string     queryString = builder.BuildMainQueryString();
                QueryAgent agent       = new QueryAgent();
                agent.SetTopNumber(1);
                EntityData data = agent.FillEntityData("ConstructProgressStep", queryString);
                agent.Dispose();
                if (data.HasRecord())
                {
                    obj2 = data.CurrentRow["StartDate"];
                }
                obj3 = obj2;
            }
            catch (Exception exception)
            {
                throw exception;
            }
            return(obj3);
        }
Beispiel #6
0
        public static int GetPBSUnitFloorCount(string PBSUnitCode)
        {
            int num2;

            try
            {
                int num = 0;
                BuildingStrategyBuilder builder = new BuildingStrategyBuilder();
                builder.AddStrategy(new Strategy(BuildingStrategyName.PBSUnitCode, PBSUnitCode));
                builder.AddOrder("FloorCount", false);
                QueryAgent agent = new QueryAgent();
                agent.SetTopNumber(1);
                string    queryString = builder.BuildMainQueryString();
                DataTable table       = agent.ExecSqlForDataSet(queryString).Tables[0];
                if (table.Rows.Count > 0)
                {
                    num = ConvertRule.ToInt(table.Rows[0]["IFloorCount"]);
                }
                agent.Dispose();
                num2 = num;
            }
            catch (Exception exception)
            {
                throw exception;
            }
            return(num2);
        }
Beispiel #7
0
        private string GetSortID(string strWBSCode)
        {
            string strSortID = "";

            // 取得本级SortID然后+5
            DAL.QueryStrategy.WBSStrategyBuilder WSB = new RmsPM.DAL.QueryStrategy.WBSStrategyBuilder();
            WSB.AddStrategy(new Strategy(DAL.QueryStrategy.WBSStrategyName.ParentCode, strWBSCode));
            WSB.AddOrder("SortID", false);
            string sql = WSB.BuildMainQueryString();

            QueryAgent QA = new QueryAgent();

            QA.SetTopNumber(1);
            DataSet dsTask = QA.ExecSqlForDataSet(sql);

            QA.Dispose();
            if (dsTask.Tables.Count > 0 && dsTask.Tables[0].Rows.Count > 0)
            {
                long intTmp = BLL.ConvertRule.ToLong(dsTask.Tables[0].Rows[0]["SortID"]) + 1;
                strSortID = "0" + intTmp.ToString();
            }
            else
            {
                EntityData entitySort = WBSDAO.GetV_TaskByCode(strWBSCode);
                strSortID = entitySort.GetString("SortID") + "01";
            }
            return(strSortID);
        }
Beispiel #8
0
        private void LoadNotice()
        {
            NoticeStrategyBuilder noticeBuilder = new NoticeStrategyBuilder();
            ArrayList             arA           = new ArrayList();

            arA.Add("080104");
            arA.Add(base.user.UserCode);
            arA.Add(user.BuildStationCodes());


            //ArrayList arB = new ArrayList();//为状态赋值
            //arB.Add("1");
            noticeBuilder.AddStrategy(new Strategy(DAL.QueryStrategy.NoticeStrategyName.status, "1,2"));
            if (_IsOther)
            {
                noticeBuilder.AddStrategy(new Strategy(DAL.QueryStrategy.NoticeStrategyName.Type, "99"));
            }
            else
            {
                noticeBuilder.AddStrategy(new Strategy(DAL.QueryStrategy.NoticeStrategyName.Type, "1"));
            }
            noticeBuilder.AddStrategy(new Strategy(DAL.QueryStrategy.NoticeStrategyName.AccessRange, arA));
            noticeBuilder.AddOrder("SubmitDate", false);
            string sql = noticeBuilder.BuildMainQueryString();


            //sql += " and status='1'";
            QueryAgent qa = new QueryAgent();

            qa.SetTopNumber(this.intListNoticeNum);
            EntityData entityNotice = qa.FillEntityData("Notice", sql);

            qa.Dispose();

            entityNotice.CurrentTable.Columns.Add("NoticeClassTitle"); //改动
            for (int i = 0; i < entityNotice.CurrentTable.Rows.Count; i++)
            {                                                          //改动
                if (entityNotice.CurrentTable.Rows[i]["NoticeClass"].ToString() != string.Empty)
                {
                    entityNotice.CurrentTable.Rows[i]["NoticeClassTitle"] = entityNotice.CurrentTable.Rows[i]["NoticeClass"].ToString() + ":" + entityNotice.CurrentTable.Rows[i]["Title"].ToString();
                }
                else
                {
                    entityNotice.CurrentTable.Rows[i]["NoticeClassTitle"] = "" + entityNotice.CurrentTable.Rows[i]["Title"].ToString();
                }
                //改动
                string strTmp = entityNotice.CurrentTable.Rows[i]["NoticeClassTitle"].ToString();
                if (strTmp.Length > 20)
                {
                    entityNotice.CurrentTable.Rows[i]["NoticeClassTitle"] = strTmp.Substring(0, 20) + "...";//改动
                }
            }
            rpNotice.DataSource = entityNotice;
            rpNotice.DataBind();
            entityNotice.Dispose();

            // 检查当前用户权限
            this.hylNewNotice.Visible = (this.IsInRole("080101"))?true:false;
        }
Beispiel #9
0
        private void LoadUnderWay()
        {
            WBSStrategyBuilder asb = new WBSStrategyBuilder();
            ArrayList          arA = new ArrayList();

            arA.Add("070107");
            arA.Add(user.UserCode);
            asb.AddStrategy(new Strategy(DAL.QueryStrategy.WBSStrategyName.AccessRange, arA));
            asb.AddStrategy(new Strategy(DAL.QueryStrategy.WBSStrategyName.Status, "1"));
            asb.AddOrder(" PlannedStartDate ", false);
            string     sql = asb.BuildQueryDeskTopString();
            QueryAgent QA  = new QueryAgent();

            QA.SetTopNumber(this.intListUnderwayNum);
            DataSet dsUnderWay = QA.ExecSqlForDataSet(sql);

            QA.Dispose();
            DataTable dt = dsUnderWay.Tables[0];

            dt.Columns.Add("Img", System.Type.GetType("System.String"));
            dt.Columns.Add("StatusName", System.Type.GetType("System.String"));
            dt.Columns.Add("Master", System.Type.GetType("System.String"));
            EntityData entityUser = new EntityData("TaskPerson");

            if (dt.Rows.Count > 0)
            {
                //点更多时,查看第1条所在项目
                this.imgOpenMoreUnderWayTask.Attributes["ProjectCode"] = dt.Rows[0]["ProjectCode"].ToString();

                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    if (dt.Rows[i]["ImportantLevel"].ToString() == "1")
                    {
                        dt.Rows[i]["Img"] = "<img src=\"images/icon_important.gif\" width=\"17\" height=\"18\">";
                    }
                    dt.Rows[i]["StatusName"] = BLL.ComSource.GetTaskStatusName(dt.Rows[i]["Status"].ToString());
                    entityUser = WBSDAO.GetTaskPersonByWBSCode(dt.Rows[i]["WBSCode"].ToString());
                    string strTUser = "";// 取得当前任务负责人
                    for (int j = 0; j < entityUser.CurrentTable.Rows.Count; j++)
                    {
                        if (entityUser.CurrentTable.Rows[j]["Type"].ToString() == "2") // 负责
                        {
                            strTUser += (strTUser == "") ? "" : ",";
                            strTUser += BLL.SystemRule.GetUserName(entityUser.CurrentTable.Rows[j]["UserCode"].ToString());
                        }
                    }                   //strTUser.Substring(0,strTUser.Length-1)
                    dt.Rows[i]["Master"] = (strTUser.Length > 0) ? strTUser.Substring(0, strTUser.Length - 1) : "";
                }
            }

            this.rpUnderWay.DataSource = dsUnderWay;
            this.rpUnderWay.DataBind();
            dsUnderWay.Dispose();
        }
Beispiel #10
0
        private void LoadAttention()
        {
            AttentionStrategyBuilder asb = new AttentionStrategyBuilder();
            ArrayList arA = new ArrayList();

            arA.Add("070110");
            arA.Add(user.UserCode);
            arA.Add(user.BuildStationCodes());
            asb.AddStrategy(new Strategy(DAL.QueryStrategy.AttentionStrategyName.AccessRange, arA));
            asb.AddOrder(" AddTime ", false);
            string     sql = asb.BuildMainQueryString();
            QueryAgent qa  = new QueryAgent();

            qa.SetTopNumber(this.intListAttentionNum);
            EntityData entityAttention = qa.FillEntityData("TaskAttention", sql);

            qa.Dispose();
            rpAttention.DataSource = entityAttention;
            //			EntityData entityAttention = WBSDAO.GetAllTaskAttention();
            if (entityAttention.HasRecord())
            {
                //点更多时,查看第1条所在项目
                this.imgOpenMoreWBSAttention.Attributes["ProjectCode"] = entityAttention.CurrentTable.Rows[0]["ProjectCode"].ToString();

                DataTable dtAttentionNew = entityAttention.CurrentTable;
                dtAttentionNew.Columns.Add("Img", System.Type.GetType("System.String"));
                //				int i = 0;
                //				foreach(DataRow dr in dtAttentionNew.Rows)
                //				{
                //					if(dr["AddModule"].ToString()=="工作信息")
                //					{
                //						EntityData entityTask = WBSDAO.GetTaskByWBSCode(dr["MasterCode"].ToString());
                //						string strImportantLevel = entityTask.GetInt("ImportantLevel").ToString();
                //						if(strImportantLevel=="1")
                //							dr["Img"] =  "<img src=\"images/icon_important.gif\" width=\"17\" height=\"18\">";
                //					}
                //					if(dr["AddModule"].ToString()=="其他信息")
                //					{}
                //
                //					i++;
                //					if(i>this.intListAttentionNum) break;
                //				}
                this.rpAttention.DataSource = dtAttentionNew;
                this.rpAttention.DataBind();
            }
            entityAttention.Dispose();
        }
Beispiel #11
0
        public static EntityData GetCurrConstructAnnualPlanByPBSUnit(string PBSUnitCode)
        {
            EntityData data2;

            try
            {
                ConstructAnnualPlanStrategyBuilder builder = new ConstructAnnualPlanStrategyBuilder();
                builder.AddStrategy(new Strategy(ConstructAnnualPlanStrategyName.PBSUnitCode, PBSUnitCode));
                builder.AddOrder("IYear", false);
                string     queryString = builder.BuildMainQueryString();
                QueryAgent agent       = new QueryAgent();
                agent.SetTopNumber(1);
                EntityData data = agent.FillEntityData("ConstructAnnualPlan", queryString);
                agent.Dispose();
                data2 = data;
            }
            catch (Exception exception)
            {
                throw exception;
            }
            return(data2);
        }
Beispiel #12
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);
        }
Beispiel #13
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            string Value = Request.QueryString["Value"] + "";

            string UnitCode = "";
            string UnitName = "";
            string SortID   = "";
            string Hint     = "";
            string IsExists = "";

            if (Value != "")
            {
                //按编号查
                EntityData entity = DAL.EntityDAO.OBSDAO.GetUnitBySortID(Value);
                entity.Dispose();

                //按名称查
                if (!entity.HasRecord())
                {
                    entity = DAL.EntityDAO.OBSDAO.GetUnitByUnitName(Value);
                    entity.Dispose();
                }

                //按名称模糊查
                if (!entity.HasRecord())
                {
                    UnitStrategyBuilder sb = new UnitStrategyBuilder();

                    sb.AddStrategy(new Strategy(UnitStrategyName.UnitName, "%" + Value + "%"));

                    string sql = sb.BuildMainQueryString();

                    sql = sql + sb.GetDefaultOrder();

                    QueryAgent qa = new QueryAgent();
                    qa.SetTopNumber(1);
                    entity = qa.FillEntityData("Unit", sql);
                    qa.Dispose();
                }

                if (entity.HasRecord())
                {
                    UnitCode = entity.GetString("UnitCode");
                    UnitName = entity.GetString("UnitName");
                    SortID   = entity.GetString("SortID");
                    IsExists = "1";
                }
                else
                {
                    Hint = "部门不存在 !";
                }
            }

            string sResult = "<Result>"
                             + "<UnitCode>" + UnitCode + "</UnitCode>"
                             + "<UnitName>" + UnitName + "</UnitName>"
                             + "<SortID>" + SortID + "</SortID>"
                             + "<Hint>" + Hint + "</Hint>"
                             + "<IsExists>" + IsExists + "</IsExists>"
                             + "</Result>";

            Response.Write(sResult);
            Response.End();
        }
Beispiel #14
0
        /// <summary>
        /// 数据加载
        /// </summary>
        private void LoadData()
        {
            // 当前版本的合同号
            string curContractCode = BLL.ContractRule.GetCurrentContractVersionCode(ContractCode);

            this.ViewState.Add("CurrentContractCode", curContractCode);
            try
            {
                EntityData entity     = DAL.EntityDAO.ContractDAO.GetStandard_ContractByCode(ContractCode);
                decimal    totalMoney = decimal.Zero;
                if (entity.HasRecord())
                {
                    /************************ 采购单 *************************/
                    DAL.QueryStrategy.PurchaseFlowStrategyBuilder sbp = new DAL.QueryStrategy.PurchaseFlowStrategyBuilder();
                    sbp.AddStrategy(new Strategy(DAL.QueryStrategy.PurchaseFlowStrategyName.ContractCode, entity.GetString("ContractCode")));

                    string sqlp = sbp.BuildMainQueryString();

                    QueryAgent QAp          = new QueryAgent();
                    EntityData entityp      = QAp.FillEntityData("PurchaseFlow", sqlp);
                    string     PurchaseName = "";
                    string     PurchaseCode = "";
                    if (entityp.HasRecord())
                    {
                        PurchaseName = entityp.CurrentRow["Purpose"].ToString();
                        PurchaseCode = entityp.CurrentRow["PurchaseFlowCode"].ToString();
                    }
                    QAp.Dispose();
                    entityp.Dispose();
                    if (PurchaseCode != "")
                    {
                        this.PurchaseTr.Visible     = true;
                        this.PurchaseLink.InnerHtml = "<a href=\"javascript:OpenFullWindow('../Purchase/PurchaseManage.aspx?frameType=List&action=View&applicationCode=" + PurchaseCode + "','采购单');return false;\">" + PurchaseName + "</a>";
                    }
                    else
                    {
                        this.PurchaseTr.Visible = false;
                    }
                    /*********************************************************/
                    this.ProjectCode            = entity.GetString("ProjectCode");
                    this.LabelContractID.Text   = entity.GetString("ContractID");
                    this.LabelType.Text         = BLL.ContractRule.GetContractTypeName(entity.GetString("Type"));
                    this.LabelRemark.Text       = entity.GetString("Remark");
                    this.LabelContractName.Text = entity.GetString("ContractName");

                    this.LabelContractDate.Text   = entity.GetDateTimeOnlyDate("ContractDate");
                    this.LabelContractPerson.Text = BLL.SystemRule.GetUserName(entity.GetString("ContractPerson"));

                    this.SupplierSpan.InnerHtml = "<A href=\"javascript:doViewSupplier('" + entity.GetString("SupplierCode") + "');\">" + BLL.ProjectRule.GetSupplierName(entity.GetString("SupplierCode")) + "</A>";
                    totalMoney = entity.GetDecimal("TotalMoney");
                    this.LabelTotalMoney.Text = BLL.StringRule.BuildShowNumberString(totalMoney);

                    this.lblThirdParty.Text     = entity.GetString("ThirdParty");
                    this.lblUnitName.Text       = BLL.SystemRule.GetUnitName(entity.GetString("UnitCode"));
                    this.lblContractObject.Text = entity.GetString("ContractObject");

                    string WBSCode = entity.GetString("WBSCode");
                    if (WBSCode != "")
                    {
                        EntityData entityTask = DAL.EntityDAO.WBSDAO.GetTaskByCode(WBSCode);
                        if (entityTask.HasRecord())
                        {
                            this.lblTaskName.Text = entityTask.GetString("TaskName");
                            this.hrefTaskName.Attributes["hint"] = BLL.ConstructProgRule.GetTaskHintHtml(entityTask.CurrentRow);
                            this.hrefTaskName.HRef = "javascript:OpenTask('" + WBSCode + "');";
                        }
                        entityTask.Dispose();
                    }

                    int status = entity.GetInt("Status");
                    // 设定合同变更标记
                    if (status == 4)
                    {
                        RmsPM.DAL.QueryStrategy.ContractStrategyBuilder CSB = new RmsPM.DAL.QueryStrategy.ContractStrategyBuilder();

                        CSB.AddStrategy(new Strategy(DAL.QueryStrategy.ContractStrategyName.ContractCode, curContractCode));
                        string     sql1 = CSB.BuildMainQueryString();
                        QueryAgent qa1  = new QueryAgent();
                        qa1.SetTopNumber(1);
                        EntityData entityTemp = qa1.FillEntityData("Contract", sql1);
                        qa1.Dispose();

                        // 对比
                        if (entityTemp.HasRecord())
                        {
                            if (entity.GetString("Type") != entityTemp.GetString("Type"))
                            {
                                this.LabelType.BackColor = Color.Yellow;
                            }
                            if (entity.GetString("Remark") != entityTemp.GetString("Remark"))
                            {
                                this.LabelRemark.BackColor = Color.Yellow;
                            }
                            if (entity.GetString("ContractName") != entityTemp.GetString("ContractName"))
                            {
                                this.LabelContractName.BackColor = Color.Yellow;
                            }
                            if (entity.GetDateTimeOnlyDate("ContractDate") != entityTemp.GetDateTimeOnlyDate("ContractDate"))
                            {
                                this.LabelContractDate.BackColor = Color.Yellow;
                            }
                            if (entity.GetString("ContractPerson") != entityTemp.GetString("ContractPerson"))
                            {
                                this.LabelContractPerson.BackColor = Color.Yellow;
                            }
                            if (entity.GetString("SupplierCode") != entityTemp.GetString("SupplierCode"))
                            {
                                this.SupplierSpan.Style["background-color"] = "Yellow";
                            }
                            if (entity.GetDecimal("TotalMoney") != entityTemp.GetDecimal("TotalMoney"))
                            {
                                this.LabelTotalMoney.BackColor = Color.Yellow;
                            }
                            if (entity.GetString("ThirdParty") != entityTemp.GetString("ThirdParty"))
                            {
                                this.lblThirdParty.BackColor = Color.Yellow;
                            }
                            if (entity.GetString("UnitCode") != entityTemp.GetString("UnitCode"))
                            {
                                this.lblUnitName.BackColor = Color.Yellow;
                            }
                            if (entity.GetString("ContractObject") != entityTemp.GetString("ContractObject"))
                            {
                                this.lblContractObject.BackColor = Color.Yellow;
                            }
                            if (entity.GetString("WBSCode") != entityTemp.GetString("WBSCode"))
                            {
                                this.lblTaskName.BackColor = Color.Yellow;
                            }
                            if (entity.GetString("AlloType") != entityTemp.GetString("AlloType"))
                            {
                                this.tdAllocateRelation.InnerHtml = "<span style='background-color: #FFFF00'>" + this.tdAllocateRelation.InnerHtml + "</span>";
                            }
                        }
                        entityTemp.Dispose();
                    }

                    string alloType = entity.GetString("AlloType");


                    // 合同已付和未付款
                    decimal ahMoney = BLL.CBSRule.GetAHMoney("", "", "", ContractCode, "1");
                    this.lblAPMoney.Text = BLL.StringRule.BuildShowNumberString(ahMoney);
                    this.lblUPMoney.Text = BLL.StringRule.BuildShowNumberString(totalMoney - ahMoney);

                    // 合同状态: 0: 正常; 1 待审核,当前合同; 2 合同结算完毕,结束 ;
                    //            3 申请不通过 ; 4 变更申请;5 变更申请不通过,作废; 6 历史记录
                    this.btnModifyPaymentPlan.Visible = false;

                    this.lblStatus.Text = BLL.ContractRule.GetContractStatusName(status.ToString());

                    // 标记原合同状态为变更申请 然后标记当前合同
                    string tmp = BLL.ContractRule.GetContractVersionCode(ContractCode, "4");
                    if (tmp.Length > 0)
                    {
                        this.lblStatus.Text += "   变更申请";
                    }

                    if (status == 0 || status == 4 || status == 6)
                    {
                        this.tdBefore.InnerText = "原合同金额(差额):";
                        // 取得第一笔合同总金额

                        RmsPM.DAL.QueryStrategy.ContractStrategyBuilder CSB1 = new RmsPM.DAL.QueryStrategy.ContractStrategyBuilder();
                        CSB1.AddStrategy(new Strategy(DAL.QueryStrategy.ContractStrategyName.Status, "0,4,6"));
                        CSB1.AddStrategy(new Strategy(DAL.QueryStrategy.ContractStrategyName.ContractLabel, entity.GetString("ContractLabel")));
                        CSB1.AddOrder("ChangeDate", true);
                        string     sql2 = CSB1.BuildMainQueryString();
                        QueryAgent qa2  = new QueryAgent();
                        qa2.SetTopNumber(1);
                        EntityData entityfirst = qa2.FillEntityData("Contract", sql2);
                        qa2.Dispose();

                        decimal dtmp = 0.0m;
                        if (entityfirst.HasRecord())
                        {
                            dtmp = entity.GetDecimal("TotalMoney") - entityfirst.GetDecimal("TotalMoney");
                            this.lblBeforeAccountTotalMoney.Text = BLL.StringRule.BuildShowNumberString(entityfirst.GetDecimal("TotalMoney")) + "(" + BLL.StringRule.BuildShowNumberString(dtmp) + ")";
                        }
                    }

                    switch (status)
                    {
                    case 0:
                        this.btnModifyPaymentPlan.Visible = true;
                        string changingCode = BLL.ContractRule.GetChangingContractVersionCode(ContractCode);
                        break;

                    case 2:
                        this.tdBefore.InnerText = "原合同金额:";
                        this.lblBeforeAccountTotalMoney.Text = BLL.StringRule.BuildShowNumberString(entity.GetDecimal("BeforeAccountTotalMoney"));
                        break;
                    }

                    //分摊的楼栋名称
                    entity.SetCurrentTable("ContractBuilding");
                    int    iBCount      = entity.CurrentTable.Rows.Count;
                    string buildingName = "";
                    for (int i = 0; i < iBCount; i++)
                    {
                        entity.SetCurrentRow(i);
                        if (alloType == "P")
                        {
                            buildingName = "项目";
                        }
                        else if (alloType == "U")
                        {
                            string pCode = entity.GetString("PBSUnitCode");
                            buildingName += "<a href=## onclick='showPBS(code,alloType)' alloType='U' code='" + pCode + "'>" + BLL.PBSRule.GetPBSUnitName(pCode) + "</a>&nbsp; ";
                        }
                        else if (alloType == "B")
                        {
                            string bCode = entity.GetString("BuildingCode");
                            buildingName += "<a href=## onclick='showPBS(code,alloType)' alloType='B' code='" + bCode + "'>" + BLL.ProductRule.GetBuildingName(bCode) + "</a>&nbsp; ";
                        }
                    }
                    this.tdAllocateRelation.InnerHtml = buildingName;
                }

                entity.SetCurrentTable("ContractExecutePlan");


                // 请款单明细, 统计费用分解中各个款项的付款请款
                PaymentItemStrategyBuilder sbPaymentItem = new PaymentItemStrategyBuilder();
                sbPaymentItem.AddStrategy(new Strategy(PaymentItemStrategyName.ContractCode, ContractCode));
                sbPaymentItem.AddStrategy(new Strategy(PaymentItemStrategyName.Status, "1,2"));
                string     sql         = sbPaymentItem.BuildQueryViewString();
                QueryAgent qa          = new QueryAgent();
                EntityData paymentItem = qa.FillEntityData("V_PaymentItem", sql);

                entity.SetCurrentTable("ContractAllocation");
                entity.Tables["ContractAllocation"].Columns.Add("TotalPayoutMoney");
                entity.Tables["ContractAllocation"].Columns.Add("PayConditionHtml");
                foreach (DataRow dr in entity.Tables["ContractAllocation"].Rows)
                {
                    string  allocateCode = (string)dr["AllocateCode"];
                    decimal tp           = BLL.MathRule.SumColumn(paymentItem.CurrentTable, "ItemMoney", String.Format("AllocateCode='{0}'", allocateCode));

                    // 已付金额
                    dr["TotalPayoutMoney"] = tp;

                    //付款条件
                    dr["PayConditionHtml"] = BLL.ContractRule.GetContractPayConditionHtml(allocateCode, entity.Tables["ContractPayCondition"], false);
                }
                this.dgPaymentPlanList.DataSource = new DataView(entity.Tables["ContractAllocation"], "", "PlanningPayDate", DataViewRowState.CurrentRows);
                this.dgPaymentPlanList.DataBind();

                entity.Dispose();
                paymentItem.Dispose();

                ScriptResponse();
            }
            catch (Exception ex)
            {
                ApplicationLog.WriteLog(this.ToString(), ex, "加载合同数据失败。");
                Response.Write(Rms.Web.JavaScript.Alert(true, "加载合同数据失败:" + ex.Message));
            }
        }
Beispiel #15
0
        /// <summary>
        /// 获取工作报告列表,分发范围之内的人都可以看到
        /// </summary>
        private void LoadExecute()
        {
            TaskExecuteStrategyBuilder asb = new TaskExecuteStrategyBuilder();
            ArrayList arA = new ArrayList();

            arA.Add("070202");
            arA.Add(user.UserCode);
            arA.Add(user.BuildStationCodes());
            asb.AddStrategy(new Strategy(DAL.QueryStrategy.TaskExecuteStrategyName.AccessRange, arA));
            asb.AddOrder("ExecuteDate", false);
            string     sql = asb.BuildMainQueryString();
            QueryAgent qa  = new QueryAgent();

            qa.SetTopNumber(this.intListExecuteNum);
            EntityData entityExecute = qa.FillEntityData("TaskExecute", sql);

            qa.Dispose();
            //EntityData entityExecute = WBSDAO.GetTaskExecuteDeskTop(((User)Session["User"]).UserCode);
            //EntityData entityWBS = null;
            if (entityExecute.HasRecord())
            {
                //点更多时,查看第1条所在项目
                this.imgOpenMoreTaskExecute.Attributes["ProjectCode"] = entityExecute.CurrentTable.Rows[0]["ProjectCode"].ToString();

                DataTable dtExecuteNew = entityExecute.CurrentTable;
                dtExecuteNew.Columns.Add("Img", System.Type.GetType("System.String"));
                dtExecuteNew.Columns.Add("TaskName", System.Type.GetType("System.String"));
                foreach (DataRow dr in dtExecuteNew.Rows)
                {
                    try
                    {
                        string     tmp       = dr["WBSCode"].ToString();
                        EntityData entityWBS = WBSDAO.GetV_TaskByCode(tmp);
                        if (entityWBS.HasRecord())
                        {
                            dr["WBSCode"]  = entityWBS.CurrentTable.Rows[0]["WBSCode"].ToString();
                            dr["TaskName"] = entityWBS.CurrentTable.Rows[0]["TaskName"].ToString();
                            string strName = entityWBS.CurrentTable.Rows[0]["TaskName"].ToString();
                            if (strName.Length > 8)
                            {
                                dr["TaskName"] = strName.Substring(0, 8) + "...";
                            }
                            if (entityWBS.CurrentTable.Rows[0]["ImportantLevel"].ToString() == "1")
                            {
                                dr["Img"] = "<img src=\"images/icon_important.gif\" width=\"17\" height=\"18\">";
                            }
                            string strTmp = dr["Detail"].ToString();
                            if (strTmp.Length > 8)
                            {
                                dr["Detail"] = Server.HtmlEncode(dr["Detail"].ToString().Substring(0, 8) + "...");
                            }
                        }
                    }
                    catch (Exception ex)
                    {
                        throw new Exception(ex.Message + ":获取工作报告列表失败", ex);
                    }
                }
                DataView dv = dtExecuteNew.DefaultView;
                dv.Sort = "ExecuteDate desc";
                this.rpExecute.DataSource = dv;
                this.rpExecute.DataBind();
            }
            entityExecute.Dispose();
        }