Наследование: System.Web.UI.UserControl
Пример #1
0
 public void TestInitialize()
 {
     driver = new ChromeDriver();
     driver.Manage().Window.Maximize();
     driver.Navigate().GoToUrl("http://opencart.abstracta.us/");
     homePage        = new HomePage(driver);
     productListPage = homePage.NavigateToTabletsProductList(driver);
     menuItem        = new MenuItemControl(driver);
 }
Пример #2
0
        public void SetUp()
        {
            driver = new ChromeDriver();

            driver.Manage().Window.Maximize();
            driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(50);
            driver.Navigate().GoToUrl("https://demoblaze.com/");
            var menu = new MenuItemControl(driver);

            contactPage = menu.NavigateToContactPage();
        }
Пример #3
0
        private void menuItemControl_OnEdit(MenuItemControl sender)
        {
            DAL.Menu menu = (DAL.Menu) this.tabControl.SelectedTab.Tag;

            AddFood      addFoodDialog = new AddFood(menu, sender.MenuItem);
            DialogResult dr            = addFoodDialog.ShowDialog();

            if (dr == DialogResult.OK)
            {
                sender.MenuItem = addFoodDialog.MenuItem;
            }
        }
 public void TestInitialize()
 {
     options = new ChromeOptions();
     options.AddArgument("--ignore-ssl-errors=yes");
     options.AddArgument("--ignore-certificate-errors");
     driver = new ChromeDriver(options);
     driver.Manage().Window.Maximize();
     driver.Navigate().GoToUrl("http://opencart.abstracta.us/");
     menuItem        = new MenuItemControl(driver);
     homePage        = new HomePage(driver);
     productListPage = homePage.NavigateToTabletsProductList(driver);
     productListPage.AddToCartFirstProduct(shoppingCartBO);
     shoppingCartPage = menuItem.NavigateToShoppingCart(driver);
 }
Пример #5
0
        public void SetUp()
        {
            driver = new ChromeDriver();

            driver.Manage().Window.Maximize();
            driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(50);
            driver.Navigate().GoToUrl("https://demoblaze.com/");
            var loginPage = new LogInPage(driver);

            loginPage.menuItemControl.NavigateToLogInPage();
            menu = new MenuItemControl(driver);
            loginPage.LogInApplication("*****@*****.**", "testare");
            homePage = new HomePage(driver);
        }
Пример #6
0
        private void LoadData()
        {
            MenuBLL         menuBLL = new MenuBLL();
            List <DAL.Menu> menus   = menuBLL.ListMenu();

            //lsCategory.DataSource = listMenuItem; problem

            this.tabControl.Controls.Clear();
            foreach (DAL.Menu menu in menus)
            {
                var t = new TabPage();
                t.Location = new Point(4, 22);
                //t.Name = menu.Name;
                t.Name    = menu.Name;
                t.Padding = new Padding(3);
                t.Size    = new Size(597, 257);
                t.Font    = new Font("Microsoft Sans Serif", 8.25F, FontStyle.Regular, GraphicsUnit.Point, ((byte)(0)));
                t.Text    = menu.Name;
                t.UseVisualStyleBackColor = true;
                t.AutoScroll = true;
                t.Tag        = menu;
                this.tabControl.Controls.Add(t);

                // add layout
                FlowLayoutPanel flowLayoutPanel = new FlowLayoutPanel();
                flowLayoutPanel.Dock       = DockStyle.Fill;
                flowLayoutPanel.AutoScroll = true;
                t.Controls.Add(flowLayoutPanel);

                // add menu item
                MenuItemBLL menuItemBLL = new MenuItemBLL();
                //List<DAL.MenuItem> menuItems = menuItemBLL.FindByMenuID(menu);
                List <DAL.MenuItem> menuItems = menuItemBLL.FindByMenuID(menu);
                //lsCategory.DataSource = listMenuItem;
                for (int i = 0; i < menuItems.Count; i++)
                {
                    MenuItemControl menuItemControl = new MenuItemControl(menuItems[i], false);
                    menuItemControl.Tag       = i;
                    menuItemControl.OnEdit   += new MenuItemControl.OnEditHandler(this.menuItemControl_OnEdit);
                    menuItemControl.OnDelete += new MenuItemControl.OnDeleteHandler(this.menuItemControl_OnDelete);
                    flowLayoutPanel.Controls.Add(menuItemControl);
                    //menuItemControl.Click += new EventHandler(this.MenuItem_OnClick);
                }
            }
        }
Пример #7
0
        private void MenuItem_OnClick(object sender, EventArgs e)
        {
            MenuItemControl menuItemControl = (MenuItemControl)sender;

            DAL.MenuItem menuItem = menuItemControl.MenuItem;

            List <SelectMenuItemControl> listControls = this.flowLayoutPanelRight.Controls.OfType <SelectMenuItemControl>().ToList();

            try
            {
                SelectMenuItemControl find = listControls.Where(c => c.OrderDetail == null && c.MenuItem.ID == menuItem.ID).Single();
                find.Quantity++;
            }
            catch (Exception)
            {
                this.NewSelectMenuItem(menuItem, 1);
            }

            this.calculateFoodPrice();
        }
Пример #8
0
        private void LoadData()
        {
            this.lbTable.Text = this.getTableName();

            // Get order
            if (this.Tables[0].Status != 0)
            {
                // had created order
                OrderBLL orderBLL = new OrderBLL();
                this.order = orderBLL.GetCurrentOrderByTable(this.Tables[0]);
                if (order != null)
                {
                    foreach (OrderDetail od in this.order.OrderDetails)
                    {
                        this.NewSelectMenuItem(od.MenuItem, (int)od.Quantity, od);
                    }

                    // get order tables
                    this.Tables.Clear();
                    foreach (var od in this.order.OrderTables)
                    {
                        this.Tables.Add(od.Table);
                    }
                    this.lbTable.Text = this.getTableName();

                    this.OldTables = new List <Table>(this.Tables);
                }

                this.txtCustomerName.Text = this.order.CustomerName;

                this.calculateFoodPrice();
                this.calculateDiscount();
                this.Extra = this.order.Extra == null ? 0 : (decimal)this.order.Extra;
                if (this.order.VAT != null)
                {
                    this.VAT = (decimal)this.order.VAT;
                }
            }

            // Load menu
            MenuBLL         menuBLL = new MenuBLL();
            List <DAL.Menu> menus   = menuBLL.ListMenu();

            this.tabControl.Controls.Clear();

            foreach (DAL.Menu menu in menus)
            {
                var t = new TabPage();
                t.Location = new Point(4, 22);
                t.Name     = menu.Name;
                t.Padding  = new Padding(3);
                t.Size     = new Size(597, 257);
                t.Font     = new Font("Microsoft Sans Serif", 8.25F, FontStyle.Regular, GraphicsUnit.Point, ((byte)(0)));
                t.Text     = menu.Name;
                t.UseVisualStyleBackColor = true;
                t.AutoScroll = true;
                this.tabControl.Controls.Add(t);

                // add layout
                FlowLayoutPanel flowLayoutPanel = new FlowLayoutPanel();
                flowLayoutPanel.Dock       = DockStyle.Fill;
                flowLayoutPanel.AutoScroll = true;
                t.Controls.Add(flowLayoutPanel);

                // add menu item
                MenuItemBLL         menuItemBLL = new MenuItemBLL();
                List <DAL.MenuItem> menuItems   = menuItemBLL.FindByMenuID(menu);
                for (int i = 0; i < menuItems.Count; i++)
                {
                    MenuItemControl menuItemControl = new MenuItemControl(menuItems[i]);
                    menuItemControl.Tag = i;
                    flowLayoutPanel.Controls.Add(menuItemControl);
                    menuItemControl.Click += new EventHandler(this.MenuItem_OnClick);
                }
            }

            // Show/Hide bottom buttonBar
            if (this.order == null)
            {
                this.layoutButton.Hide();
                this.tabControl.Height += this.layoutButton.Height;
            }
        }