public ActionResult Save(StoreInventory si) { bool success = false; string message = ""; if (si.status == 0) { if (si.AddInventory()) { success = true; message = "Item Added Successfully"; } else { success = false; message = "Item Adding Failed Details Might be duplicated"; } } else { if (si.UpdateInvenory()) { success = true; message = "Item Updated Successfully"; } else { success = false; message = "Item Updation Failed Details Might be duplicated"; } } return(Json(new { success = success, message = message }, JsonRequestBehavior.AllowGet)); }