public ActionResult Approve(SlsCorporateSalesApproval obj, string newComment) { //According to DB column description: 1=New,2=Approve,3=Pass,4=Reject return UpdateSalesOrderApproval(obj, 2, newComment); }
public ActionResult UpdateSalesOrderApproval(SlsCorporateSalesApproval obj, int action, string newComment) { int userId = Convert.ToInt32(Session["userId"]); Operation objOperation = new Operation { Success = false }; if (ModelState.IsValid) { if (obj.Id == 0) { if ((bool)Session["Add"]) { //Sales Order Approval is created internally during sales order creation. objOperation.Success = false; } else { objOperation.OperationId = -1; } } else { if ((bool)Session["Edit"]) { //According to DB column description: 1=New,2=Approve,3=Pass,4=Reject obj.Event = action; obj.ModifiedBy = userId; obj.ModifiedDate = DateTime.Now.Date; objOperation = _approvalController.UpdateApproval(obj, newComment); } else { objOperation.OperationId = -2; } } } return Json(objOperation, JsonRequestBehavior.DenyGet); }