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);
        }
        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();
        }
        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);
        }
        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();
        }
        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();
        }
        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();
        }
        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();
        }
        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);
        }
        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);
        }
示例#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);
     }
 }
示例#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);
        }
示例#12
0
 public static void SetBasePageLayout(BoveloBaseForm form)
 {
     form.Location = new Point(100, 100);
     form.Size     = new Size(850, 600);
 }