Exemplo n.º 1
0
        public static void CreateReturnToClientSelectionButton(BoveloBaseForm fromForm)
        {
            Button buttonReturn = new Button();

            buttonReturn.Text     = "Return";
            buttonReturn.Location = new Point(locationReturnX, locationReturnY);
            buttonReturn.Click   += new EventHandler(ButtonReturnToClientSelection_Click);
            fromForm.Controls.Add(buttonReturn);
        }
Exemplo n.º 2
0
        private static void ButtonToCart_Click(object sender, EventArgs e)
        {
            Control        button   = (Control)sender;
            BoveloBaseForm form     = (BoveloBaseForm)button.Parent;
            Cart           cartPage = new Cart(form.user, form.client);

            cartPage.Show();
            form.Close();
        }
Exemplo n.º 3
0
        public static void CreateQuitButton(BoveloBaseForm form)
        {
            Button buttonQuit = new Button();

            buttonQuit.Text     = "Quit";
            buttonQuit.Location = new Point(locationReturnX, locationReturnY + 30);
            buttonQuit.Click   += new EventHandler(ButtonQuit_Click);
            form.Controls.Add(buttonQuit);
        }
Exemplo n.º 4
0
        private static void ButtonLogoutUser_Click(object sender, EventArgs e)
        {
            Control        button    = (Control)sender;
            BoveloBaseForm form      = (BoveloBaseForm)button.Parent;
            UserLoginPage  LoginPage = new UserLoginPage();

            LoginPage.Show();
            form.Close();
        }
Exemplo n.º 5
0
        private static void ButtonClient_Click(object sender, EventArgs e)
        {
            Control              button = (Control)sender;
            BoveloBaseForm       form   = (BoveloBaseForm)button.Parent;
            ClientIdentification clientIdentificationPage = new ClientIdentification(form.user, form.client);

            clientIdentificationPage.Show();
            form.Close();
        }
Exemplo n.º 6
0
        private static void ButtonReturnToStock_Click(object sender, EventArgs e)
        {
            Control        button = (Control)sender;
            BoveloBaseForm form   = (BoveloBaseForm)button.Parent;
            Stock          stock  = new Stock(form.user);

            stock.Show();
            form.Close();
        }
Exemplo n.º 7
0
        private static void ButtonReturnToMenus_Click(object sender, EventArgs e)
        {
            Control            button             = (Control)sender;
            BoveloBaseForm     form               = (BoveloBaseForm)button.Parent;
            MenusSelectionPage menusSelectionPage = new MenusSelectionPage(form.user);

            menusSelectionPage.Show();
            form.Close();
        }
Exemplo n.º 8
0
        public static void CreateLogoutUserButton(BoveloBaseForm form)
        {
            Button buttonLogout = new Button();

            buttonLogout.Text     = "Logout";
            buttonLogout.Location = new Point(locationReturnX, locationReturnY);
            buttonLogout.Click   += new EventHandler(ButtonLogoutUser_Click);
            form.Controls.Add(buttonLogout);
        }
Exemplo n.º 9
0
        public static void CreateHeader(BoveloBaseForm form, Bitmap image, BoveloUser user)
        {
            CreateHeader(form, image);
            Label LabelUserName = new Label();

            LabelUserName.Location = new Point(650, 20);
            LabelUserName.AutoSize = true;
            LabelUserName.Text     = "Logged in as " + user.firstname + " " + user.lastname;
            form.Controls.Add(LabelUserName);
        }
Exemplo n.º 10
0
 private static void ButtonQuit_Click(object sender, EventArgs e)
 {
     if (MessageBox.Show("Exit application?",
                         "Bovélo",
                         MessageBoxButtons.YesNo,
                         MessageBoxIcon.Information) == DialogResult.Yes)
     {
         Control        button = (Control)sender;
         BoveloBaseForm form   = (BoveloBaseForm)button.Parent;
         form.Close();
         Environment.Exit(0);
     }
 }
Exemplo n.º 11
0
        public static void CreateHeader(BoveloBaseForm form, Bitmap image, BoveloUser user, Client client)
        {
            CreateHeader(form, image, user);
            Label LabelClientName = new Label();

            LabelClientName.Location = new Point(650, 50);
            LabelClientName.AutoSize = true;
            if (client != null)
            {
                LabelClientName.Text   = "Client :" + client.name + " " + client.address;
                LabelClientName.Click += new EventHandler(ButtonToCart_Click);
            }
            else
            {
                LabelClientName.Text   = "No client logged, click here to select one.";
                LabelClientName.Click += new EventHandler(ButtonClient_Click);
            }
            form.Controls.Add(LabelClientName);
        }
Exemplo n.º 12
0
 public static void SetBasePageLayout(BoveloBaseForm form)
 {
     form.Location = new Point(100, 100);
     form.Size     = new Size(850, 600);
 }