Beispiel #1
0
        public int CreateMenuExternal(string Name, string Link)
        {
            if (StringUtils.IsNullOrWhiteSpace(Name))
            {
                return(-1);
            }

            var q = from _menu in GetMenuExternals()
                    where _menu.Name == Name
                    select _menu;

            if (q.Count() > 0)
            {
                return(-1);
            }

            Menu_External menu = new Menu_External
            {
                Name = Name,
                Link = Link
            };

            MenusData.Menu_Externals.InsertOnSubmit(menu);
            MenusData.SubmitChanges();

            return(menu.ItemId);
        }
Beispiel #2
0
        public int UpdateMenuExternal(int ItemId, string Name, string Link)
        {
            var q = from _menu in GetMenuExternals()
                    where _menu.Name == Name && _menu.ItemId != ItemId
                    select _menu;

            if (q.Count() > 0)
            {
                return(-1);
            }

            Menu_External menu = MenusData.Menu_Externals.Single(temp => temp.ItemId == ItemId);

            menu.Name = Name;
            menu.Link = Link;

            MenusData.SubmitChanges();

            return(ItemId);
        }
Beispiel #3
0
 partial void UpdateMenu_External(Menu_External instance);
Beispiel #4
0
 partial void DeleteMenu_External(Menu_External instance);
Beispiel #5
0
 partial void InsertMenu_External(Menu_External instance);