Beispiel #1
0
        //Moving through the shop
        private void ClickEvents(object sender, EventArgs e)
        {
            try
            {
                Button sendingBox = (Button)sender;

                switch (sendingBox.Name)
                {
                case "EnterShop":
                    change = 1;
                    ChangeBackground(change);
                    checkb = true;

                    LeftArrow.Visible     = true;
                    RightArrow.Visible    = true;
                    ReturnArrow.Visible   = true;
                    EnterShop.Visible     = false;
                    ExitShop.Visible      = false;
                    Cart.Visible          = true;
                    label1.Visible        = true;
                    label2.Visible        = true;
                    Buynow.Visible        = true;
                    RecycleButton.Visible = true;
                    Tshirt.Visible        = false;
                    Jeans.Visible         = false;
                    Accessories.Visible   = true;
                    break;

                case "ExitShop":
                    if (label3.Text.Contains("admin"))
                    {
                        MessageBox.Show("Goodbye admin!");
                    }
                    else
                    {
                        MessageBox.Show("Thanks " + label3.Text + "" + Environment.NewLine + " for shopping at us!");
                    }

                    this.Close();
                    LoginDesign objOtherLogin = new LoginDesign();
                    objOtherLogin.Show();
                    //Application.Exit();
                    break;

                case "LeftArrow":
                    if (checkb == true)
                    {
                        checkb = false;
                        ChangeBackground(left);
                        LeftArrow.Visible   = false;
                        Jeans.Visible       = true;
                        Accessories.Visible = false;
                    }
                    else
                    {
                        ChangeBackground(change);
                        RightArrow.Visible  = true;
                        Tshirt.Visible      = false;
                        Jeans.Visible       = false;
                        Accessories.Visible = true;
                        checkb = true;
                    }
                    break;

                case "RightArrow":
                    if (checkb == true)
                    {
                        checkb = false;
                        ChangeBackground(right);
                        RightArrow.Visible  = false;
                        Tshirt.Visible      = true;
                        Accessories.Visible = false;
                    }
                    else
                    {
                        checkb = true;
                        ChangeBackground(change);
                        LeftArrow.Visible   = true;
                        Tshirt.Visible      = false;
                        Jeans.Visible       = false;
                        Accessories.Visible = true;
                        checkb = true;
                    }
                    break;

                case "ReturnArrow":
                    change = 0;
                    ChangeBackground(change);

                    #region What is/not visible

                    //***Enter/Exit shop
                    EnterShop.Visible = true;
                    ExitShop.Visible  = true;

                    //***Arrows
                    LeftArrow.Visible   = false;
                    RightArrow.Visible  = false;
                    ReturnArrow.Visible = false;
                    //***Cart
                    Cart.Visible          = false;
                    label1.Visible        = false;
                    label2.Visible        = false;
                    RecycleButton.Visible = false;
                    Buynow.Visible        = false;
                    //***Products
                    Tshirt.Visible      = false;
                    Jeans.Visible       = false;
                    Accessories.Visible = false;

                    #endregion

                    TheClasses.EntityProducts._totalofitems = 0;
                    TheClasses.EntityProducts._totalofprice = 0;
                    cart(TheClasses.EntityProducts._totalofitems.ToString() + " $", TheClasses.EntityProducts._totalofprice.ToString() + " Items");
                    break;

                case "RecycleButton":
                    TheClasses.EntityProducts._totalofitems = 0;
                    TheClasses.EntityProducts._totalofprice = 0;
                    cart(TheClasses.EntityProducts._totalofitems.ToString() + " $", TheClasses.EntityProducts._totalofprice.ToString() + " Items");
                    break;

                case "Jeans":
                    JeansDesign objJeansDesign = new JeansDesign(this, label1.Text, label2.Text);
                    objJeansDesign.Show();
                    enabledisable(2, 0);
                    break;

                case "Tshirt":
                    TshirtsDesign objTshirtsDesign = new TshirtsDesign(this, label1.Text, label2.Text);
                    objTshirtsDesign.Show();
                    enabledisable(3, 0);
                    break;

                case "Accessories":
                    AccessoriesDesign objAccessoriesDesign = new AccessoriesDesign(this, label1.Text, label2.Text);
                    objAccessoriesDesign.Show();
                    enabledisable(1, 0);
                    break;

                case "Buynow":
                    if (label3.Text.Contains("admin"))
                    {
                        throw new Exception("Admin cannot place an order!");
                    }

                    if (TheClasses.EntityProducts._totalofitems == 0)
                    {
                        MessageBox.Show("You cannot place an order! " + Environment.NewLine + " There are no items in your Cart!");
                    }
                    else
                    {
                        OrderDesign objOrderDesign = new OrderDesign(this);
                        objOrderDesign.Show();
                    }
                    break;

                case "DetailsButton":
                    DetailsDesign objDetailsDesign = new DetailsDesign(this);
                    objDetailsDesign.Show();
                    enabledisable(4, 0);
                    break;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message.ToString());
            }
        }
Beispiel #2
0
 public Password(LoginDesign incomingForm)
 {
     originalForm = incomingForm;
     InitializeComponent();
 }
 public SignUpDesign(LoginDesign incomingForm)
 {
     originalForm = incomingForm;
     InitializeComponent();
 }