コード例 #1
0
        /// <summary>
        /// 申请人表单操作之崔签
        /// </summary>
        /// <param name="formNo"></param>
        /// <param name="empNo"></param>
        /// <returns></returns>
        public bool Urge(string formNo, string empNo)
        {
            //检查表单所有人
            var forms = new BaseServices <Form>().LoadEntities(c => c.CreateEmpNo == empNo && c.FormNo == formNo).FirstOrDefault();

            if (forms == null)
            {
                return(false);
            }

            var signs = new BaseServices <FormSign>().LoadEntities(c => c.FormNo == formNo && c.SignResult == (int)FormSign.SignResultEnum.Watting);

            //崔签邮件
            if (signs.Any())
            {
                var signsEmp = new List <string>();
                signs.ToList().ForEach(c => signsEmp.Add(c.BaseEmployee.EmpNo));

                var emailForm = new Carlzhu.Iooin.Business.BaseModule.BpmBll(formNo, empNo);
                //var emailForm = new EmailForm(formNo, empNo);
                emailForm.Urge(signsEmp);
                emailForm.NoticeReplace(signsEmp);


                //var email = new Email();
                //email.SdEmail += new Mailtemp.SendMail().Bpm;
                //emailForm.GetArgses().ForEach(a => email.Sending(a));
                TemplateBll.SendBpm(emailForm);
            }



            return(true);
        }
コード例 #2
0
        /// <summary>
        /// 将表单送签
        /// </summary>
        /// <param name="formNo">表单号</param>
        /// <param name="empNo">送签人</param>
        /// <returns></returns>
        public bool Send(string formNo, string empNo)
        {
            string firstEmployee;

            //送签结果
            bool result = _iApplying.Send(formNo, empNo, out firstEmployee);

            //
            //邮件通知
            //
            if (!result)
            {
                return(false);
            }
            var signs = new List <string> {
                firstEmployee
            };

            var emailForm = new Carlzhu.Iooin.Business.BaseModule.BpmBll(formNo, empNo);

            //var emailForm = new EmailForm(formNo, empNo);
            emailForm.Send();
            emailForm.NoticeSigner(signs);
            emailForm.NoticeReplace(signs);

            TemplateBll.SendBpm(emailForm);

            return(true);
        }
コード例 #3
0
ファイル: Signing.cs プロジェクト: sanxchen/MntApp
        /// <summary>
        /// 同意表单
        /// </summary>
        /// <param name="formNo"></param>
        /// <param name="item"></param>
        /// <param name="empNo"></param>
        /// <returns></returns>
        public bool Agree(string formNo, int item, string empNo)
        {
            //首先确认是否有权限签核;
            if (this.GetSignDataList(empNo).All(c => c.FormNo != formNo))
            {
                return(false);
            }

            var formType = new BaseServices <Form>().LoadEntities(c => c.FormNo == formNo).First().FormType;

            //是否需要结案
            var func = formType.IsColsed ? FormExtend.SetFormFinish(formType) : new Func <string, string, int, bool>((f, e, i) => true);

            string nextEmpNo;
            string addsignEmpNo;
            bool   result = _signing.Agree(formNo, item, empNo, out nextEmpNo, out addsignEmpNo, func);


            if (!result)
            {
                return(false);
            }
            //有邮件发送
            var emailForm = new BpmBll(formNo, empNo);

            //var emailForm = new EmailForm(formNo, empNo);

            if (string.IsNullOrEmpty(nextEmpNo))
            {
                emailForm.Finlish();
            }
            else if (!string.IsNullOrEmpty(addsignEmpNo))
            {
                //是加签的
                emailForm.AddSignerAfter(nextEmpNo, (int)FormSign.DirectEnum.After);
            }
            else
            {
                var signers = new List <string> {
                    nextEmpNo
                };

                //正常下一位签核人
                emailForm.NoticeSigner(signers);
                emailForm.NoticeReplace(signers);
            }


            return(TemplateBll.SendBpm(emailForm));
        }
コード例 #4
0
ファイル: Signing.cs プロジェクト: sanxchen/MntApp
        /// <summary>
        /// 转签表单,转签表单号,转签记录,转签至工号,转签理由,转签人
        /// </summary>
        /// <param name="formNo">转签表单号</param>
        /// <param name="item">转签记录</param>
        /// <param name="redirectempno">转签至工号</param>
        /// <param name="reason">转签理由</param>
        /// <param name="empNo">转签人</param>
        /// <param name="msg"></param>
        /// <returns></returns>
        public bool IsRedirectSign(string formNo, int item, string redirectempno, string reason, string empNo, out string msg)
        {
            if (!_signing.IsRedirectSign(formNo, item, redirectempno, reason, empNo, out msg))
            {
                return(false);
            }

            //发送邮件
            var emailForm = new BpmBll(formNo, empNo);

            emailForm.RedirectSigner(redirectempno);

            TemplateBll.SendBpm(emailForm);



            return(true);
        }
コード例 #5
0
ファイル: Signing.cs プロジェクト: sanxchen/MntApp
        /// <summary>
        /// 加签
        /// </summary>
        /// <param name="formNo">表单号</param>
        /// <param name="item">记录号</param>
        /// <param name="addempno">加签至工号</param>
        /// <param name="reason">理由</param>
        /// <param name="direction">方向,前,平,后</param>
        /// <param name="empNo">加签人</param>
        /// <returns></returns>
        public bool AddSign(string formNo, int item, string addempno, string reason, int direction, string empNo, out string msg)
        {
            msg = "加签失败";
            lock (new object())
            {
                if (!
                    new BaseServices <Form>().LoadEntities(c => c.FormNo.Equals(formNo))
                    .First()
                    .FormType.IsAdd)
                {
                    msg = "此表单不充许加签";
                    return(false);
                }

                bool result;

                switch (direction)
                {
                case -1:
                    result = _signing.IsAddSignBefore(formNo, item, addempno, reason, empNo);
                    break;

                case 0:
                    result = _signing.IsAddSignParallel(formNo, item, addempno, reason, empNo);
                    break;

                default:
                    result = _signing.IsAddSignAfter(formNo, item, addempno, reason, empNo);
                    break;
                }

                if (!result)
                {
                    return(false);
                }

                var emailForm = new BpmBll(formNo, empNo);
                emailForm.AddSigner(addempno, direction);
                TemplateBll.SendBpm(emailForm);

                msg = "加签成功";
                return(true);
            }
        }
コード例 #6
0
ファイル: FormExtend.cs プロジェクト: sanxchen/MntApp
        /// <summary>
        /// NCR表单结案
        /// </summary>
        /// <param name="formNo"></param>
        /// <param name="empNo"></param>
        /// <param name="item"></param>
        /// <returns></returns>
        private static bool _30Finish(string formNo, string empNo, int item)
        {
            //发送异常邮件
            var model = new BaseServices <FormNcr>().LoadEntities(c => c.FormNo == formNo).First();

            model.AuditEmp  = empNo;
            model.AuditTime = DateTime.Now;

            if (!new BaseServices <FormNcr>().UpdateEntity(model))
            {
                return(false);
            }

            //  CreatePath(formNo, model.Form.CreateEmpNo, 31, "临时对策", GetHolder(model.FormNo));

            var emailForm = new QualityAbnormalBll(formNo, empNo);

            emailForm.NoticeA();
            return(TemplateBll.SendBpm(emailForm));
        }
コード例 #7
0
ファイル: Signing.cs プロジェクト: sanxchen/MntApp
        /// <summary>
        /// 否决表单
        /// </summary>
        /// <param name="formNo"></param>
        /// <param name="item"></param>
        /// <param name="empNo"></param>
        /// <returns></returns>
        public bool Reject(string formNo, int item, string empNo)
        {
            //首先确认是否有权限签核;
            if (this.GetSignDataList(empNo).All(c => c.FormNo != formNo))
            {
                return(false);
            }

            var result = _signing.Reject(formNo, item, empNo);

            if (result)
            {
                var emailForm = new BpmBll(formNo, empNo);
                emailForm.Reject();

                TemplateBll.SendBpm(emailForm);
            }

            return(result);
        }