public ActionResult Create(FormCollection collection) { var model = new Channel(); this.TryUpdateModel<Channel>(model); this.CmsService.SaveChannel(model); return this.RefreshParent(); }
public void SaveChannel(Channel channel) { using (var dbContext = new CmsDbContext()) { if (channel.ID > 0) { dbContext.Update<Channel>(channel); } else { dbContext.Insert<Channel>(channel); } } }
// // GET: /Cms/Channel/Create public ActionResult Create() { var model = new Channel() { IsActive = true }; return View("Edit", model); }