コード例 #1
0
        protected void btnSubmitUnderTake_Click(object sender, EventArgs e)
        {
            String  l_strUndertakeInfo = String.Empty;
            String  l_strMessageInfo   = String.Empty;
            Boolean l_blnIsUnderTake   = false;
            String  l_strDeptLeaderID  = null;

            if (String.IsNullOrEmpty(txtUnderTakeDeptID.Text.TrimEnd()))
            {
                JScript.ShowMsgBox(this.Page, MsgType.VbCritical, "没有选择承办部门");
                return;
            }

            //表单的合法性验证
            if (!VerifyField())
            {
                JScript.ShowMsgBox(this.Page, MsgType.VbCritical, m_strAryMessages);
                return;
            }

            //提交动作
            this.m_strSubmitAction = ProcessConstString.SubmitAction.ReceiveBase.SUBMIT_UNDERTAKE;

            //获取承办部门ID
            String[] l_strAryUnderTakeDeptID = txtUnderTakeDeptID.Text.TrimEnd().Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);

            if (l_strAryUnderTakeDeptID.Length > 0)
            {
                foreach (String l_strUnderTakeDeptID in l_strAryUnderTakeDeptID)
                {
                    //流程创建时候设置自定义属性
                    l_strDeptLeaderID = OAUser.GetUserByDeptPostArray(this.txtUnderTakeDeptID.Text, null, true, true)[0];

                    String l_strDeptName = OADept.GetDeptByDeptID(l_strUnderTakeDeptID).Name;

                    if (String.IsNullOrEmpty(l_strDeptLeaderID))
                    {
                        l_strUndertakeInfo += l_strDeptName + ":无处级领导,该部门不参与承办\\n";
                    }
                    else
                    {
                        l_blnIsUnderTake = true;
                    }
                }
            }

            //不能承办
            if (!l_blnIsUnderTake)
            {
                JScript.ShowMsgBox(this.Page, MsgType.VbCritical, "提交承办处理失败:承办部门都无处级领导,无法承办");
                return;
            }

            l_htAttribute.Add(ConstString.CustomAttr.Receive.DeptDirector, l_strDeptLeaderID);
            l_htAttribute.Add(ConstString.CustomAttr.Receive.IsMultipleDept, false);
            l_htAttribute.Add(ConstString.CustomAttr.Receive.IsDirectArchive, false);
            l_htAttribute.Add(ConstString.CustomAttr.Receive.IsPlot, false);

            base.FormSubmit(false, m_strSubmitAction, l_htAttribute, this.ControlToEntity(false));
        }
コード例 #2
0
        /// <summary>
        ///申请单的编号规则 CC+部门代码+年度+四位流水号
        /// </summary>
        /// <returns></returns>
        protected string GetFinanceTripNo(B_Finance entity)
        {
            Department     dept           = OADept.GetDeptByDeptID(this.ddlBianZhiBuMen.SelectedValue);
            string         strLine        = "-";
            string         strYear        = DateTime.Now.Year.ToString();
            B_DocumentNo_A b_documentno_a = new B_DocumentNo_A();

            return("CCSQ" + strLine + dept.No + strLine + b_documentno_a.GetNo(ProcessConstString.TemplateName.FINANCE_TRIPAPPLY, strYear));
        }
コード例 #3
0
        protected string GetFinanceNo(B_FinanceZDBX entity)
        {
            Department     dept           = OADept.GetDeptByDeptID(this.ddlDepartment.SelectedValue);
            string         strLine        = "-";
            string         strYear        = DateTime.Now.Year.ToString();
            B_DocumentNo_A b_documentno_a = new B_DocumentNo_A();

            return("ZDBX" + strLine + dept.No + strLine + b_documentno_a.GetNo(ProcessConstString.TemplateName.FinanceZDBX_APPLY, strYear));
        }
コード例 #4
0
        /// <summary>
        /// 实体赋值
        /// </summary>
        /// <param name="IsSave"></param>
        /// <returns></returns>
        protected override EntityBase ControlToEntity(bool IsSave)
        {
            B_FinanceHWBX entity = base.EntityData != null ? base.EntityData as B_FinanceHWBX : new B_FinanceHWBX();

            switch (base.StepName)
            {
                #region 拟稿
            case ProcessConstString.StepName.STEP_DRAFT:

                entity.DocumentNo = txtDocumentNo.Text;

                //拟稿日期
                entity.DraftDate = DateTime.Now;
                //拟稿人
                entity.Drafter   = this.txtNiGaoRen.Text;
                entity.DrafterID = this.txtNiGaoRenID.Text;

                //标题、主题
                entity.DocumentTitle = entity.Drafter + "-" + "会务报销单";

                //编制部门
                if (this.ddlBianZhiBuMen.Items.Count > 0)
                {
                    entity.Department   = this.ddlBianZhiBuMen.SelectedItem.Text;
                    entity.DepartmentID = this.ddlBianZhiBuMen.SelectedValue;
                }

                //验收
                entity.YanShouRen   = this.ddlYanShouRen.SelectedItem.Text;
                entity.YanShouRenID = this.ddlYanShouRen.SelectedValue;

                //提交后产生报销单编号 报销单的编号为BX+部门代码+年度+四位流水号。
                if (IsSave == false && entity.DocumentNo == "")
                {
                    string year = DateTime.Now.Year.ToString();

                    string deptNo = OADept.GetDeptByDeptID(entity.DepartmentID).No;

                    entity.DocumentNo = "HWBX" + "-" + deptNo + "-" + entity.GenerateBianHao(year, "会务报销单");
                }
                break;
                #endregion

                #region 验收
            case ProcessConstString.StepName.FinanceHWBXStepName.STEP_YANSHOU:
                if (base.SubAction == ProcessConstString.SubmitAction.ACTION_DENY)
                {
                    entity.IsBack = true;
                }
                else
                {
                    entity.IsBack = false;

                    entity.YanShouRiQi = DateTime.Now.ToString("yyyy-MM-dd");

                    entity.ShenQianRen   = this.ddlShenQianRen.SelectedItem.Text;
                    entity.ShenQianRenID = this.ddlShenQianRen.SelectedValue;
                }

                break;
                #endregion

                #region 立项审签
            case ProcessConstString.StepName.FinanceHWBXStepName.STEP_LIXIANGSHENQIAN:
                if (base.SubAction == ProcessConstString.SubmitAction.ACTION_DENY)
                {
                    entity.IsBack = true;
                }
                else
                {
                    entity.IsBack = false;

                    entity.ShenQianRiQi = DateTime.Now.ToString("yyyy-MM-dd");

                    entity.ShenHeRen   = this.ddlShenHe.SelectedItem.Text;
                    entity.ShenHeRenID = this.ddlShenHe.SelectedValue;
                }
                break;
                #endregion

                #region 审核
            case ProcessConstString.StepName.FinanceHWBXStepName.STEP_SHENHE:
                if (base.SubAction == ProcessConstString.SubmitAction.ACTION_DENY)
                {
                    entity.IsBack = true;
                }
                else
                {
                    entity.IsBack = false;

                    entity.ShenHeRiQi = DateTime.Now.ToString("yyyy-MM-dd");

                    entity.ShenPiRen   = this.ddlShenPi.SelectedItem.Text;
                    entity.ShenPiRenID = this.ddlShenPi.SelectedValue;

                    entity.CaiWu   = this.ddlCaiWu.SelectedItem.Text;
                    entity.CaiWuID = this.ddlCaiWu.SelectedValue;
                }
                break;
                #endregion

                #region 审批
            case ProcessConstString.StepName.FinanceHWBXStepName.STEP_SHENPI:
                if (base.SubAction == ProcessConstString.SubmitAction.ACTION_DENY)
                {
                    entity.IsBack = true;
                }
                else
                {
                    entity.IsBack     = false;
                    entity.ShenPiRiQi = DateTime.Now.ToString("yyyy-MM-dd");

                    entity.CaiWu   = this.ddlCaiWu.SelectedItem.Text;
                    entity.CaiWuID = this.ddlCaiWu.SelectedValue;
                }

                break;
                #endregion

                #region 财务
            case ProcessConstString.StepName.FinanceHWBXStepName.STEP_CAIWUSHENHE:
                if (base.SubAction == ProcessConstString.SubmitAction.ACTION_DENY)
                {
                    entity.IsBack = true;
                }
                else
                {
                    entity.IsBack    = false;
                    entity.CaiWuRiQi = DateTime.Now.ToString("yyyy-MM-dd");
                }
                break;
                #endregion
            }

            entity.LiXiangHao       = txtLiXiangHao.Text;
            entity.LiXiangJinE      = txtLiXiangJinE.Text;
            entity.LiXiangLeiJiJinE = txtLiXiangLeiJiJinE.Text;
            entity.ShouKuanYinHang  = txtShouKuanYinHang.Text;
            entity.ShouKuanDanWei   = txtShouKuanDanWei.Text;
            entity.ShouKuanZhangHao = txtShouKuanZhangHao.Text;
            entity.BaoXiaoJinE      = txtBaoXiaoJinE.Text;
            entity.BaoXiaoJinEDaXie = txtBaoXiaoJinEDaXie.Text;
            entity.DanJuZhangShu    = SysConvert.ToInt32(txtDanJuZhangShu.Text);
            entity.YongTu           = txtYongTu.Text;

            #region 提示信息、意见
            if (!IsSave)
            {
                if (!string.IsNullOrEmpty(this.txtTianJia.Text))
                {
                    entity.MessageAdd = string.Empty;
                    entity.Message    = this.txtTiShiXinXi.Text + (string.IsNullOrEmpty(entity.ReceiveUserName) ? CurrentUserInfo.DisplayName : entity.ReceiveUserName) + "[" + DateTime.Now.ToString(ConstString.DateFormat.Long) + "]:(" + base.StepName + ")" + SysString.InputText(this.txtTianJia.Text) + "\n";
                }
            }
            else
            {
                entity.Message    = this.txtTiShiXinXi.Text;
                entity.MessageAdd = this.txtTianJia.Text;
            }
            #endregion
            return(entity);
        }
コード例 #5
0
        /// <summary>
        /// 实体赋值
        /// </summary>
        /// <param name="IsSave"></param>
        /// <returns></returns>
        protected override EntityBase ControlToEntity(bool IsSave)
        {
            B_FinanceCCBX entity = base.EntityData != null ? base.EntityData as B_FinanceCCBX : new B_FinanceCCBX();

            switch (base.StepName)
            {
                #region 拟稿
            case ProcessConstString.StepName.STEP_DRAFT:

                entity.Type         = ddlType.SelectedValue;
                entity.ChuChaDanHao = txtChuChaDanHao.Text;
                entity.DocumentNo   = txtBianHao.Text;

                //拟稿日期
                entity.DraftDate = DateTime.Now;
                //拟稿人
                entity.Drafter   = this.txtNiGaoRen.Text;
                entity.DrafterID = this.txtNiGaoRenID.Text;

                //标题、主题
                entity.DocumentTitle = entity.Drafter + "-" + ddlType.SelectedValue + "报销单";

                if (ddlZhiCheng.SelectedItem != null)
                {
                    entity.ZhiWuZhiCheng = ddlZhiCheng.SelectedItem.Text;
                }
                entity.ZhiWuZhiChengID = ddlZhiCheng.SelectedValue;

                //编制部门
                if (this.ddlBianZhiBuMen.Items.Count > 0)
                {
                    entity.Department   = this.ddlBianZhiBuMen.SelectedItem.Text;
                    entity.DepartmentID = this.ddlBianZhiBuMen.SelectedValue;
                }
                entity.GeRenJieKuan  = ddlJieKuan.SelectedValue;
                entity.Phone         = txtPhone.Text;
                entity.DanJuZhangShu = SysConvert.ToInt32(txtDanJuZhangShu.Text);
                entity.ShiYou        = txtShiYou.Text;

                //主管领导
                entity.BuMenZhuGuan   = this.ddlBuMenZhuGuan.SelectedItem.Text;
                entity.BuMenZhuGuanID = this.ddlBuMenZhuGuan.SelectedValue;

                //公司领导
                if (this.ddlGSLingDao.SelectedItem != null)
                {
                    entity.GongSiLingDao = this.ddlGSLingDao.SelectedItem.Text;
                }
                entity.GongSiLingDaoID = this.ddlGSLingDao.SelectedValue;

                //提交后产生报销单编号 报销单的编号为BX+部门代码+年度+四位流水号。
                if (IsSave == false && entity.DocumentNo == "")
                {
                    string year = DateTime.Now.Year.ToString();

                    string deptNo = OADept.GetDeptByDeptID(entity.DepartmentID).No;

                    if (ddlType.SelectedValue == "出差")
                    {
                        entity.DocumentNo = "CCBX" + "-" + deptNo + "-" + entity.GenerateBianHao(year, "出差报销单");
                    }
                    else
                    {
                        entity.DocumentNo = "PXBX" + "-" + deptNo + "-" + entity.GenerateBianHao(year, "培训报销单");
                    }
                }
                break;
                #endregion

                #region 主管领导审核
            case ProcessConstString.StepName.FinanceCCBXStepName.STEP_DEPTVERIFY:
                if (base.SubAction == ProcessConstString.SubmitAction.ACTION_DENY)
                {
                    entity.IsBack = true;
                }
                else
                {
                    entity.IsBack           = false;
                    entity.BuMenZhuGuanRiQi = DateTime.Now.ToString("yyyy-MM-dd");
                    //公司领导
                    if (this.ddlGSLingDao.SelectedItem != null)
                    {
                        entity.GongSiLingDao   = this.ddlGSLingDao.SelectedItem.Text;
                        entity.GongSiLingDaoID = this.ddlGSLingDao.SelectedValue;
                    }
                    //财务
                    if (this.ddlCaiWu.SelectedItem != null)
                    {
                        entity.CaiWu   = this.ddlCaiWu.SelectedItem.Text;
                        entity.CaiWuID = this.ddlCaiWu.SelectedValue;
                    }
                    //归口部门主管 培训处领导
                    if (this.ddlPeiXunChu.SelectedItem != null)
                    {
                        entity.PeiXunChuLingDao   = this.ddlPeiXunChu.SelectedItem.Text;
                        entity.PeiXunChuLingDaoID = this.ddlPeiXunChu.SelectedValue;
                    }
                }

                break;
                #endregion

                #region 培训处审核
            case ProcessConstString.StepName.FinanceCCBXStepName.STEP_PXCVERIFY:
                if (base.SubAction == ProcessConstString.SubmitAction.ACTION_DENY)
                {
                    entity.IsBack = true;
                }
                else
                {
                    entity.IsBack = false;
                    entity.PeiXunChuLingDaoRiQi = DateTime.Now.ToString("yyyy-MM-dd");
                    //公司领导
                    if (this.ddlGSLingDao.SelectedItem != null)
                    {
                        entity.GongSiLingDao   = this.ddlGSLingDao.SelectedItem.Text;
                        entity.GongSiLingDaoID = this.ddlGSLingDao.SelectedValue;
                    }
                    //财务
                    if (this.ddlCaiWu.SelectedItem != null)
                    {
                        entity.CaiWu   = this.ddlCaiWu.SelectedItem.Text;
                        entity.CaiWuID = this.ddlCaiWu.SelectedValue;
                    }
                }

                break;
                #endregion

                #region 公司领导
            case ProcessConstString.StepName.FinanceCCBXStepName.STEP_GSLDVERIFY:
                if (base.SubAction == ProcessConstString.SubmitAction.ACTION_DENY)
                {
                    entity.IsBack = true;
                }
                else
                {
                    entity.IsBack            = false;
                    entity.GongSiLingDaoRiQi = DateTime.Now.ToString("yyyy-MM-dd");
                    //财务
                    if (this.ddlCaiWu.SelectedItem != null)
                    {
                        entity.CaiWu   = this.ddlCaiWu.SelectedItem.Text;
                        entity.CaiWuID = this.ddlCaiWu.SelectedValue;
                    }
                }

                break;
                #endregion

                #region 财务
            case ProcessConstString.StepName.FinanceCCBXStepName.STEP_CWVERIFY:
                if (base.SubAction == ProcessConstString.SubmitAction.ACTION_DENY)
                {
                    entity.IsBack = true;
                }
                else
                {
                    entity.IsBack    = false;
                    entity.CaiWuRiQi = DateTime.Now.ToString("yyyy-MM-dd");
                }

                break;
                #endregion
            }

            //费用相关 拟稿人和财务都会改
            if (base.StepName == ProcessConstString.StepName.STEP_DRAFT || base.StepName == ProcessConstString.StepName.FinanceCCBXStepName.STEP_CWVERIFY)
            {
                entity.LiXiangHao = txtLiXiangHao.Text;
                entity.LiXiangJE  = txtLiXiangJE.Text.ToString();
                entity.YuSuanNei  = ddlYuSuanNei.SelectedValue;

                #region 费用
                entity.ChuXingDetails = ucChuXingMingXi.UCGetCXList();

                //其他费用
                entity.QiTaFeiYongDetails = new List <M_FinanceCCBX.QiTaFeiYongDetail>();
                M_FinanceCCBX.QiTaFeiYongDetail qiTaFeiYongDetail = new M_FinanceCCBX.QiTaFeiYongDetail();
                qiTaFeiYongDetail.Name    = "住宿费";
                qiTaFeiYongDetail.RenTian = SysConvert.ToDecimal(txtZhuSuRT.Text);
                qiTaFeiYongDetail.JinE    = SysConvert.ToDecimal(txtZhuSuJE.Text);
                entity.QiTaFeiYongDetails.Add(qiTaFeiYongDetail);

                qiTaFeiYongDetail         = new M_FinanceCCBX.QiTaFeiYongDetail();
                qiTaFeiYongDetail.Name    = "托运费";
                qiTaFeiYongDetail.RenTian = SysConvert.ToDecimal(txtTuoYunRT.Text);
                qiTaFeiYongDetail.JinE    = SysConvert.ToDecimal(txtTuoYunJE.Text);
                entity.QiTaFeiYongDetails.Add(qiTaFeiYongDetail);

                qiTaFeiYongDetail         = new M_FinanceCCBX.QiTaFeiYongDetail();
                qiTaFeiYongDetail.Name    = "其他";
                qiTaFeiYongDetail.RenTian = SysConvert.ToDecimal(txtQiTaRT.Text);
                qiTaFeiYongDetail.JinE    = SysConvert.ToDecimal(txtQiTaJE.Text);
                entity.QiTaFeiYongDetails.Add(qiTaFeiYongDetail);

                //其他费用小计
                Decimal qiTaXiaoJi = 0;
                foreach (var item in entity.QiTaFeiYongDetails)
                {
                    qiTaXiaoJi += item.JinE;
                }
                entity.QiTaFeiYongXiaoJi = qiTaXiaoJi;

                //出差补贴
                entity.BuTieDetails = new List <M_FinanceCCBX.BuTieDetail>();
                M_FinanceCCBX.BuTieDetail buTieDetail = new M_FinanceCCBX.BuTieDetail();
                buTieDetail.Name    = "住勤补贴";
                buTieDetail.RenTian = SysConvert.ToDecimal(txtZhuQinRT.Text);
                buTieDetail.JinE    = SysConvert.ToDecimal(txtZhuQinJE.Text);
                entity.BuTieDetails.Add(buTieDetail);

                buTieDetail         = new M_FinanceCCBX.BuTieDetail();
                buTieDetail.Name    = "住宿节约补贴";
                buTieDetail.RenTian = SysConvert.ToDecimal(txtZhuSuJYRT.Text);
                buTieDetail.JinE    = SysConvert.ToDecimal(txtZhuSuJYJE.Text);
                entity.BuTieDetails.Add(buTieDetail);

                buTieDetail         = new M_FinanceCCBX.BuTieDetail();
                buTieDetail.Name    = "未乘坐卧铺补贴";
                buTieDetail.RenTian = SysConvert.ToDecimal(txtWeiWoPuRT.Text);
                buTieDetail.JinE    = SysConvert.ToDecimal(txtWeiWoPuBuJE.Text);
                entity.BuTieDetails.Add(buTieDetail);

                buTieDetail         = new M_FinanceCCBX.BuTieDetail();
                buTieDetail.Name    = "在途补贴";
                buTieDetail.RenTian = SysConvert.ToDecimal(txtZaiTuRT.Text);
                buTieDetail.JinE    = SysConvert.ToDecimal(txtZaiTuJE.Text);
                entity.BuTieDetails.Add(buTieDetail);

                //出差补贴小计
                Decimal chuChaXiaoJi = 0;
                foreach (var item in entity.BuTieDetails)
                {
                    chuChaXiaoJi += item.JinE;
                }
                entity.BuTieXiaoJi = chuChaXiaoJi;

                //合计
                entity.HeJi            = SysConvert.ToDecimal(txtHeJi.Text);
                entity.CaiWuShenHeJinE = txtCaiWuJE.Text;

                entity.ZhuQinToolTip = txtZhuQinJE.ToolTip;
                entity.ZhuSuToolTip  = txtZhuSuJE.ToolTip;
                entity.ZiXingToolTip = txtZiXingJinE.ToolTip;
                #endregion

                entity.ChangQiBuTie  = txtChangQiBuTie.Text;
                entity.ZiXingTianShu = SysConvert.ToInt32(txtZiXingTianShu1.Text);
                entity.ZiXingJinE    = SysConvert.ToDecimal(txtZiXingJinE.Text);
            }
            #region 提示信息、意见
            if (!IsSave)
            {
                if (!string.IsNullOrEmpty(this.txtTianJia.Text))
                {
                    entity.MessageAdd = string.Empty;
                    entity.Message    = this.txtTiShiXinXi.Text + (string.IsNullOrEmpty(entity.ReceiveUserName) ? CurrentUserInfo.DisplayName : entity.ReceiveUserName) + "[" + DateTime.Now.ToString(ConstString.DateFormat.Long) + "]:(" + base.StepName + ")" + SysString.InputText(this.txtTianJia.Text) + "\n";
                }
            }
            else
            {
                entity.Message    = this.txtTiShiXinXi.Text;
                entity.MessageAdd = this.txtTianJia.Text;
            }
            #endregion
            return(entity);
        }