Ejemplo n.º 1
0
        public object sendback_flowcase(UnApproveModel model)
        {
            Singleton <ILogWritter> .Instance?.WriteLog("WorkFlow-sendback_flowcase", JsonConvert.SerializeObject(model));

            if (model == null)
            {
                return new { ret_code = RetCode.Error, ret_msg = "Invalid api parameter" }
            }
            ;
            if (model.flowCaseId < 1)
            {
                return new { ret_code = RetCode.Error, ret_msg = "Invalid flowCaseId" }
            }
            ;
            if (string.IsNullOrWhiteSpace(model.comments))
            {
                return new { ret_code = RetCode.Error, ret_msg = "Comments required" }
            }
            ;
            Approver approver = new Approver(Entities, User.Identity.Name);
            var      result   = approver.Abort(model.flowCaseId, model.comments);

            if (result == ApproveResult.Aborted)
            {
                approver.NotificationSender.Send();

                return(new { ret_code = RetCode.Success, ret_msg = string.Empty });
            }
            return(new { ret_code = RetCode.Failure, ret_msg = result.ToString() });
        }
Ejemplo n.º 2
0
        public ActionResult SendBack(int flowCaseId, string comments)
        {
            Approver      applicant = new Approver(WFEntities, this.Username);
            ApproveResult result    = applicant.Abort(flowCaseId, comments);

            applicant.NotificationSender.Send();
            ViewBag.approveResult = result;
            ViewBag.InboxCount    = applicant.CountInbox();
            return(PartialView("Result", applicant.GetFlowAndCase(flowCaseId)));
        }