public ActionResult Create(ItemCategory ctrg) { if (ModelState.IsValid) { item.Insert(ctrg); } return(View()); }
public async Task <JsonResult> Insert() { try { var id = Guid.NewGuid(); var Name = Request.Form["name"].ToString(); if (ItemCategoryService.Insert(id, Name)) { return(Success(id.ToString())); } return(Failed(MessageUtility.ServerError())); } catch { return(Failed(MessageUtility.ServerError())); } }
public ActionResult Create(ItemCategory item) { if (ModelState.IsValid) { } var isAdded = data.Insert(item) > 0; if (isAdded) { return(View(item)); } return(View()); }