Пример #1
0
        /// <summary>
        /// 实体加载
        /// </summary>
        protected override void EntityToControl()
        {
            B_FinanceZDBX entity = base.EntityData != null ? base.EntityData as B_FinanceZDBX : new B_FinanceZDBX();

            //附件
            ucAttachment.UCDataList = entity.FileList;

            this.txtYuSuanJinE.Text       = entity.YuSuanJinE;
            this.txtLeiJiBaoXiaoJinE.Text = entity.LeiJiBaoXiaoJinE;
            this.txtIsChaoYuSuan.Text     = entity.IsChaoYuSuan == true ? "1" : "";
            this.txtIsManager.Text        = entity.IsLeader == true ? "1" : "";
            string userID = string.IsNullOrEmpty(entity.ReceiveUserID) ? CurrentUserInfo.UserName : entity.ReceiveUserID;

            if (base.StepName == ProcessConstString.StepName.STEP_DRAFT && !base.IsPreview)
            {
                //拟稿日期
                txtNiGaoRiQi.Text = DateTime.Now.ToString("yyyy-MM-dd");
                //拟稿人
                this.txtNiGaoRen.Text   = CurrentUserInfo.DisplayName;
                this.txtNiGaoRenID.Text = CurrentUserInfo.UserName;
                OADept.GetDeptByUser(this.ddlDepartment, userID, 1, true, false);
                FormsMethod.SelectedDropDownList(this.ddlDepartment, entity.DepartmentID);

                string[] ManagerIds = OAUser.GetDeptManagerArray(this.ddlDepartment.SelectedValue, -1);

                if (ManagerIds[0].Contains(CurrentUserInfo.UserName))
                {
                    txtIsManager.Text = "1";
                }
                if (txtIsManager.Text == "1")
                {
                    OAUser.GetUserByDeptPost(ddlChuLingDao, this.ddlDepartment.SelectedValue, OUConstString.PostName.FUCHUZHANG, false, true, 0);
                }
                else
                {
                    FounderSoftware.Framework.Business.ViewBase vDept = OADept.GetDeptByDeptUser(this.ddlDepartment.SelectedValue, userID, 2);
                    //根据处室部门的ID和用户账号找出用户所属该处室下的科室-修改bug
                    if (!string.IsNullOrEmpty(vDept.IDs))
                    {
                        OAUser.GetUserByDeptPost(ddlYanShouRen, vDept.IDs, OUConstString.PostName.FUKEZHANG, false, true, 2);
                    }
                }

                B_FinanceDeptInfo bllInfo = new B_FinanceDeptInfo();
                M_FinanceDeptInfo info    = bllInfo.GetFinanceDeptInfoByDeptID(DateTime.Now.Year.ToString(), this.ddlDepartment.SelectedValue);
                this.txtYuSuanJinE.Text       = info.ZDBudgetCost;
                this.txtLeiJiBaoXiaoJinE.Text = info.ZDUseCost;

                if (!string.IsNullOrEmpty(entity.ChuLingDaoID))
                {
                    FormsMethod.SelectedDropDownList(this.ddlChuLingDao, entity.ChuLingDaoID);
                }

                if (!string.IsNullOrEmpty(entity.YanShouRenID))
                {
                    FormsMethod.SelectedDropDownList(this.ddlYanShouRen, entity.YanShouRenID);
                }
            }
            else
            {
                FormsMethod.SetDropDownList(this.ddlDepartment, entity.DepartmentID, entity.Department);
                FormsMethod.SetDropDownList(this.ddlZongJingLi, entity.ZongJingLiID, entity.ZongJingLi);
                FormsMethod.SetDropDownList(this.ddlZhuGuanLingDao, entity.ZhuGuanLingDaoID, entity.ZhuGuanLingDao);
                FormsMethod.SetDropDownList(this.ddlChuLingDao, entity.ChuLingDaoID, entity.ChuLingDao);
                FormsMethod.SetDropDownList(this.ddlYanShouRen, entity.YanShouRenID, entity.YanShouRen);
                FormsMethod.SetDropDownList(this.ddlJingShouRen, entity.JingShouRenID, entity.JingShouRen);
            }

            //验收
            if (base.StepName == ProcessConstString.StepName.FinanceZDBXStepName.STEP_KeZhang && !base.IsPreview)
            {
                OAUser.GetUserByDeptPost(ddlChuLingDao, this.ddlDepartment.SelectedValue, OUConstString.PostName.CHUZHANG, false, true, 0);
            }

            //处长审核
            if (base.StepName == ProcessConstString.StepName.FinanceZDBXStepName.STEP_ChuZhang && !base.IsPreview)
            {
                OAUser.GetUserByRole(this.ddlZongJingLi, OUConstString.RoleName.COMPANY_LEADER);
                OAUser.GetUserByRole(this.ddlZhuGuanLingDao, OUConstString.RoleName.COMPANY_LEADER);
                OAUser.GetUserByRole(this.ddlJingShouRen, OUConstString.RoleName.CaiWu);
                if (txtIsManager.Text != "1")
                {
                    B_FinanceDeptInfo bllInfo = new B_FinanceDeptInfo();
                    M_FinanceDeptInfo info    = bllInfo.GetFinanceDeptInfoByDeptID(DateTime.Now.Year.ToString(), this.ddlDepartment.SelectedValue);
                    this.txtYuSuanJinE.Text       = info.ZDBudgetCost;
                    this.txtLeiJiBaoXiaoJinE.Text = info.ZDUseCost;
                    Double FeeFa = Convert.ToDouble(string.IsNullOrEmpty(txtLeiJiBaoXiaoJinE.Text) ? "0" : txtLeiJiBaoXiaoJinE.Text);
                    Double FeeYu = Convert.ToDouble(string.IsNullOrEmpty(txtYuSuanJinE.Text) ? "0" : txtYuSuanJinE.Text);
                    Double Rate  = (string.IsNullOrEmpty(FeeRate) == true ? 0.1 : Convert.ToDouble(FeeRate));
                    if (FeeFa > FeeYu)
                    {
                        txtIsChaoYuSuan.Text = "1";
                    }
                }
            }

            //领导审核
            if (base.StepName == ProcessConstString.StepName.FinanceZDBXStepName.STEP_LingDao && !base.IsPreview)
            {
                OAUser.GetUserByRole(this.ddlJingShouRen, OUConstString.RoleName.CaiWu);
            }

            //是否退回
            if (base.StepName == ProcessConstString.StepName.STEP_DRAFT)
            {
                //this.txtIsBack.Text = entity.IsBack.ToString();
            }

            //拟稿人及日期
            if (entity.DraftDate != DateTime.MinValue)
            {
                this.txtNiGaoRiQi.Text = entity.DraftDate.ToString(DateFormat);

                //拟稿人显示非下拉列表框形式
                this.txtNiGaoRen.Visible = false;
                this.lblNiGaoRen.Visible = true;
                //this.lbNiGaoRen.Text = entity.Drafter + strNewLine + entity.DraftDate.ToString(ConstString.DateFormat.Long);
                this.lblNiGaoRen.Text = entity.Drafter;
            }
            else
            {
                this.txtNiGaoRiQi.Text = DateTime.Now.ToString(DateFormat);
            }
            //申请单编号
            this.txtDocumentNo.Text = entity.DocumentNo;

            this.txtDanJuZhangShu.Text = entity.DanJuZhangShu == Int32.MinValue ? "" : entity.DanJuZhangShu.ToString();

            this.txtYongTu.Text = entity.YongTu;

            txtBaoXiaoJinE.Text      = entity.BaoXiaoJinE;
            txtBaoXiaoJinEDaXie.Text = entity.BaoXiaoJinEDaXie;

            this.txtShouKuanDanWei.Text = entity.ShouKuanDanWei;

            this.txtShouKuanZhangHao.Text = entity.ShouKuanZhangHao;

            this.txtShouKuanYinHang.Text = entity.ShouKuanYinHang;

            this.txtShouKuanZhangHao.Text = entity.ShouKuanZhangHao;

            this.txtYanQingRenShu.Text = entity.YanQingRenShu;

            this.txtRenJunXiaoFeiE.Text = entity.RenJunXiaoFeiE;

            ////拟稿人
            //this.txtNiGaoRen.Text = entity.Drafter;
            //this.txtNiGaoRenID.Text = entity.NiGaoRenID;

            //提示信息
            this.txtTiShiXinXi.Text = entity.Message;

            //提示信息添加
            this.txtTianJia.Text = entity.MessageAdd;

            //this.txtGeneralManagerID.Text = entity.GeneralManagerID;

            //this.txtChargeLeaderID.Text = entity.ChargeLeaderID;

            //this.txtDepartmentLeaderID.Text = entity.DepartmentLeaderID;
        }