public object reject_flowcase(UnApproveModel model) { Singleton <ILogWritter> .Instance?.WriteLog("WorkFlow-reject_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.Reject(model.flowCaseId, model.comments); if (result == ApproveResult.Rejected || result == ApproveResult.FlowRejected) { approver.NotificationSender.Send(); return(new { ret_code = RetCode.Success, ret_msg = string.Empty }); } return(new { ret_code = RetCode.Failure, ret_msg = result.ToString() }); }
public ActionResult Reject(int flowCaseId, string comments) { Approver manager = new Approver(WFEntities, this.Username); ApproveResult result = manager.Reject(flowCaseId, comments); manager.NotificationSender.Send(); ViewBag.approveResult = result; ViewBag.InboxCount = manager.CountInbox(); return(PartialView("Result", manager.GetFlowAndCase(flowCaseId))); }