Пример #1
0
        /// <summary>
        /// 加载页面
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                btnClose.OnClientClick = ActiveWindow.GetHideReference();

                this.CostManageId = Request.Params["CostManageId"];
                if (!string.IsNullOrEmpty(this.CostManageId))
                {
                    Model.CostGoods_CostManage costManage = BLL.CostManageService.GetCostManageById(this.CostManageId);
                    if (costManage != null)
                    {
                        this.txtCostManageCode.Text = CodeRecordsService.ReturnCodeByDataId(this.CostManageId);
                        this.txtCostManageName.Text = costManage.CostManageName;
                        if (!string.IsNullOrEmpty(costManage.UnitId))
                        {
                            var unit = BLL.UnitService.GetUnitByUnitId(costManage.UnitId);
                            if (unit != null)
                            {
                                this.txtUnitName.Text = unit.UnitName;
                            }
                        }
                        this.txtContractNum.Text = costManage.ContractNum;
                        if (costManage.CostManageDate != null)
                        {
                            this.txtCostManageDate.Text = string.Format("{0:yyyy-MM-dd}", costManage.CostManageDate);
                        }
                        this.txtOpinion.Text    = costManage.Opinion;
                        this.txtSubHSE.Text     = costManage.SubHSE;
                        this.txtSubCN.Text      = costManage.SubCN;
                        this.txtSubProject.Text = costManage.SubProject;
                    }
                    BindGrid();
                }
                ///初始化审核菜单
                this.ctlAuditFlow.MenuId = BLL.Const.ProjectCostManageMenuId;
                this.ctlAuditFlow.DataId = this.CostManageId;
            }
        }
Пример #2
0
 /// <summary>
 /// 加载页面
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         this.ProjectId = this.CurrUser.LoginProjectId;
         this.btnClose.OnClientClick = ActiveWindow.GetHideReference();
         this.hdProjectA1.Text       = "0";
         this.hdProjectA2.Text       = "0";
         this.hdProjectA3.Text       = "0";
         this.hdProjectA4.Text       = "0";
         this.hdProjectA5.Text       = "0";
         this.hdProjectA6.Text       = "0";
         this.hdProjectB1.Text       = "0";
         this.hdProjectB2.Text       = "0";
         this.hdProjectB3.Text       = "0";
         this.InitDropDownList();
         this.CostSmallDetailId = Request.Params["CostSmallDetailId"];
         if (!string.IsNullOrEmpty(this.CostSmallDetailId))
         {
             Model.CostGoods_CostSmallDetail costSmallDetail = BLL.CostSmallDetailService.GetCostSmallDetailById(this.CostSmallDetailId);
             if (costSmallDetail != null)
             {
                 this.ProjectId = costSmallDetail.ProjectId;
                 if (this.ProjectId != this.CurrUser.LoginProjectId)
                 {
                     this.InitDropDownList();
                 }
                 if (costSmallDetail.Months != null)
                 {
                     //this.txtMonths.Text = string.Format("{0:yyyy-MM}", costSmallDetail.Months);
                     this.drpYear.SelectedValue   = Convert.ToString(costSmallDetail.Months.Value.Year);
                     this.drpMonths.SelectedValue = Convert.ToString(costSmallDetail.Months.Value.Month);
                 }
                 this.txtCostSmallDetailCode.Text = CodeRecordsService.ReturnCodeByDataId(this.CostSmallDetailId);
                 if (!string.IsNullOrEmpty(costSmallDetail.UnitId))
                 {
                     this.drpUnitId.SelectedValue = costSmallDetail.UnitId;
                 }
                 if (costSmallDetail.ReportDate != null)
                 {
                     this.txtReportDate.Text = string.Format("{0:yyyy-MM-dd}", costSmallDetail.ReportDate);
                 }
                 //this.txtCompileMan.Text = costSmallDetail.CompileMan;
                 //if (costSmallDetail.CompileDate != null)
                 //{
                 //    this.txtCompileDate.Text = string.Format("{0:yyyy-MM-dd}", costSmallDetail.CompileDate);
                 //}
                 //this.txtCheckMan.Text = costSmallDetail.CheckMan;
                 //if (costSmallDetail.CheckDate != null)
                 //{
                 //    this.txtCheckDate.Text = string.Format("{0:yyyy-MM-dd}", costSmallDetail.CheckDate);
                 //}
                 //this.txtApproveMan.Text = costSmallDetail.ApproveMan;
                 //if (costSmallDetail.ApproveDate != null)
                 //{
                 //    this.txtApproveDate.Text = string.Format("{0:yyyy-MM-dd}", costSmallDetail.ApproveDate);
                 //}
                 decimal            totalA = 0, totalB = 0, totalProjectA = 0, totalProjectB = 0;
                 Model.Base_Project project = BLL.ProjectService.GetProjectByProjectId(this.ProjectId);
                 if (project != null && costSmallDetail.Months.HasValue)
                 {
                     List <Model.CostGoods_CostSmallDetailItem> projectDetails = BLL.CostSmallDetailItemService.GetCostDetailsByUnitId(this.CurrUser.LoginProjectId, costSmallDetail.UnitId, project != null ? project.StartDate : null, Convert.ToDateTime(costSmallDetail.Months));
                     List <Model.CostGoods_CostSmallDetailItem> details        = BLL.CostSmallDetailItemService.GetCostSmallDetailItemByCostSmallDetailId(this.CostSmallDetailId);
                     Model.CostGoods_CostSmallDetailItem        a1             = details.FirstOrDefault(x => x.CostType == "A1");
                     this.hdProjectA1.Text = (from x in projectDetails where x.CostType == "A1" select x.CostMoney ?? 0).Sum().ToString();
                     this.hdProjectA2.Text = (from x in projectDetails where x.CostType == "A2" select x.CostMoney ?? 0).Sum().ToString();
                     this.hdProjectA3.Text = (from x in projectDetails where x.CostType == "A3" select x.CostMoney ?? 0).Sum().ToString();
                     this.hdProjectA4.Text = (from x in projectDetails where x.CostType == "A4" select x.CostMoney ?? 0).Sum().ToString();
                     this.hdProjectA5.Text = (from x in projectDetails where x.CostType == "A5" select x.CostMoney ?? 0).Sum().ToString();
                     this.hdProjectA6.Text = (from x in projectDetails where x.CostType == "A6" select x.CostMoney ?? 0).Sum().ToString();
                     this.hdProjectB1.Text = (from x in projectDetails where x.CostType == "B1" select x.CostMoney ?? 0).Sum().ToString();
                     this.hdProjectB2.Text = (from x in projectDetails where x.CostType == "B2" select x.CostMoney ?? 0).Sum().ToString();
                     this.hdProjectB3.Text = (from x in projectDetails where x.CostType == "B3" select x.CostMoney ?? 0).Sum().ToString();
                     if (a1 != null)
                     {
                         this.nbA1.Text        = (a1.CostMoney ?? 0).ToString();
                         totalA               += Funs.GetNewDecimalOrZero(this.nbA1.Text);
                         this.nbProjectA1.Text = ((from x in projectDetails where x.CostType == "A1" select x.CostMoney ?? 0).Sum() + a1.CostMoney ?? 0).ToString();
                         totalProjectA        += Funs.GetNewDecimalOrZero(this.nbProjectA1.Text);
                         this.txtDefA1.Text    = a1.CostDef;
                     }
                     Model.CostGoods_CostSmallDetailItem a2 = details.FirstOrDefault(x => x.CostType == "A2");
                     if (a2 != null)
                     {
                         this.nbA2.Text        = (a2.CostMoney ?? 0).ToString();
                         totalA               += Funs.GetNewDecimalOrZero(this.nbA2.Text);
                         this.nbProjectA2.Text = ((from x in projectDetails where x.CostType == "A2" select x.CostMoney ?? 0).Sum() + a2.CostMoney ?? 0).ToString();
                         totalProjectA        += Funs.GetNewDecimalOrZero(this.nbProjectA2.Text);
                         this.txtDefA2.Text    = a2.CostDef;
                     }
                     Model.CostGoods_CostSmallDetailItem a3 = details.FirstOrDefault(x => x.CostType == "A3");
                     if (a3 != null)
                     {
                         this.nbA3.Text        = (a3.CostMoney ?? 0).ToString();
                         totalA               += Funs.GetNewDecimalOrZero(this.nbA3.Text);
                         this.nbProjectA3.Text = ((from x in projectDetails where x.CostType == "A3" select x.CostMoney ?? 0).Sum() + a3.CostMoney ?? 0).ToString();
                         totalProjectA        += Funs.GetNewDecimalOrZero(this.nbProjectA3.Text);
                         this.txtDefA3.Text    = a3.CostDef;
                     }
                     Model.CostGoods_CostSmallDetailItem a4 = details.FirstOrDefault(x => x.CostType == "A4");
                     if (a4 != null)
                     {
                         this.nbA4.Text        = (a4.CostMoney ?? 0).ToString();
                         totalA               += Funs.GetNewDecimalOrZero(this.nbA4.Text);
                         this.nbProjectA4.Text = ((from x in projectDetails where x.CostType == "A4" select x.CostMoney ?? 0).Sum() + a4.CostMoney ?? 0).ToString();
                         totalProjectA        += Funs.GetNewDecimalOrZero(this.nbProjectA4.Text);
                         this.txtDefA4.Text    = a4.CostDef;
                     }
                     Model.CostGoods_CostSmallDetailItem a5 = details.FirstOrDefault(x => x.CostType == "A5");
                     if (a5 != null)
                     {
                         this.nbA5.Text        = (a5.CostMoney ?? 0).ToString();
                         totalA               += Funs.GetNewDecimalOrZero(this.nbA5.Text);
                         this.nbProjectA5.Text = ((from x in projectDetails where x.CostType == "A5" select x.CostMoney ?? 0).Sum() + a5.CostMoney ?? 0).ToString();
                         totalProjectA        += Funs.GetNewDecimalOrZero(this.nbProjectA5.Text);
                         this.txtDefA5.Text    = a5.CostDef;
                     }
                     Model.CostGoods_CostSmallDetailItem a6 = details.FirstOrDefault(x => x.CostType == "A6");
                     if (a6 != null)
                     {
                         this.nbA6.Text        = (a6.CostMoney ?? 0).ToString();
                         totalA               += Funs.GetNewDecimalOrZero(this.nbA6.Text);
                         this.nbProjectA6.Text = ((from x in projectDetails where x.CostType == "A6" select x.CostMoney ?? 0).Sum() + a6.CostMoney ?? 0).ToString();
                         totalProjectA        += Funs.GetNewDecimalOrZero(this.nbProjectA6.Text);
                         this.txtDefA6.Text    = a6.CostDef;
                     }
                     this.nbA.Text        = totalA.ToString();
                     this.nbProjectA.Text = totalProjectA.ToString();
                     Model.CostGoods_CostSmallDetailItem b1 = details.FirstOrDefault(x => x.CostType == "B1");
                     if (b1 != null)
                     {
                         this.nbB1.Text        = (b1.CostMoney ?? 0).ToString();
                         totalB               += Funs.GetNewDecimalOrZero(this.nbB1.Text);
                         this.nbProjectB1.Text = ((from x in projectDetails where x.CostType == "B1" select x.CostMoney ?? 0).Sum() + b1.CostMoney ?? 0).ToString();
                         totalProjectB        += Funs.GetNewDecimalOrZero(this.nbProjectB1.Text);
                         this.txtDefB1.Text    = b1.CostDef;
                     }
                     Model.CostGoods_CostSmallDetailItem b2 = details.FirstOrDefault(x => x.CostType == "B2");
                     if (b2 != null)
                     {
                         this.nbB2.Text        = (b2.CostMoney ?? 0).ToString();
                         totalB               += Funs.GetNewDecimalOrZero(this.nbB2.Text);
                         this.nbProjectB2.Text = ((from x in projectDetails where x.CostType == "B2" select x.CostMoney ?? 0).Sum() + b2.CostMoney ?? 0).ToString();
                         totalProjectB        += Funs.GetNewDecimalOrZero(this.nbProjectB2.Text);
                         this.txtDefB2.Text    = b2.CostDef;
                     }
                     Model.CostGoods_CostSmallDetailItem b3 = details.FirstOrDefault(x => x.CostType == "B3");
                     if (b3 != null)
                     {
                         this.nbB3.Text        = (b3.CostMoney ?? 0).ToString();
                         totalB               += Funs.GetNewDecimalOrZero(this.nbB3.Text);
                         this.nbProjectB3.Text = ((from x in projectDetails where x.CostType == "B3" select x.CostMoney ?? 0).Sum() + b3.CostMoney ?? 0).ToString();
                         totalProjectB        += Funs.GetNewDecimalOrZero(this.nbProjectB3.Text);
                         this.txtDefB3.Text    = b3.CostDef;
                     }
                     this.nbB.Text         = totalB.ToString();
                     this.nbProjectB.Text  = totalProjectB.ToString();
                     this.nbAB.Text        = (totalA + totalB).ToString();
                     this.nbProjectAB.Text = (totalProjectA + totalProjectB).ToString();
                 }
             }
         }
         else
         {
             this.drpYear.SelectedValue   = Convert.ToString(DateTime.Now.Year);
             this.drpMonths.SelectedValue = Convert.ToString(DateTime.Now.Month);
             //this.txtMonths.Text = DateTime.Now.ToString("yyyy-MM");
             //this.txtCompileMan.Text = this.CurrUser.UserName;
             this.txtReportDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now);
             //this.txtCompileDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now);
             this.txtCostSmallDetailCode.Text = CodeRecordsService.ReturnCodeByMenuIdProjectId(BLL.Const.ProjectCostSmallDetailMenuId, this.ProjectId, this.CurrUser.UnitId);
         }
         ///初始化审核菜单
         this.ctlAuditFlow.MenuId    = BLL.Const.ProjectCostSmallDetailMenuId;
         this.ctlAuditFlow.DataId    = this.CostSmallDetailId;
         this.ctlAuditFlow.ProjectId = this.ProjectId;
         this.ctlAuditFlow.UnitId    = this.CurrUser.UnitId;
     }
 }
Пример #3
0
        /// <summary>
        /// 加载页面
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                this.btnClose.OnClientClick = ActiveWindow.GetHideReference();
                this.IncentiveNoticeId      = Request.Params["IncentiveNoticeId"];
                this.txtCurrency.Text       = "人民币";
                if (!string.IsNullOrEmpty(this.IncentiveNoticeId))
                {
                    Model.Check_IncentiveNotice incentiveNotice = BLL.IncentiveNoticeService.GetIncentiveNoticeById(this.IncentiveNoticeId);
                    if (incentiveNotice != null)
                    {
                        this.txtIncentiveNoticeCode.Text = CodeRecordsService.ReturnCodeByDataId(this.IncentiveNoticeId);
                        if (!string.IsNullOrEmpty(incentiveNotice.UnitId))
                        {
                            var unit = UnitService.GetUnitByUnitId(incentiveNotice.UnitId);
                            if (unit != null)
                            {
                                this.txtUnitName.Text = unit.UnitName;
                            }
                        }
                        if (!string.IsNullOrEmpty(incentiveNotice.TeamGroupId))
                        {
                            var teamGroup = TeamGroupService.GetTeamGroupById(incentiveNotice.TeamGroupId);
                            if (teamGroup != null)
                            {
                                this.txtTeamGroup.Text = teamGroup.TeamGroupName;
                            }
                        }
                        if (!string.IsNullOrEmpty(incentiveNotice.PersonId))
                        {
                            var person = BLL.PersonService.GetPersonById(incentiveNotice.PersonId);
                            if (person != null)
                            {
                                this.txtPerson.Text = person.PersonName;
                            }
                        }

                        if (incentiveNotice.IncentiveDate != null)
                        {
                            this.txtIncentiveDate.Text = string.Format("{0:yyyy-MM-dd}", incentiveNotice.IncentiveDate);
                        }
                        this.txtBasicItem.Text = incentiveNotice.BasicItem;
                        if (!string.IsNullOrEmpty(incentiveNotice.RewardType))
                        {
                            Model.Sys_Const c = BLL.ConstValue.drpConstItemList(BLL.ConstValue.Group_RewardType).FirstOrDefault(x => x.ConstValue == incentiveNotice.RewardType);
                            if (c != null)
                            {
                                this.txtRewardType.Text = c.ConstText;
                            }
                        }
                        if (incentiveNotice.IncentiveMoney != null)
                        {
                            this.txtPayMoney.Text          = Convert.ToString(incentiveNotice.IncentiveMoney);
                            this.rbtnIncentiveWay1.Checked = true;
                            this.txtBig.Text = Funs.NumericCapitalization(Funs.GetNewDecimalOrZero(txtPayMoney.Text));//转换大写
                        }
                        if (!string.IsNullOrEmpty(incentiveNotice.TitleReward))
                        {
                            this.txtTitleReward.Text       = incentiveNotice.TitleReward;
                            this.rbtnIncentiveWay2.Checked = true;
                        }
                        if (!string.IsNullOrEmpty(incentiveNotice.MattleReward))
                        {
                            this.txtMattleReward.Text      = incentiveNotice.MattleReward;
                            this.rbtnIncentiveWay3.Checked = true;
                        }
                        this.AttachUrl            = incentiveNotice.AttachUrl;
                        this.divFile.InnerHtml    = BLL.UploadAttachmentService.ShowAttachment("../", this.AttachUrl);
                        this.txtFileContents.Text = HttpUtility.HtmlDecode(incentiveNotice.FileContents);
                        if (!string.IsNullOrEmpty(incentiveNotice.Currency))
                        {
                            this.txtCurrency.Text = incentiveNotice.Currency;
                        }
                    }
                }
                ///初始化审核菜单
                this.ctlAuditFlow.MenuId = BLL.Const.ProjectIncentiveNoticeMenuId;
                this.ctlAuditFlow.DataId = this.IncentiveNoticeId;
            }
        }
Пример #4
0
        /// <summary>
        /// 加载页面
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                this.btnClose.OnClientClick = ActiveWindow.GetHideReference();

                this.ExpenseId = Request.Params["ExpenseId"];
                if (!string.IsNullOrEmpty(this.ExpenseId))
                {
                    Model.CostGoods_Expense expense = BLL.ExpenseService.GetExpenseById(this.ExpenseId);
                    if (expense != null)
                    {
                        this.txtExpenseCode.Text = CodeRecordsService.ReturnCodeByDataId(this.ExpenseId);
                        if (expense.Months != null)
                        {
                            this.txtMonths.Text = string.Format("{0:yyyy-MM}", expense.Months);
                        }
                        if (!string.IsNullOrEmpty(expense.UnitId))
                        {
                            Model.Base_Unit unit = BLL.UnitService.GetUnitByUnitId(expense.UnitId);
                            if (unit != null)
                            {
                                this.drpUnitId.Text = unit.UnitName;
                            }
                        }
                        if (expense.ReportDate != null)
                        {
                            this.txtReportDate.Text = string.Format("{0:yyyy-MM-dd}", expense.ReportDate);
                        }
                        //this.txtCompileMan.Text = expense.CompileMan;
                        //if (expense.CompileDate != null)
                        //{
                        //    this.txtCompileDate.Text = string.Format("{0:yyyy-MM-dd}", expense.CompileDate);
                        //}
                        //this.txtCheckMan.Text = expense.CheckMan;
                        //if (expense.CheckDate != null)
                        //{
                        //    this.txtCheckDate.Text = string.Format("{0:yyyy-MM-dd}", expense.CheckDate);
                        //}
                        //this.txtApproveMan.Text = expense.ApproveMan;
                        //if (expense.ApproveDate != null)
                        //{
                        //    this.txtApproveDate.Text = string.Format("{0:yyyy-MM-dd}", expense.ApproveDate);
                        //}
                        decimal            totalA = 0, totalB = 0, totalProjectA = 0, totalProjectB = 0;
                        Model.Base_Project project = BLL.ProjectService.GetProjectByProjectId(expense.ProjectId);
                        List <Model.CostGoods_ExpenseDetail> projectDetails = BLL.ExpenseDetailService.GetCostDetailsByUnitId(expense.UnitId, project != null ? Convert.ToDateTime(project.StartDate) : Convert.ToDateTime("2000-01-01"), Convert.ToDateTime(expense.Months));
                        List <Model.CostGoods_ExpenseDetail> details        = BLL.ExpenseDetailService.GetExpenseDetailsByExpenseId(this.ExpenseId);
                        Model.CostGoods_ExpenseDetail        a1             = details.FirstOrDefault(x => x.CostType == "A1");
                        if (a1 != null)
                        {
                            this.nbA1.Text        = (a1.CostMoney ?? 0).ToString();
                            totalA               += Funs.GetNewDecimalOrZero(this.nbA1.Text);
                            this.nbProjectA1.Text = ((from x in projectDetails where x.CostType == "A1" select x.CostMoney ?? 0).Sum() + a1.CostMoney ?? 0).ToString();
                            totalProjectA        += Funs.GetNewDecimalOrZero(this.nbProjectA1.Text);
                            this.txtDefA1.Text    = a1.CostDef;
                        }
                        Model.CostGoods_ExpenseDetail a2 = details.FirstOrDefault(x => x.CostType == "A2");
                        if (a2 != null)
                        {
                            this.nbA2.Text        = (a2.CostMoney ?? 0).ToString();
                            totalA               += Funs.GetNewDecimalOrZero(this.nbA2.Text);
                            this.nbProjectA2.Text = ((from x in projectDetails where x.CostType == "A2" select x.CostMoney ?? 0).Sum() + a2.CostMoney ?? 0).ToString();
                            totalProjectA        += Funs.GetNewDecimalOrZero(this.nbProjectA2.Text);
                            this.txtDefA2.Text    = a2.CostDef;
                        }
                        Model.CostGoods_ExpenseDetail a3 = details.FirstOrDefault(x => x.CostType == "A3");
                        if (a3 != null)
                        {
                            this.nbA3.Text        = (a3.CostMoney ?? 0).ToString();
                            totalA               += Funs.GetNewDecimalOrZero(this.nbA3.Text);
                            this.nbProjectA3.Text = ((from x in projectDetails where x.CostType == "A3" select x.CostMoney ?? 0).Sum() + a3.CostMoney ?? 0).ToString();
                            totalProjectA        += Funs.GetNewDecimalOrZero(this.nbProjectA3.Text);
                            this.txtDefA3.Text    = a3.CostDef;
                        }
                        Model.CostGoods_ExpenseDetail a4 = details.FirstOrDefault(x => x.CostType == "A4");
                        if (a4 != null)
                        {
                            this.nbA4.Text        = (a4.CostMoney ?? 0).ToString();
                            totalA               += Funs.GetNewDecimalOrZero(this.nbA4.Text);
                            this.nbProjectA4.Text = ((from x in projectDetails where x.CostType == "A4" select x.CostMoney ?? 0).Sum() + a4.CostMoney ?? 0).ToString();
                            totalProjectA        += Funs.GetNewDecimalOrZero(this.nbProjectA4.Text);
                            this.txtDefA4.Text    = a4.CostDef;
                        }
                        Model.CostGoods_ExpenseDetail a5 = details.FirstOrDefault(x => x.CostType == "A5");
                        if (a5 != null)
                        {
                            this.nbA5.Text        = (a5.CostMoney ?? 0).ToString();
                            totalA               += Funs.GetNewDecimalOrZero(this.nbA5.Text);
                            this.nbProjectA5.Text = ((from x in projectDetails where x.CostType == "A5" select x.CostMoney ?? 0).Sum() + a5.CostMoney ?? 0).ToString();
                            totalProjectA        += Funs.GetNewDecimalOrZero(this.nbProjectA5.Text);
                            this.txtDefA5.Text    = a5.CostDef;
                        }
                        Model.CostGoods_ExpenseDetail a6 = details.FirstOrDefault(x => x.CostType == "A6");
                        if (a6 != null)
                        {
                            this.nbA6.Text        = (a6.CostMoney ?? 0).ToString();
                            totalA               += Funs.GetNewDecimalOrZero(this.nbA6.Text);
                            this.nbProjectA6.Text = ((from x in projectDetails where x.CostType == "A6" select x.CostMoney ?? 0).Sum() + a6.CostMoney ?? 0).ToString();
                            totalProjectA        += Funs.GetNewDecimalOrZero(this.nbProjectA6.Text);
                            this.txtDefA6.Text    = a6.CostDef;
                        }
                        this.nbA.Text        = totalA.ToString();
                        this.nbProjectA.Text = totalProjectA.ToString();
                        Model.CostGoods_ExpenseDetail b1 = details.FirstOrDefault(x => x.CostType == "B1");
                        if (b1 != null)
                        {
                            this.nbB1.Text        = (b1.CostMoney ?? 0).ToString();
                            totalB               += Funs.GetNewDecimalOrZero(this.nbB1.Text);
                            this.nbProjectB1.Text = ((from x in projectDetails where x.CostType == "B1" select x.CostMoney ?? 0).Sum() + b1.CostMoney ?? 0).ToString();
                            totalProjectB        += Funs.GetNewDecimalOrZero(this.nbProjectB1.Text);
                            this.txtDefB1.Text    = b1.CostDef;
                        }
                        Model.CostGoods_ExpenseDetail b2 = details.FirstOrDefault(x => x.CostType == "B2");
                        if (b2 != null)
                        {
                            this.nbB2.Text        = (b2.CostMoney ?? 0).ToString();
                            totalB               += Funs.GetNewDecimalOrZero(this.nbB2.Text);
                            this.nbProjectB2.Text = ((from x in projectDetails where x.CostType == "B2" select x.CostMoney ?? 0).Sum() + b2.CostMoney ?? 0).ToString();
                            totalProjectB        += Funs.GetNewDecimalOrZero(this.nbProjectB2.Text);
                            this.txtDefB2.Text    = b2.CostDef;
                        }
                        Model.CostGoods_ExpenseDetail b3 = details.FirstOrDefault(x => x.CostType == "B3");
                        if (b3 != null)
                        {
                            this.nbB3.Text        = (b3.CostMoney ?? 0).ToString();
                            totalB               += Funs.GetNewDecimalOrZero(this.nbB3.Text);
                            this.nbProjectB3.Text = ((from x in projectDetails where x.CostType == "B3" select x.CostMoney ?? 0).Sum() + b3.CostMoney ?? 0).ToString();
                            totalProjectB        += Funs.GetNewDecimalOrZero(this.nbProjectB3.Text);
                            this.txtDefB3.Text    = b3.CostDef;
                        }
                        this.nbB.Text         = totalB.ToString();
                        this.nbProjectB.Text  = totalProjectB.ToString();
                        this.nbAB.Text        = (totalA + totalB).ToString();
                        this.nbProjectAB.Text = (totalProjectA + totalProjectB).ToString();
                    }
                }
                ///初始化审核菜单
                this.ctlAuditFlow.MenuId = BLL.Const.ProjectExpenseMenuId;
                this.ctlAuditFlow.DataId = this.ExpenseId;
            }
        }
Пример #5
0
        ///// <summary>
        ///// 附件
        ///// </summary>
        //private string AttchUrl
        //{
        //    get
        //    {
        //        return (string)ViewState["AttchUrl"];
        //    }
        //    set
        //    {
        //        ViewState["AttchUrl"] = value;
        //    }
        //}
        #endregion

        #region 加载
        /// <summary>
        /// 加载页面
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                this.ProjectId = this.CurrUser.LoginProjectId;
                this.btnClose.OnClientClick = ActiveWindow.GetHideReference();

                this.InitDropDownList();
                this.PunishNoticeId   = Request.Params["PunishNoticeId"];
                this.txtCurrency.Text = "人民币";
                if (!string.IsNullOrEmpty(this.PunishNoticeId))
                {
                    Model.Check_PunishNotice punishNotice = BLL.PunishNoticeService.GetPunishNoticeById(this.PunishNoticeId);
                    if (punishNotice != null)
                    {
                        this.ProjectId = punishNotice.ProjectId;
                        if (this.ProjectId != this.CurrUser.LoginProjectId)
                        {
                            this.InitDropDownList();
                        }
                        this.txtPunishNoticeCode.Text = CodeRecordsService.ReturnCodeByDataId(this.PunishNoticeId);
                        this.txtPunishNoticeDate.Text = string.Format("{0:yyyy-MM-dd}", punishNotice.PunishNoticeDate);
                        if (!string.IsNullOrEmpty(punishNotice.UnitId))
                        {
                            this.drpUnitId.SelectedValue = punishNotice.UnitId;
                        }
                        this.txtIncentiveReason.Text = punishNotice.IncentiveReason;
                        this.txtBasicItem.Text       = punishNotice.BasicItem;
                        if (punishNotice.PunishMoney.HasValue)
                        {
                            this.txtPunishMoney.Text = Convert.ToString(punishNotice.PunishMoney);
                            this.txtBig.Text         = Funs.NumericCapitalization(Funs.GetNewDecimalOrZero(txtPunishMoney.Text));
                        }
                        //this.AttchUrl = punishNotice.AttachUrl;
                        //this.divFile.InnerHtml = BLL.UploadAttachmentService.ShowAttachment("../", this.AttchUrl);
                        this.txtFileContents.Text = HttpUtility.HtmlDecode(punishNotice.FileContents);
                        if (!string.IsNullOrEmpty(punishNotice.SignMan))
                        {
                            this.drpSignMan.SelectedValue = punishNotice.SignMan;
                        }
                        if (!string.IsNullOrEmpty(punishNotice.ApproveMan))
                        {
                            this.drpApproveMan.SelectedValue = punishNotice.ApproveMan;
                        }
                        this.txtContractNum.Text = punishNotice.ContractNum;
                        if (!string.IsNullOrEmpty(punishNotice.Currency))
                        {
                            this.txtCurrency.Text = punishNotice.Currency;
                        }

                        this.drpPunishName.SelectedValue = punishNotice.PunishName;
                    }
                }
                else
                {
                    this.drpSignMan.SelectedValue = this.CurrUser.UserId;
                    this.txtPunishNoticeDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now);
                    var codeTemplateRule = BLL.ProjectData_CodeTemplateRuleService.GetProjectData_CodeTemplateRuleByMenuIdProjectId(BLL.Const.ProjectPunishNoticeMenuId, this.ProjectId);
                    if (codeTemplateRule != null)
                    {
                        this.txtFileContents.Text = HttpUtility.HtmlDecode(codeTemplateRule.Template);
                    }
                    ////自动生成编码
                    this.txtPunishNoticeCode.Text = BLL.CodeRecordsService.ReturnCodeByMenuIdProjectId(BLL.Const.ProjectPunishNoticeMenuId, this.ProjectId, this.CurrUser.UnitId);
                }
                ///初始化审核菜单
                this.ctlAuditFlow.MenuId    = BLL.Const.ProjectPunishNoticeMenuId;
                this.ctlAuditFlow.DataId    = this.PunishNoticeId;
                this.ctlAuditFlow.ProjectId = this.ProjectId;
                this.ctlAuditFlow.UnitId    = this.CurrUser.UnitId;
            }
        }
Пример #6
0
        /// <summary>
        /// 加载页面
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                this.ProjectId = this.CurrUser.LoginProjectId;
                this.btnClose.OnClientClick = ActiveWindow.GetHideReference();
                this.BindGrid(string.Empty);

                this.InitDropDownList();
                this.ViolationPersonId = Request.Params["ViolationPersonId"];
                if (!string.IsNullOrEmpty(this.ViolationPersonId))
                {
                    Model.Check_ViolationPerson violationPerson = BLL.ViolationPersonService.GetViolationPersonById(this.ViolationPersonId);
                    if (violationPerson != null)
                    {
                        this.ProjectId = violationPerson.ProjectId;
                        if (violationPerson != null)
                        {
                            this.txtViolationPersonCode.Text = CodeRecordsService.ReturnCodeByDataId(this.ViolationPersonId);
                        }
                        if (!string.IsNullOrEmpty(violationPerson.PersonId))
                        {
                            BindGrid(violationPerson.PersonId);
                            this.drpPersonId.Value = violationPerson.PersonId;
                        }
                        if (!string.IsNullOrEmpty(violationPerson.UnitId))
                        {
                            this.hdUnitId.Text = violationPerson.UnitId;
                            if (!string.IsNullOrEmpty(this.hdUnitId.Text))
                            {
                                var unit = BLL.UnitService.GetUnitByUnitId(this.hdUnitId.Text.Trim());
                                if (unit != null)
                                {
                                    this.txtUnitName.Text = unit.UnitName;
                                }
                            }
                        }
                        if (!string.IsNullOrEmpty(violationPerson.WorkPostId))
                        {
                            this.hdWorkPostId.Text = violationPerson.WorkPostId;
                            if (!string.IsNullOrEmpty(this.hdWorkPostId.Text))
                            {
                                var workPost = BLL.WorkPostService.GetWorkPostById(this.hdWorkPostId.Text);
                                if (workPost != null)
                                {
                                    this.txtWorkPostName.Text = workPost.WorkPostName;
                                }
                            }
                        }
                        if (violationPerson.ViolationDate != null)
                        {
                            this.txtViolationDate.Text = string.Format("{0:yyyy-MM-dd}", violationPerson.ViolationDate);
                        }
                        if (!string.IsNullOrEmpty(violationPerson.ViolationName))
                        {
                            this.drpViolationName.SelectedValue = violationPerson.ViolationName;
                            if (violationPerson.ViolationName == "1")
                            {
                                BLL.ConstValue.InitConstValueDropDownList(this.drpViolationType, ConstValue.Group_ViolationType, true);
                            }
                            else if (violationPerson.ViolationName == "2")
                            {
                                BLL.ConstValue.InitConstValueDropDownList(this.drpViolationType, ConstValue.Group_ViolationTypeOther, true);
                            }
                        }
                        if (!string.IsNullOrEmpty(violationPerson.ViolationType))
                        {
                            this.drpViolationType.SelectedValue = violationPerson.ViolationType.Trim();
                        }
                        if (!string.IsNullOrEmpty(violationPerson.HandleStep))
                        {
                            this.drpHandleStep.SelectedValue = violationPerson.HandleStep;
                        }
                        this.txtViolationDef.Text = violationPerson.ViolationDef;
                    }
                }
                else
                {
                    this.txtViolationDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now);
                    ////自动生成编码
                    this.txtViolationPersonCode.Text = BLL.CodeRecordsService.ReturnCodeByMenuIdProjectId(BLL.Const.ProjectViolationPersonMenuId, this.ProjectId, this.CurrUser.UnitId);
                }
                ///初始化审核菜单
                this.ctlAuditFlow.MenuId    = BLL.Const.ProjectViolationPersonMenuId;
                this.ctlAuditFlow.DataId    = this.ViolationPersonId;
                this.ctlAuditFlow.ProjectId = this.ProjectId;
                this.ctlAuditFlow.UnitId    = this.CurrUser.UnitId;
            }
        }
Пример #7
0
        /// <summary>
        /// 加载页面
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                this.btnClose.OnClientClick = ActiveWindow.GetHideReference();

                this.ViolationPersonId = Request.Params["ViolationPersonId"];
                if (!string.IsNullOrEmpty(this.ViolationPersonId))
                {
                    Model.Check_ViolationPerson violationPerson = BLL.ViolationPersonService.GetViolationPersonById(this.ViolationPersonId);
                    if (violationPerson != null)
                    {
                        this.txtViolationPersonCode.Text = CodeRecordsService.ReturnCodeByDataId(this.ViolationPersonId);
                    }
                    if (!string.IsNullOrEmpty(violationPerson.PersonId))
                    {
                        var person = BLL.PersonService.GetPersonById(violationPerson.PersonId);
                        if (person != null)
                        {
                            this.txtPersonName.Text = person.PersonName;
                            var workPost = BLL.WorkPostService.GetWorkPostById(person.WorkPostId);
                            if (workPost != null)
                            {
                                this.txtWorkPostName.Text = workPost.WorkPostName;
                            }
                        }
                    }
                    if (!string.IsNullOrEmpty(violationPerson.UnitId))
                    {
                        var unit = BLL.UnitService.GetUnitByUnitId(violationPerson.UnitId);
                        if (unit != null)
                        {
                            this.txtUnitName.Text = unit.UnitName;
                        }
                    }
                    if (violationPerson.ViolationDate != null)
                    {
                        this.txtViolationDate.Text = string.Format("{0:yyyy-MM-dd}", violationPerson.ViolationDate);
                    }
                    if (!string.IsNullOrEmpty(violationPerson.ViolationName))
                    {
                        var c = BLL.ConstValue.GetConstByConstValueAndGroupId(violationPerson.ViolationName, BLL.ConstValue.Group_ViolationName);
                        if (c != null)
                        {
                            this.txtViolationName.Text = c.ConstText;
                        }
                    }
                    if (!string.IsNullOrEmpty(violationPerson.ViolationType))
                    {
                        var v  = BLL.ConstValue.GetConstByConstValueAndGroupId(violationPerson.ViolationType, BLL.ConstValue.Group_ViolationType);
                        var v2 = BLL.ConstValue.GetConstByConstValueAndGroupId(violationPerson.ViolationType, BLL.ConstValue.Group_ViolationTypeOther);
                        if (v != null)
                        {
                            this.txtViolationType.Text = v.ConstText;
                        }
                        if (v2 != null)
                        {
                            this.txtViolationType.Text = v2.ConstText;
                        }
                    }
                    if (!string.IsNullOrEmpty(violationPerson.HandleStep))
                    {
                        var v = BLL.ConstValue.GetConstByConstValueAndGroupId(violationPerson.HandleStep, BLL.ConstValue.Group_ViolationPersonHandleStep);
                        if (v != null)
                        {
                            this.txtHandleStep.Text = v.ConstText;
                        }
                    }
                    this.txtViolationDef.Text = violationPerson.ViolationDef;
                }
                ///初始化审核菜单
                this.ctlAuditFlow.MenuId = BLL.Const.ProjectViolationPersonMenuId;
                this.ctlAuditFlow.DataId = this.ViolationPersonId;
            }
        }
Пример #8
0
 /// <summary>
 /// 加载页面
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         this.ProjectId = this.CurrUser.LoginProjectId;
         this.btnClose.OnClientClick = ActiveWindow.GetHideReference();
         this.InitDropDownList();
         this.CostManageId = Request.Params["CostManageId"];
         this.drpInvestCostProject.DataTextField  = "Text";
         this.drpInvestCostProject.DataValueField = "Value";
         this.drpInvestCostProject.DataSource     = BLL.CostManageItemService.GetInvestCostProjectList();
         this.drpInvestCostProject.DataBind();
         if (!BLL.CommonService.IsMainUnitOrAdmin(this.CurrUser.UserId))   //分包单位用户,隐藏审核列
         {
             this.Grid1.Columns[7].Hidden = true;
             this.Grid1.Columns[8].Hidden = true;
             this.Grid1.Columns[9].Hidden = true;
         }
         this.txtCostManageDate.Text = string.Format("{0:yyyy-MM-dd}", System.DateTime.Now);
         if (!string.IsNullOrEmpty(this.CostManageId))
         {
             Model.CostGoods_CostManage costManage = BLL.CostManageService.GetCostManageById(this.CostManageId);
             if (costManage != null)
             {
                 this.ProjectId = costManage.ProjectId;
                 if (this.ProjectId != this.CurrUser.LoginProjectId)
                 {
                     this.InitDropDownList();
                 }
                 this.txtCostManageCode.Text = CodeRecordsService.ReturnCodeByDataId(this.CostManageId);
                 this.txtCostManageName.Text = costManage.CostManageName;
                 if (!string.IsNullOrEmpty(costManage.UnitId))
                 {
                     this.drpUnitId.SelectedValue = costManage.UnitId;
                 }
                 this.txtContractNum.Text    = costManage.ContractNum;
                 this.txtCostManageDate.Text = string.Format("{0:yyyy-MM-dd}", costManage.CostManageDate);
                 this.txtOpinion.Text        = costManage.Opinion;
                 this.txtSubHSE.Text         = costManage.SubHSE;
                 this.txtSubCN.Text          = costManage.SubCN;
                 this.txtSubProject.Text     = costManage.SubProject;
             }
             BindGrid();
         }
         else
         {
             this.txtCostManageCode.Text = CodeRecordsService.ReturnCodeByMenuIdProjectId(Const.ProjectCostManageMenuId, this.ProjectId, this.CurrUser.UserId);
             this.txtCostManageName.Text = "分包商HSE措施费申请表";
         }
         ///初始化审核菜单
         this.ctlAuditFlow.MenuId    = BLL.Const.ProjectCostManageMenuId;
         this.ctlAuditFlow.DataId    = this.CostManageId;
         this.ctlAuditFlow.ProjectId = this.ProjectId;
         this.ctlAuditFlow.UnitId    = this.CurrUser.UnitId;
     }
     else
     {
         if (GetRequestEventArgument() == "UPDATE_SUMMARY")
         {
             jerqueSaveMonthPlanList();
             this.Grid1.DataSource = costManageItems;
             this.Grid1.DataBind();
             // 页面要求重新计算合计行的值
             OutputSummaryData();
         }
     }
 }
Пример #9
0
        /// <summary>
        /// 加载页面
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                this.ProjectId = this.CurrUser.LoginProjectId;
                this.btnClose.OnClientClick = ActiveWindow.GetHideReference();
                BLL.UserService.InitUserDropDownList(this.drpSignMan, this.CurrUser.LoginProjectId, true);

                BLL.UnitService.InitUnitDropDownList(this.drpUnit, this.ProjectId, true);
                Funs.FineUIPleaseSelect(this.drpTeamGroup);
                Funs.FineUIPleaseSelect(this.drpPerson);
                BLL.UserService.InitUserDropDownList(this.drpApproveMan, this.CurrUser.LoginProjectId, true);
                BLL.ConstValue.InitConstValueDropDownList(this.drpRewardType, BLL.ConstValue.Group_RewardType, true);
                BindGrid(string.Empty);
                this.IncentiveNoticeId = Request.Params["IncentiveNoticeId"];
                this.txtCurrency.Text  = "人民币";
                if (!string.IsNullOrEmpty(this.IncentiveNoticeId))
                {
                    Model.Check_IncentiveNotice incentiveNotice = BLL.IncentiveNoticeService.GetIncentiveNoticeById(this.IncentiveNoticeId);
                    if (incentiveNotice != null)
                    {
                        this.ProjectId = incentiveNotice.ProjectId;
                        this.txtIncentiveNoticeCode.Text = CodeRecordsService.ReturnCodeByDataId(this.IncentiveNoticeId);
                        if (!string.IsNullOrEmpty(incentiveNotice.UnitId))
                        {
                            this.drpUnit.SelectedValue = incentiveNotice.UnitId;
                            BLL.TeamGroupService.InitTeamGroupProjectUnitDropDownList(this.drpTeamGroup, this.ProjectId, incentiveNotice.UnitId, true);
                            if (!string.IsNullOrEmpty(incentiveNotice.TeamGroupId))
                            {
                                this.drpTeamGroup.SelectedValue = incentiveNotice.TeamGroupId;
                            }

                            BLL.PersonService.InitPersonByProjectUnitDropDownList(this.drpPerson, this.ProjectId, incentiveNotice.UnitId, true);
                            if (!string.IsNullOrEmpty(incentiveNotice.PersonId))
                            {
                                this.drpPerson.SelectedValue = incentiveNotice.PersonId;
                            }
                        }
                        this.txtIncentiveDate.Text = string.Format("{0:yyyy-MM-dd}", incentiveNotice.IncentiveDate);
                        this.txtBasicItem.Text     = incentiveNotice.BasicItem;
                        if (!string.IsNullOrEmpty(incentiveNotice.RewardType))
                        {
                            this.drpRewardType.SelectedValue = incentiveNotice.RewardType;
                        }
                        if (incentiveNotice.IncentiveMoney.HasValue)
                        {
                            this.txtPayMoney.Text          = Convert.ToString(incentiveNotice.IncentiveMoney);
                            this.rbtnIncentiveWay1.Checked = true;
                            this.txtBig.Text = Funs.NumericCapitalization(Funs.GetNewDecimalOrZero(this.txtPayMoney.Text));//转换大写
                        }
                        if (!string.IsNullOrEmpty(incentiveNotice.TitleReward))
                        {
                            this.txtTitleReward.Text       = incentiveNotice.TitleReward;
                            this.rbtnIncentiveWay2.Checked = true;
                        }
                        if (!string.IsNullOrEmpty(incentiveNotice.MattleReward))
                        {
                            this.txtMattleReward.Text      = incentiveNotice.MattleReward;
                            this.rbtnIncentiveWay3.Checked = true;
                        }
                        this.AttachUrl            = incentiveNotice.AttachUrl;
                        this.divFile.InnerHtml    = BLL.UploadAttachmentService.ShowAttachment("../", this.AttachUrl);
                        this.txtFileContents.Text = HttpUtility.HtmlDecode(incentiveNotice.FileContents);
                        if (!string.IsNullOrEmpty(incentiveNotice.SignMan))
                        {
                            this.drpSignMan.SelectedValue = incentiveNotice.SignMan;
                        }
                        if (!string.IsNullOrEmpty(incentiveNotice.ApproveMan))
                        {
                            this.drpApproveMan.SelectedValue = incentiveNotice.ApproveMan;
                        }
                        if (!string.IsNullOrEmpty(incentiveNotice.Currency))
                        {
                            this.txtCurrency.Text = incentiveNotice.Currency;
                        }
                    }
                }
                else
                {
                    this.drpSignMan.SelectedValue = this.CurrUser.UserId;
                    this.txtIncentiveDate.Text    = string.Format("{0:yyyy-MM-dd}", DateTime.Now);
                    var codeTemplateRule = BLL.ProjectData_CodeTemplateRuleService.GetProjectData_CodeTemplateRuleByMenuIdProjectId(BLL.Const.ProjectIncentiveNoticeMenuId, this.ProjectId);
                    if (codeTemplateRule != null)
                    {
                        this.txtFileContents.Text = HttpUtility.HtmlDecode(codeTemplateRule.Template);
                    }
                    ////自动生成编码
                    this.txtIncentiveNoticeCode.Text = BLL.CodeRecordsService.ReturnCodeByMenuIdProjectId(BLL.Const.ProjectIncentiveNoticeMenuId, this.ProjectId, this.CurrUser.UnitId);
                }
                ///初始化审核菜单
                this.ctlAuditFlow.MenuId    = BLL.Const.ProjectIncentiveNoticeMenuId;
                this.ctlAuditFlow.DataId    = this.IncentiveNoticeId;
                this.ctlAuditFlow.ProjectId = this.ProjectId;
                this.ctlAuditFlow.UnitId    = this.CurrUser.UnitId;
            }
        }
Пример #10
0
        /// <summary>
        /// 加载页面
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                this.btnClose.OnClientClick = ActiveWindow.GetHideReference();
                this.ProjectId = this.CurrUser.LoginProjectId;
                this.InitDropDownList();
                this.CheckSpecialId = Request.Params["CheckSpecialId"];
                var checkSpecial = Check_CheckSpecialService.GetCheckSpecialByCheckSpecialId(this.CheckSpecialId);
                if (checkSpecial != null)
                {
                    this.ProjectId = checkSpecial.ProjectId;
                    if (this.ProjectId != this.CurrUser.LoginProjectId)
                    {
                        this.InitDropDownList();
                    }
                    this.txtCheckSpecialCode.Text = CodeRecordsService.ReturnCodeByDataId(this.CheckSpecialId);
                    if (checkSpecial.CheckTime != null)
                    {
                        this.txtCheckDate.Text = string.Format("{0:yyyy-MM-dd}", checkSpecial.CheckTime);
                    }
                    this.txtPartInPersonNames.Text = checkSpecial.PartInPersonNames;
                    if (!string.IsNullOrEmpty(checkSpecial.CheckItemSetId))
                    {
                        this.drpSupCheckItemSet.SelectedValue = checkSpecial.CheckItemSetId;
                        this.getCheckItemDrp();
                    }
                    if (!string.IsNullOrEmpty(checkSpecial.PartInPersonIds))
                    {
                        this.drpPartInPersons.SelectedValueArray = checkSpecial.PartInPersonIds.Split(',');
                    }
                    checkSpecialDetails = (from x in Funs.DB.View_CheckSpecialDetail
                                           where x.CheckSpecialId == this.CheckSpecialId
                                           orderby x.CheckItem
                                           select x).ToList();
                    if (checkSpecialDetails.Count() > 0)
                    {
                        this.drpSupCheckItemSet.Readonly = true;
                    }
                }
                else
                {
                    ////自动生成编码
                    this.txtCheckSpecialCode.Text         = CodeRecordsService.ReturnCodeByMenuIdProjectId(BLL.Const.ProjectCheckSpecialMenuId, this.ProjectId, this.CurrUser.UnitId);
                    this.txtCheckDate.Text                = string.Format("{0:yyyy-MM-dd}", DateTime.Now);
                    this.drpSupCheckItemSet.SelectedIndex = 0;
                    this.drpSupCheckItemSet.SelectedIndex = 0;
                }

                // 删除选中单元格的客户端脚本
                string deleteScript = GetDeleteScript();
                // 新增数据初始值
                JObject defaultObj = new JObject
                {
                    { "WorkArea", "" },
                    { "UnitName", "" },
                    { "Unqualified", "" },
                    { "CheckContent", "" },
                    { "CompleteStatusName", "" },
                    { "HandleStepStr", "" },
                    { "HandleStep", "" },
                    { "UnitId", "" },
                    { "Delete", String.Format("<a href=\"javascript:;\" onclick=\"{0}\"><img src=\"{1}\"/></a>", deleteScript, IconHelper.GetResolvedIconUrl(Icon.Delete)) }
                };
                // 在第一行新增一条数据
                btnNew.OnClientClick = Grid1.GetAddNewRecordReference(defaultObj, false);
                // 删除选中行按钮
                //btnDelete.OnClientClick = Grid1.GetNoSelectionAlertReference("请至少选择一项!") + deleteScript;

                Grid1.DataSource = checkSpecialDetails;
                Grid1.DataBind();
            }
        }