상속: System.Data.Objects.DataClasses.EntityObject
예제 #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");
        }
예제 #2
0
 public void delete(Menu menu)
 {
     entities.Menus.DeleteObject(menu);
 }
예제 #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);
 }
예제 #4
0
 public void add(Menu menu)
 {
     entities.Menus.AddObject(menu);
 }
예제 #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;
 }