public ActionResult CategoryAddEdit(ContentCategory model) {
Helper.ForceValidation(ModelState, model);
if (ModelState.IsValid) {
ContentCategory item = ContentCategory.Get(model.ContentCategoryID);
if (item == null || (item != null && item.ContentCategoryID == Guid.Empty)) {
item = new ContentCategory();
item.SiteID = SiteID;
item.ContentCategoryID = Guid.NewGuid();
}
item.CategorySlug = model.CategorySlug;
item.CategoryText = model.CategoryText;
item.IsPublic = model.IsPublic;
item.Save();
return RedirectToAction("CategoryAddEdit", new { @id = item.ContentCategoryID });
}
Helper.HandleErrorDict(ModelState);
return View(model);
}