Example #1
0
        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);
        }
Example #2
0
 partial void DeleteTab(Tab instance);
Example #3
0
 partial void UpdateTab(Tab instance);
Example #4
0
 partial void InsertTab(Tab instance);
Example #5
0
		private void detach_Tabs(Tab entity)
		{
			this.SendPropertyChanging();
			entity.WebPage = null;
		}
Example #6
0
		private void attach_Tabs(Tab entity)
		{
			this.SendPropertyChanging();
			entity.WebPage = this;
		}