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