public ActionResult CommentView(VMESSPCommon vmESSPCommon) { VMLoggedUser LoggedInUser = Session["LoggedInUser"] as VMLoggedUser; // Save Entry in Flow\ string Message = ""; switch (vmESSPCommon.FormName) { case "JobCard": if (vmESSPCommon.StageID == "A") { Message = JobCardESSPService.ApproveJobCard(vmESSPCommon, LoggedInUser, Message); ToasterMessages.Add("Job Card successfully Approved !"); Session["ToasterMessages"] = ToasterMessages; } else { JobCardESSPService.RejectJobCard(vmESSPCommon, LoggedInUser); ToasterMessages.Add("Job card Rejected successfully !"); Session["ToasterMessages"] = ToasterMessages; } break; case "Leave": if (vmESSPCommon.StageID == "D") { LeaveApplicationESSPService.RecommendLeaveApplication(vmESSPCommon, LoggedInUser, Message); ToasterMessages.Add("Leave successfully Approved !"); Session["ToasterMessages"] = ToasterMessages; } else if (vmESSPCommon.StageID == "R") { LeaveApplicationESSPService.RejectLeaveApplication(vmESSPCommon, LoggedInUser); ToasterMessages.Add("Leave Rejected successfully !"); Session["ToasterMessages"] = ToasterMessages; } else if (vmESSPCommon.StageID == "L") { LeaveApplicationESSPService.RevertToLMLeaveApplication(vmESSPCommon, LoggedInUser); ToasterMessages.Add("Leave Reverted successfully !"); Session["ToasterMessages"] = ToasterMessages; } break; } return(Json("OK", JsonRequestBehavior.AllowGet)); }
public ActionResult RecommendAll(int?[] SelectedLvAppIds) { VMLoggedUser LoggedInUser = Session["LoggedInUser"] as VMLoggedUser; string Message = ""; foreach (var item in SelectedLvAppIds) { VMESSPCommon vmESSPCommon = new VMESSPCommon(); vmESSPCommon.PID = item; vmESSPCommon.Comment = ""; Message = ESSPLeaveService.RecommendLeaveApplication(vmESSPCommon, LoggedInUser, Message); } if (Message != "") { ToasterMessages.Add(Message); Session["ToasterMessages"] = ToasterMessages; } return(RedirectToAction("PendingLeaveApplicationIndex")); }