Inheritance: System.Data.Objects.DataClasses.EntityObject
Esempio n. 1
0
        public ActionResult Create(FormCollection collection)
        {
            Menu menu = new Menu();
            MembershipUser user = Membership.GetUser();
            Vendor vendor = vendorsRepository.GetVendorByUserId((Guid)user.ProviderUserKey);
            menu.VendorId = vendor.VendorId;
            menu.MenuId = System.Guid.NewGuid();

            if (TryUpdateModel(menu))
            {
                menusRepository.add(menu);
                menusRepository.save();
                return RedirectToAction("index");
            }

            return RedirectToAction("Index");
        }
Esempio n. 2
0
 public void delete(Menu menu)
 {
     entities.Menus.DeleteObject(menu);
 }
Esempio n. 3
0
 /// <summary>
 /// Deprecated Method for adding a new object to the Menus EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToMenus(Menu menu)
 {
     base.AddObject("Menus", menu);
 }
Esempio n. 4
0
 public void add(Menu menu)
 {
     entities.Menus.AddObject(menu);
 }
Esempio n. 5
0
 /// <summary>
 /// Create a new Menu object.
 /// </summary>
 /// <param name="menuId">Initial value of the MenuId property.</param>
 /// <param name="vendorId">Initial value of the VendorId property.</param>
 public static Menu CreateMenu(global::System.Guid menuId, global::System.Guid vendorId)
 {
     Menu menu = new Menu();
     menu.MenuId = menuId;
     menu.VendorId = vendorId;
     return menu;
 }