Exemplo n.º 1
0
 partial void DeleteMenu(Menu instance);
Exemplo n.º 2
0
 partial void InsertMenu(Menu instance);
Exemplo n.º 3
0
 partial void UpdateMenu(Menu instance);
Exemplo n.º 4
0
		private void detach_Menus(Menu entity)
		{
			this.SendPropertyChanging();
			entity.MenuType = null;
		}
Exemplo n.º 5
0
		private void attach_Menus(Menu entity)
		{
			this.SendPropertyChanging();
			entity.MenuType = this;
		}
Exemplo n.º 6
0
 public void Insert( Menu menu )
 {
     _db.Menus.InsertOnSubmit( menu );
     Save();
 }
Exemplo n.º 7
0
 public void Delete( Menu menu )
 {
     _db.Menus.DeleteOnSubmit( menu );
     Save();
 }
Exemplo n.º 8
0
        public ActionResult Edit( String[] menuNames, String[] menuUrls )
        {
            try
            {
                // TODO: Add update logic here
                var type = Int32.Parse( Request.Form["type"] );
                var menus = menuRepository.GetMenus( type );
                foreach (var menu in menus)
                    menuRepository.Delete( menu );

                var orderN = 1;
                for (var i = 0; i < menuNames.Count(); i++)
                {
                    if (String.IsNullOrEmpty( menuNames[i] ) || String.IsNullOrEmpty( menuUrls[i] ))
                        continue;

                    var menu = new Menu {order_n = orderN, name = menuNames[i], url = menuUrls[i], type_id = type};
                    menuRepository.Insert( menu );
                    orderN++;
                }
                return RedirectToAction( "Index" );
            }
            catch
            {
                return View();
            }
        }