Exemple #1
0
        private void btnLogout_Click(object sender, EventArgs e)
        {
            this.DialogResult = DialogResult.OK;
            string buttonname = "Logout";

            SaveLog.Savelog(buttonname);
        }
        private void btnBuy_Click(object sender, EventArgs e)
        {
            if (txtAdress.Text == "")
            {
                MessageBox.Show("You cannot complete your shopping without adress!");
            }
            else if (rdbBuKoli.Checked == false && rdbYurtici.Checked == false && rdbUps.Checked == false)
            {
                MessageBox.Show("You must select cargo company.");
            }
            else if (cmbPayment.SelectedIndex == -1)
            {
                MessageBox.Show("You should select payment type");
            }
            else if (cmbPayment.SelectedIndex == 1)
            {
                if (txtCardName.Text == null || txtCardNumber.Text == null || txtCCV.Text == null || cmbCardMonth.SelectedIndex == -1 || cmbCardYear.SelectedIndex == -1)
                {
                    MessageBox.Show("Please, be sure credit card infos write correctly");
                }
            }
            else
            {
                MessageBox.Show("Payment is completed. Thank you for choosing us.");
                Profile profile = new Profile();
                Home.shopCart.ItemsToPurchase.Clear();
                flowLayoutPanel1.Controls.Clear();
                profile.ShowDialog();
                this.Hide();
            }
            string buttonname = "Buy";

            SaveLog.Savelog(buttonname);
        }
Exemple #3
0
        private void btnCart_Click(object sender, EventArgs e)
        {
            cart = new ShoppingCartForm();
            cart.ShowDialog();
            string buttonname = "Cart";

            SaveLog.Savelog(buttonname);
        }
Exemple #4
0
        private void btnProfile_Click(object sender, EventArgs e)
        {
            Profile profile = new Profile();

            profile.ShowDialog();
            string buttonname = "Profile";

            SaveLog.Savelog(buttonname);
        }
Exemple #5
0
        private void btnReturn_Click(object sender, EventArgs e)
        {
            SignIn signin = new SignIn();

            this.Hide();
            signin.Show();
            string buttonname = "Return";

            SaveLog.Savelog(buttonname);
        }
Exemple #6
0
        private void btnDelete(object sender, EventArgs e)
        {
            for (int i = 0; i < int.Parse(txtquantity.Text); i++)
            {
                Home.shopCart.ItemsToPurchase.Remove(item);
            }
            Home.cart.refresh();
            string buttonname = "Delete";

            SaveLog.Savelog(buttonname);
        }
Exemple #7
0
        private void btnSignup_Click(object sender, EventArgs e)
        {
            SignUp sgnup = new SignUp();

            this.Hide();
            sgnup.ShowDialog();
            this.Show();
            string buttonname = "SignUp";

            SaveLog.Savelog(buttonname);
        }
Exemple #8
0
        public void btnIncrease(object sender, EventArgs e)
        {
            item.quantity++;
            float total = (item.product.Price1) * item.quantity;

            lbltotalprice.Text = total.ToString();
            txtquantity.Text   = item.quantity.ToString() + " TL";
            Home.cart.refresh();
            string buttonname = "Increase";

            SaveLog.Savelog(buttonname);
        }
Exemple #9
0
        private void btnBook_Click(object sender, EventArgs e)
        {
            flowLayoutPanel1.Controls.Clear();
            foreach (Book item in allbookrecord)
            {
                BookPanel bookpanel = new BookPanel();
                bookpanel.create(item);
                flowLayoutPanel1.Controls.Add(bookpanel);
            }
            string buttonname = "Book";

            SaveLog.Savelog(buttonname);
        }
Exemple #10
0
        private void btnMusic_Click(object sender, EventArgs e)
        {
            flowLayoutPanel1.Controls.Clear();
            foreach (Music item in allmusicrecord)
            {
                MusicPanel musicpanel = new MusicPanel();
                musicpanel.create(item);
                flowLayoutPanel1.Controls.Add(musicpanel);
            }
            string buttonname = "Music";

            SaveLog.Savelog(buttonname);
        }
Exemple #11
0
        private void btnMagazine_Click(object sender, EventArgs e)
        {
            flowLayoutPanel1.Controls.Clear();
            foreach (Magazine item in allmagazinerecord)
            {
                MagazinePanel magazinepanel = new MagazinePanel();
                magazinepanel.create(item);
                flowLayoutPanel1.Controls.Add(magazinepanel);
            }
            string buttonname = "Magazine";

            SaveLog.Savelog(buttonname);
        }
        private void btnBuy_Click(object sender, EventArgs e)
        {
            if (float.Parse(totalprice()) > 0)
            {
                Payment pay = new Payment();
                this.Hide();
                pay.ShowDialog();
            }
            else
            {
                MessageBox.Show("Shopping cart is empty!");
            }
            string buttonname = "Buy";

            SaveLog.Savelog(buttonname);
        }
        public void btnDecrease(object sender, EventArgs e)
        {
            item.quantity--;
            if (item.quantity < 1)
            {
                item.quantity = 1;
            }
            float total = (item.product.Price1) * item.quantity;

            lbltotalprice.Text = total.ToString();
            txtquantity.Text   = "" + item.quantity;
            Home.cart.refresh();
            string buttonname = "Decrease";

            SaveLog.Savelog(buttonname);
        }
Exemple #14
0
        public void AddCartClick(object sender, EventArgs e)
        {
            foreach (var it in Home.shopCart.ItemsToPurchase)
            {
                if (it.product == book)
                {
                    it.quantity++;
                    return;
                }
            }
            ItemToPurchase item = new ItemToPurchase();

            item.product = book;
            item.quantity++;
            Home.shopCart.ItemsToPurchase.Add(item);
            string buttonname = "AddCartClick";

            SaveLog.Savelog(buttonname);
        }
Exemple #15
0
        public void AddCartClick(object sender, EventArgs e)
        {
            foreach (var it in Home.shopCart.ItemsToPurchase)
            {
                if (it.product == music)
                {
                    it.quantity = 1;
                    return;
                }
            }
            ItemToPurchase item = new ItemToPurchase();

            item.product = music;
            item.quantity++;
            Home.shopCart.ItemsToPurchase.Add(item);
            MessageBox.Show("Added to shoppingcart");
            string buttonname = "MusicAddCart";

            SaveLog.Savelog(buttonname);
        }
Exemple #16
0
        private void btnSignup_Click(object sender, EventArgs e)
        {
            ArrayList allrecord = customerlist.ReadXML();
            bool      flag      = false;

            foreach (Customer csm in allrecord)
            {
                if (txtMail.Text == csm.CustomerEmail1)
                {
                    MessageBox.Show("This email is already used!");
                    flag = true;
                }
            }

            if (txtPassword.Text != txtPassword2.Text)
            {
                MessageBox.Show("Passwords are not matching!");
            }
            else if (chkMA.Checked == false)
            {
                MessageBox.Show("First, you have to accept Membership Agreement.", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }

            else if (txtPassword.Text == txtPassword2.Text && chkMA.Checked == true && flag == false)
            {
                XDocument x = XDocument.Load(@"CustomerList.xml");
                x.Element("ArrayOfCustomer").Add(
                    new XElement("Customer",
                                 new XElement("CustomerName", txtName.Text), new XElement("CustomerLastName", txtLastname.Text),
                                 new XElement("CustomerEmail", txtMail.Text),
                                 new XElement("CustomerPhoneNumber", txtPhone.Text),
                                 new XElement("CustomerPassword", txtPassword.Text)
                                 ));
                x.Save(@"CustomerList.xml");
                MessageBox.Show("Record  is Completed");
            }
            string buttonname = "SignUpCreate";

            SaveLog.Savelog(buttonname);
        }
Exemple #17
0
        private void btnLogin_Click(object sender, EventArgs e)
        {
            ArrayList allrecord = customerlist.ReadXML();
            bool      success   = false;

            foreach (Customer item in allrecord)
            {
                if (txtMail.Text == item.CustomerName1 && txtPassword.Text == item.customerPassword1)
                {
                    success = true;
                    LoginCustomer logincustomer = LoginCustomer.getInstance();
                    logincustomer.customer = item;
                    break;
                }
            }
            if (success == true)
            {
                this.Hide();
                Home         signin = new Home();
                DialogResult dr     = signin.ShowDialog();
                if (dr == DialogResult.OK)
                {
                    this.ShowDialog();
                }
                else
                {
                    Application.Exit();
                }
            }
            else
            {
                MessageBox.Show("E-mail or password is wrong\nTry Again Please!");
            }
            string buttonname = "Login";

            SaveLog.Savelog(buttonname);
        }
Exemple #18
0
        public void ShowDescription(object sender, EventArgs e)
        {
            Description des = new Description();

            PictureBox picture = new PictureBox();

            picture.Size     = new Size(80, 120);
            picture.Image    = book.Image;
            picture.SizeMode = PictureBoxSizeMode.StretchImage;
            picture.Location = new Point(45, 70);
            des.Controls.Add(picture);

            Label lblname = new Label();

            lblname.Text      = book.Name1;
            lblname.Size      = new Size(400, 25);
            lblname.TextAlign = ContentAlignment.MiddleLeft;
            lblname.Font      = new System.Drawing.Font("Arial", 12f, System.Drawing.FontStyle.Bold);
            lblname.Location  = new System.Drawing.Point(42, 20);
            des.Controls.Add(lblname);

            Label lblauthor = new Label();

            lblauthor.Text      = "Author : " + book.BookAuthor1;
            lblauthor.AutoSize  = true;
            lblauthor.Size      = new Size(320, 20);
            lblauthor.TextAlign = ContentAlignment.MiddleLeft;
            lblauthor.Font      = new System.Drawing.Font("Arial", 10f, System.Drawing.FontStyle.Regular);
            lblauthor.Location  = new System.Drawing.Point(150, 90);
            des.Controls.Add(lblauthor);

            Label lblpage = new Label();

            lblpage.Text      = "Page : " + book.BookPageNumber1;
            lblpage.Size      = new Size(320, 20);
            lblpage.TextAlign = ContentAlignment.MiddleLeft;
            lblpage.Font      = new System.Drawing.Font("Arial", 10f, System.Drawing.FontStyle.Regular);
            lblpage.Location  = new System.Drawing.Point(150, 110);
            des.Controls.Add(lblpage);

            Label lblcat = new Label();

            lblcat.Text      = "Category : " + book.Category1;
            lblcat.Size      = new Size(320, 20);
            lblcat.TextAlign = ContentAlignment.MiddleLeft;
            lblcat.Font      = new System.Drawing.Font("Arial", 10f, System.Drawing.FontStyle.Regular);
            lblcat.Location  = new System.Drawing.Point(150, 130);
            des.Controls.Add(lblcat);

            Label lbldes = new Label();

            lbldes.Text     = book.BookDescription1;
            lbldes.Size     = new Size(350, 300);
            lbldes.Font     = new System.Drawing.Font("Arial", 9f, System.Drawing.FontStyle.Regular);
            lbldes.Location = new System.Drawing.Point(40, 220);
            des.Controls.Add(lbldes);
            des.ShowDialog();
            string buttonname = "ShowDescription";

            SaveLog.Savelog(buttonname);
        }