public ActionResult Add(Tab t) { if (ModelState.IsValid) { DBDataContext db = Utils.DB.GetContext(); db.Tabs.InsertOnSubmit(t); t.Position = db.Tabs.Count() + 1; t.FAQPageID = null; try { db.SubmitChanges(); return RedirectToAction("Index", "Tab"); } catch(Exception ex) { ErrorHandler.Report.Exception(ex, "Tab/Add"); ModelState.AddModelError("", "An unknown error occurred. Please try again in few minutes."); } } ViewData["Title"] = "Add Tab"; ViewData["Action"] = "Add"; return View("Manage", t); }
partial void DeleteTab(Tab instance);
partial void UpdateTab(Tab instance);
partial void InsertTab(Tab instance);
private void detach_Tabs(Tab entity) { this.SendPropertyChanging(); entity.WebPage = null; }
private void attach_Tabs(Tab entity) { this.SendPropertyChanging(); entity.WebPage = this; }