/// <summary> /// Create a new HelpMenu object. /// </summary> /// <param name="menuId">Initial value of the MenuId property.</param> /// <param name="menuName">Initial value of the MenuName property.</param> /// <param name="isVisible">Initial value of the IsVisible property.</param> public static HelpMenu CreateHelpMenu(global::System.Int32 menuId, global::System.String menuName, global::System.Boolean isVisible) { HelpMenu helpMenu = new HelpMenu(); helpMenu.MenuId = menuId; helpMenu.MenuName = menuName; helpMenu.IsVisible = isVisible; return helpMenu; }
public ActionResult MenuNew(HelpMenu hm) { if (ModelState.IsValid) { db.HelpMenus.AddObject(hm); db.SaveChanges(); return RedirectToAction("Index"); } return View(hm); }
/// <summary> /// Deprecated Method for adding a new object to the HelpMenus EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToHelpMenus(HelpMenu helpMenu) { base.AddObject("HelpMenus", helpMenu); }
public ActionResult MenuEdit(HelpMenu hm, int id) { if (ModelState.IsValid) { db.HelpMenus.Attach(hm); db.ObjectStateManager.ChangeObjectState(hm, System.Data.EntityState.Modified); db.SaveChanges(); return RedirectToAction("Index"); } return View(hm); }