Exemplo n.º 1
0
        public ActionResult ApproveComment(int flowCaseId, string comments, bool?ccToAll)
        {
            if (string.IsNullOrWhiteSpace(comments))
            {
                return(this.ShowErrorInModal(StringResource.COMMENT_REQUIRED));
            }
            ViewBag.flowCaseId = flowCaseId;
            Approver approver = new Approver(WFEntities, this.Username);
            var      result   = approver.CommentStep(flowCaseId, comments, ccToAll);

            if (result == CommentStepResult.Success)
            {
                approver.NotificationSender.Send();
                return(RedirectToAction("Approve", new { flowCaseId = flowCaseId }));
            }
            return(this.ShowErrorInModal(StringResource.SAVE_COMMENT_FAILED));
        }
Exemplo n.º 2
0
        public object comment_flowcase(int flowCaseId, string comments, bool ccToAll = false)
        {
            if (flowCaseId < 1)
            {
                return new { ret_code = RetCode.Error, ret_msg = "Invalid flowCaseId" }
            }
            ;
            if (string.IsNullOrWhiteSpace(comments))
            {
                return new { ret_code = RetCode.Error, ret_msg = "Comments required" }
            }
            ;
            Approver          approver = new Approver(Entities, User.Identity.Name);
            CommentStepResult result   = approver.CommentStep(flowCaseId, comments, ccToAll);

            if (result == CommentStepResult.Success)
            {
                approver.NotificationSender.Send();

                return(new { ret_code = RetCode.Success, ret_msg = string.Empty });
            }
            return(new { ret_code = RetCode.Failure, ret_msg = result.ToString() });
        }