public ActionResult SaveIssue(Issue user) { int id = 0; StoreService service = new StoreService(); try { if (user.IId > 0) { id = service.UpdateIssue(user); return(Json(new { Status = true, Id = id, Message = "Record updated successfully" }, JsonRequestBehavior.AllowGet)); } else { id = service.AddIssue(user); return(Json(new { Status = true, Id = id, Message = "Record added successfully" }, JsonRequestBehavior.AllowGet)); } } catch (Exception ex) { return(Json(new { Status = false, Message = "Error Occured" }, JsonRequestBehavior.AllowGet)); } }