private void LoadData()
        {
            try
            {
                if (!user.HasRight("030303"))                  //楼栋进度填写权限
                {
                    Response.Redirect("../RejectAccess.aspx?OperationCode=030303");
                    Response.End();
                }

                if ((this.txtBuildingCode.Value.Trim() == "") || (this.txtVisualProgressCode.Value.Trim() == ""))
                {
                    Response.Write(Rms.Web.JavaScript.Alert(true, "未传入楼栋代码或形象进度代码"));
                    Response.Write(Rms.Web.JavaScript.WinClose(true));
                    return;
                }

                //取楼栋
                EntityData entityBuilding = DAL.EntityDAO.ProductDAO.GetBuildingByCode(this.txtBuildingCode.Value);
                if (!entityBuilding.HasRecord())
                {
                    Response.Write(Rms.Web.JavaScript.Alert(true, "楼栋不存在"));
                    Response.Write(Rms.Web.JavaScript.WinClose(true));
                    return;
                }

                this.txtProjectCode.Value = entityBuilding.GetString("ProjectCode");
                this.lblBuildingName.Text = entityBuilding.GetString("BuildingName");

                entityBuilding.Dispose();

                //取形象进度
                this.lblVisualProgressName.Text = BLL.WBSRule.GetWBSName(this.txtVisualProgressCode.Value);

                //是否有工作项的修改权限
                if (!WBSRule.IsTaskModify(this.txtVisualProgressCode.Value, user.UserCode))
                {
                    Response.Redirect("../RejectAccess.aspx?OperationName=工作项[" + lblVisualProgressName.Text + "]修改");
                    Response.End();
                }

                //缺省值
                this.sltStatus.Value = "0";

                //缺省实际开始、结束日期为当天(便于状态改成“进行中”或“已完成”时有缺省日期,保存时若状态为“未开始”要自动清空)
                this.txtStartDate.Value = DateTime.Today.ToString("yyyy-MM-dd");
                this.txtEndDate.Value   = DateTime.Today.ToString("yyyy-MM-dd");
            }
            catch (Exception ex)
            {
                ApplicationLog.WriteLog(this.ToString(), ex, "");
                Response.Write(Rms.Web.JavaScript.Alert(true, "初始化页面出错:" + ex.Message));
            }
        }
        private void LoadData()
        {
            try
            {
                if (!user.HasRight("030303"))                  //楼栋进度填写权限
                {
                    Response.Redirect("../RejectAccess.aspx?OperationCode=030303");
                    Response.End();
                }

                if ((this.txtBuildingFloorCode.Value.Trim() == "") || (this.txtWBSCode.Value.Trim() == "") || (this.txtVisualProgressCode.Value.Trim() == ""))
                {
                    Response.Write(Rms.Web.JavaScript.Alert(true, "未传入楼层代码、工作代码或形象进度代码"));
                    return;
                }

                //取楼层
                EntityData entityFloor = DAL.EntityDAO.ProductDAO.GetBuildingFloorByCode(this.txtBuildingFloorCode.Value);
                entityFloor.Dispose();
                if (!entityFloor.HasRecord())
                {
                    Response.Write(Rms.Web.JavaScript.Alert(true, "楼层不存在"));
                    return;
                }

                this.txtBuildingCode.Value = entityFloor.GetString("BuildingCode");
                this.txtProjectCode.Value  = entityFloor.GetString("ProjectCode");
                this.lblFloorName.Text     = entityFloor.GetString("FloorName");
                this.lblBuildingName.Text  = BLL.ProductRule.GetBuildingName(this.txtBuildingCode.Value);

                //取工作
                this.lblVisualProgressName.Text = BLL.WBSRule.GetWBSName(this.txtVisualProgressCode.Value);
                this.lblTaskName.Text           = BLL.WBSRule.GetWBSName(this.txtWBSCode.Value);

                //是否有工作项的修改权限
                if (!WBSRule.IsTaskModify(this.txtVisualProgressCode.Value, user.UserCode))
                {
                    Response.Redirect("../RejectAccess.aspx?OperationName=工作项[" + lblVisualProgressName.Text + "]修改");
                    Response.End();
                }

                //取进度
                EntityData entity = DAL.EntityDAO.ProductDAO.GetBuildingFloorProgressByBuildingFloorWBSCode(this.txtBuildingFloorCode.Value, this.txtWBSCode.Value);
                entity.Dispose();
                if (entity.HasRecord())
                {
                    this.txtProgressCode.Value = entity.GetString("ProgressCode");

                    this.sltStatus.Value          = entity.GetInt("Status").ToString();
                    this.txtCompletePercent.Value = entity.GetInt("CompletePercent").ToString();

                    this.txtPStartDate.Value = entity.GetDateTimeOnlyDate("PStartDate");
                    this.txtPEndDate.Value   = entity.GetDateTimeOnlyDate("PEndDate");
                    this.txtStartDate.Value  = entity.GetDateTimeOnlyDate("StartDate");
                    this.txtEndDate.Value    = entity.GetDateTimeOnlyDate("EndDate");
                }
                else
                {
                    //新增时的缺省值
                    this.sltStatus.Value = "0";
                }

                //缺省实际开始、结束日期为当天(便于状态改成“进行中”或“已完成”时有缺省日期,保存时若状态为“未开始”要自动清空)
                if (this.txtStartDate.Value == "")
                {
                    this.txtStartDate.Value = DateTime.Today.ToString("yyyy-MM-dd");
                }
                if (this.txtEndDate.Value == "")
                {
                    this.txtEndDate.Value = DateTime.Today.ToString("yyyy-MM-dd");
                }
            }
            catch (Exception ex)
            {
                ApplicationLog.WriteLog(this.ToString(), ex, "");
                Response.Write(Rms.Web.JavaScript.Alert(true, "初始化页面出错:" + ex.Message));
            }
        }