public ActionResult Create(ValueList valueList) { if (ModelState.IsValid) { valueList = GStoreDb.ValueLists.Create(valueList); valueList.UpdateAuditFields(CurrentUserProfileOrThrow); valueList = GStoreDb.ValueLists.Add(valueList); GStoreDb.SaveChanges(); AddUserMessage("Value List Created", "Value List '" + valueList.Name.ToHtml() + "' [" + valueList.ValueListId + "] Created Successfully", UserMessageType.Success); return RedirectToAction("Index"); } int? clientId = null; if (valueList.ClientId != default(int)) { clientId = valueList.ClientId; } this.BreadCrumbsFunc = htmlHelper => this.ValueListBreadcrumb(htmlHelper, valueList.ClientId, valueList); return View(valueList); }
public ActionResult Edit(ValueList valueList) { if (ModelState.IsValid) { valueList.UpdateAuditFields(CurrentUserProfileOrThrow); valueList = GStoreDb.ValueLists.Update(valueList); GStoreDb.SaveChanges(); AddUserMessage("Value List Updated", "Changes saved successfully to Value List '" + valueList.Name.ToHtml() + "' [" + valueList.ValueListId + "]", UserMessageType.Success); return RedirectToAction("Index"); } this.BreadCrumbsFunc = htmlHelper => this.ValueListBreadcrumb(htmlHelper, valueList.ClientId, valueList); return View(valueList); }