public ActionResult Add(WebPage p) { if (ModelState.IsValid) { DBDataContext db = Utils.DB.GetContext(); db.WebPages.InsertOnSubmit(p); try { db.SubmitChanges(); return RedirectToAction("Index", "WebPage"); } catch (Exception ex) { ErrorHandler.Report.Exception(ex, "WebPage/Add"); ModelState.AddModelError("", "An unknown error occurred. Please try again in few minutes."); } } ViewData["Title"] = "Add Web Page"; ViewData["Action"] = "Add"; return View("Manage", p); }
partial void DeleteWebPage(WebPage instance);
partial void UpdateWebPage(WebPage instance);
partial void InsertWebPage(WebPage instance);
private void detach_WebPages(WebPage entity) { this.SendPropertyChanging(); entity.Template = null; }
private void attach_WebPages(WebPage entity) { this.SendPropertyChanging(); entity.Template = this; }