public ActionResult SaveGRNItem(GRNItemList product) { int id = 0; StoreService service = new StoreService(); try { if (product.GIId > 0) { id = service.UpdateGRNItem(product); return(Json(new { Status = true, Id = id, Message = "Record updated successfully" }, JsonRequestBehavior.AllowGet)); } else { id = service.AddGRNItem(product); 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)); } }