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