Ejemplo n.º 1
0
 private void Confirmbtn_Click(object sender, EventArgs e)
 {
     if (Foodcbb.SelectedItem.ToString() == "Chicken")
     {
         MessageBox.Show(MenuFacade.getInstance().getChicken());
     }
     else if (Foodcbb.SelectedItem.ToString() == "Pork")
     {
         MessageBox.Show(MenuFacade.getInstance().getPork());
     }
     else if (Foodcbb.SelectedItem.ToString() == "Beef")
     {
         MessageBox.Show(MenuFacade.getInstance().getBeef());
     }
     if (Cookcbb.SelectedItem.ToString() == "Grilled")
     {
         CookType Grilled = MenuFactory.getCookType(Cooktypes.Grilled);
         MessageBox.Show(Grilled.OpenCookType());
     }
     else if (Cookcbb.SelectedItem.ToString() == "Fry")
     {
         CookType Fry = MenuFactory.getCookType(Cooktypes.Fry);
         MessageBox.Show(Fry.OpenCookType());
     }
     else
     {
         CookType Boiled = MenuFactory.getCookType(Cooktypes.Boiled);
         MessageBox.Show(Boiled.OpenCookType());
     }
 }
Ejemplo n.º 2
0
 public MenuController()
 {
     _menuFacade         = new MenuFacade();
     _dietInfoFacade     = new DietInfoFacade();
     _menuItemTypeFacade = new MenuItemTypeFacade();
     _imageFacade        = new ImageFacade();
 }
Ejemplo n.º 3
0
 public RestaurantAdminController()
 {
     _restaurantFacade = new RestaurantFacade();
     _companyFacade    = new CompanyFacade();
     _menuFacade       = new MenuFacade();
     _tableFacade      = new TableFacade();
     _imageFacade      = new ImageFacade();
 }
Ejemplo n.º 4
0
        private void apply_btn_Click(object sender, RoutedEventArgs e)
        {
            MenuFacade facade = new MenuFacade();

            if (dataContext.TabControlName.SelectedItem == TabLearnig)
            {
                if (cbTarget.Text == "" && cbAction.Text == "")
                {
                    MessageBox.Show("Выберите действия!", "Ошибка ввода!", MessageBoxButton.OK, MessageBoxImage.Stop);
                    return;
                }
                facade.Run(cbAction.Text.ToLower() + ' ' + cbTarget.Text.ToLower(), dataContext);

                Word.Write();
            }
            else
            {
                if (dataContext.Text != "")
                {
                    facade.Run(dataContext.Text, dataContext);
                }
            }
        }
Ejemplo n.º 5
0
        protected void Permissoes()
        {
            try
            {
                if (Session["PerfilFuncionalidades"] != null)
                {
                    IList <ValueObjectLayer.Modulo> modulos = (IList <ValueObjectLayer.Modulo>)Session["Modulos"];
                    IList <MenuItem> itensMenu = new List <MenuItem>();
                    foreach (ValueObjectLayer.Modulo modulo in modulos)
                    {
                        itensMenu.Add(new MenuItem(modulo.Nome, modulo.Nome, "", modulo.CaminhoPagina));
                    }
                    foreach (MenuItem item in itensMenu)
                    {
                        MenuPrincipal.Items.Add(item);
                    }

                    List <ValueObjectLayer.CarregarPerfil> perfisUsuario = (List <ValueObjectLayer.CarregarPerfil>)Session["PerfilFuncionalidades"];
                    IList <MenuItem> itensMenuFuncionalidades            = new List <MenuItem>();
                    IList <MenuItem> itensMenuFuncionalidadesFilho       = new List <MenuItem>();

                    MenuItem item1      = null;
                    bool     blTemPefil = false;

                    Modulo isModulo = null;
                    foreach (ValueObjectLayer.CarregarPerfil func in perfisUsuario)
                    {
                        if (func._Modulo.Nome.Equals("Estoque"))
                        {
                            blTemPefil = true;
                        }

                        if (func._Permissao.Nome.Equals("Cadastrar") && func._Modulo.Id == 5)
                        {
                            isModulo = new Modulo(5);
                        }
                    }

                    if (blTemPefil)
                    {
                        if (isModulo != null)
                        {
                            IList <ValueObjectLayer.Menu> lstMenu = MenuFacade.RecuperaMenuPorModulo(isModulo);

                            foreach (var menu in lstMenu)
                            {
                                item1 = new MenuItem(menu.Descricao, "", "", menu.CaminhoPagina);

                                IList <SubMenu> lstSubMenu = MenuFacade.RecuperaSubMenuPorMenu(menu);
                                if (lstSubMenu != null)
                                {
                                    if (lstSubMenu.Count > 0)
                                    {
                                        foreach (var submenu in lstSubMenu)
                                        {
                                            item1.ChildItems.Add(new MenuItem(submenu.Descricao, "", "", submenu.CaminhoPagina));
                                        }
                                    }
                                }

                                Menu2.Items.Add(item1);
                            }
                        }
                    }
                    else
                    {
                        Response.Redirect(@"~/Default.aspx");
                    }
                }
                else
                {
                    Response.Redirect(@"~/Default.aspx");
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
 public PaymentController()
 {
     _bookingFacade = new BookingFacade();
     _menuFacade    = new MenuFacade();
     _paymentFacade = new PaymentFacade();
 }
Ejemplo n.º 7
0
 public BookingController()
 {
     _bookingFacade = new BookingFacade();
     _menuFacade    = new MenuFacade();
 }