public ActionResult UpdateCategory(ProductCategoryViewModel model) { try { var category = model.ToEntity(); GenericFactory.Business.UpdateCategory(category); return(Json("")); } catch (Exception ex) { var msg = ex.Message; } return(Json(null)); }
public JsonResult CreateCategory(ProductCategoryViewModel model) { try { model.Id = Guid.NewGuid().ToString(); var category = model.ToEntity(); GenericFactory.Business.CreateCategory(category); return(Json("")); } catch (Exception ex) { var msg = ex.Message; } return(Json(null)); }