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); }
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); }
partial void UpdateMenu_External(Menu_External instance);
partial void DeleteMenu_External(Menu_External instance);
partial void InsertMenu_External(Menu_External instance);