Beispiel #1
0
        private void foodRemove(Data.Menu food) // 선택한 메뉴 삭제
        {
            var itemSource = lvSelected.ItemsSource as List <Data.Menu>;

            itemSource.Remove(food);
            refreshFood();
        }
Beispiel #2
0
        public async Task <Menu> GetMenuByCaffeId(Guid id)
        {
            Data.Menu menu = null;
            using (var context = CreateLazyPhytonsContext())
            {
                menu = await context.Menus.AsNoTracking().FirstOrDefaultAsync(x => x.CaffeId.Equals(id)).ConfigureAwait(false);
            }

            return(menu?.ToApi());
        }
Beispiel #3
0
        public static Menu DataToEntidad(Data.Menu d)
        {
            Menu m = new Menu()
            {
                Accion      = d.Accion,
                Controlador = d.Controlador,
                ID          = d.MenuID,
                MenuPadre   = d.MenuPadre,
                Orden       = d.Orden.Value,
                Texto       = d.Texto,
                EsGlobal    = d.EsGlobal.Value
            };

            return(m);
        }
Beispiel #4
0
        private void menuList_SelectionChanged(object sender, SelectionChangedEventArgs e) // 메뉴 클릭 시
        {
            int flag = 0;

            if (lbMenus.SelectedIndex == -1)
            {
                return;
            }

            Data.Menu food = (Data.Menu)lbMenus.SelectedItem;

            if (food.soldOut == 0)
            {
                for (int i = 0; i < OrderData.menuList.Count; i++)
                {
                    if (food.name == OrderData.menuList[i].name)
                    {
                        OrderData.menuList[i].count++;
                        flag = 1;
                        break;
                    }
                }

                if (flag == 0)
                {
                    food.count++;

                    OrderData.menuList.Add(food);
                }
            }

            if (food.soldOut == 1) // 품절된 상품일때
            {
                MessageBox.Show("품절된 메뉴입니다.", "안내");
            }

            setTotalPrice();
            totalPrice.Text = OrderData.sumMoney + "원";
            lvSelected.Items.Refresh();
            orderBtn_IsEnbled();

            lbMenus.SelectedIndex = -1;

            lvSelected.ItemsSource = OrderData.menuList;
        }
Beispiel #5
0
        private int SaveMenu(string MenuGUID, int ParentMenuID, string MenuTitle, string MenuType, int RefID, string MenuSlug, int DisplayOrder, DateTime CreatedOn)
        {
            NITASA.Data.Menu menu = new Data.Menu();
            menu.GUID         = MenuGUID;
            menu.ParentMenuID = ParentMenuID;
            menu.Title        = MenuTitle.Length > 40 ? MenuTitle.Substring(0, 39) : MenuTitle;
            menu.Type         = MenuType;
            menu.RefID        = MenuType == "Link" ? 0 : RefID;
            menu.Slug         = MenuType == "Link" ? MenuSlug : "";
            menu.DisplayOrder = DisplayOrder;
            menu.AddedOn      = CreatedOn;
            menu.AddedBy      = Convert.ToInt32(Session["UserID"]);
            menu.IsDeleted    = false;

            context.Menu.Add(menu);
            context.SaveChanges();

            return(menu.ID);
        }
Beispiel #6
0
 public Menu()
 {
     menuData = new Data.Menu();
 }