public async Task <JsonResult> GetByID(string id, string api) { try { var data = IS_ItemCategoryService.GetByID(Guid.Parse(id), Guid.Parse(api)); return(Success(IS_ItemCategoryVM.MToVM(data))); } catch { return(Failed(MessageUtility.ServerError())); } }
public async Task <JsonResult> Remove() { try { var id = Guid.Parse(Request.Form["id"]); var api = Guid.Parse(Request.Form["api"]); if (IS_ItemCategoryService.Remove(id, api)) { return(Success("")); } return(Failed(MessageUtility.ServerError())); } catch { return(Failed(MessageUtility.ServerError())); } }
public async Task <JsonResult> Insert() { try { var id = Guid.NewGuid(); var name = Request.Form["name"]; var api = Guid.Parse(Request.Form["api"]); if (IS_ItemCategoryService.Insert(id, name, api)) { return(Success(id.ToString())); } return(Failed(MessageUtility.ServerError())); } catch { return(Failed(MessageUtility.ServerError())); } }