private void bookToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            listView1.Visible     = true;
            grpbxBook.Visible     = false;
            grpbxMagazine.Visible = false;
            grpbxMusicCD.Visible  = false;
            listView1.Size        = new Size(706, 265);
            this.Size             = new Size(744, 337);
            listView1.Columns.Clear();
            listView1.Items.Clear();
            listView1.Columns.Add("Id", 100);
            listView1.Columns.Add("Name", 100);
            listView1.Columns.Add("Price", 100);
            listView1.Columns.Add("ISBN Number", 100);
            listView1.Columns.Add("Author", 100);
            listView1.Columns.Add("Publisher", 100);
            listView1.Columns.Add("Page", 100);
            ProductLists books = ProductLists.Createtor();

            for (int i = 0; i < books.Boklist.Count; i++)
            {
                ListViewItem bk = new ListViewItem(books.Boklist[i].printProperties());
                listView1.Items.Add(bk);
            }
        }
Esempio n. 2
0
 private void button1_Click(object sender, EventArgs e)
 {
     try
     {
         Magazine magazine = new Magazine();
         IdCount Cn = IdCount.Creator();
         magazine.Id = Cn.ProductId1;
         magazine.Name = txtNamemagazine.Text;
         magazine.Price = double.Parse(txtPricemagazine.Text);
         magazine.Issue = int.Parse(txtIssuemagazine.Text);
         magazine.Type = txtTypemagazine.Text;
         magazine.quantity = int.Parse(txtQuantityMag.Text);
         Cn.ProductId1 += 1;
         ProductLists Listspro = ProductLists.CreateList();
         Listspro.Magazinelist.Add(magazine);
         txtNamemagazine.Text = "";
         txtPricemagazine.Text = "";
         txtIssuemagazine.Text = "";
         txtTypemagazine.Text = "";
         txtQuantityMag.Text = "";
     }
     catch
     {
         MessageBox.Show("ERROR! Please enter the right values");
     }
  
 }
 private void btnBookAdd_Click(object sender, EventArgs e)
 {
     try
     {
         Book    book = new Book();
         IdCount Cn   = IdCount.Creator();
         book.Id          = Cn.ProductId1;
         book.Name        = txtNamebook.Text;
         book.Price       = double.Parse(txtPriceBook.Text);
         book.ISBNnumber1 = int.Parse(txtISBNnumberbook.Text);
         book.Page        = int.Parse(txtPagebook.Text);
         book.Publisher   = txtPublisherbook.Text;
         book.Author      = txtAuthorbook.Text;
         Cn.ProductId1   += 1;
         ProductLists Listspro = ProductLists.Createtor();
         Listspro.Boklist.Add(book);
         txtNamebook.Text       = "";
         txtPriceBook.Text      = "";
         txtISBNnumberbook.Text = "";
         txtPagebook.Text       = "";
         txtPublisherbook.Text  = "";
         txtAuthorbook.Text     = "";
     }
     catch
     {
         MessageBox.Show("ERROR! Please enter true value");
     }
 }
Esempio n. 4
0
  private void btnMusiccdAdd_Click(object sender, EventArgs e)
  {
      try
      {
          MusicCD musiccd = new MusicCD();
          IdCount Cn = IdCount.Creator();
          musiccd.Id = Cn.ProductId1;
          musiccd.Name = txtnamemusiccd.Text;
          musiccd.Price = double.Parse(txtPricemusiccd.Text);
          musiccd.Singer = txtSingermusiccd.Text;
          musiccd.Type = txtTypemusiccd.Text;
          musiccd.quantity = int.Parse(txtQuantityCD.Text);
          Cn.ProductId1 += 1;
          ProductLists Listspro = ProductLists.CreateList();
          Listspro.MusicCDlist.Add(musiccd);
          txtnamemusiccd.Text = "";
          txtPricemusiccd.Text = "";
          txtSingermusiccd.Text = "";
          txtTypemusiccd.Text = "";
          txtQuantityCD.Text = "";
      }
      catch 
      {
          MessageBox.Show("ERROR! Please enter true value");
      }
 
  }
Esempio n. 5
0
        private void magazineToolStripMenuItem1_Click(object sender, EventArgs e)
        {

            listView1.Visible = true;
            grpbxBook.Visible = false;
            grpbxMagazine.Visible = false;
            grpbxMusicCD.Visible = false;
            grpbxDelete.Visible = false;
            listView1.Size = new Size(504, 265);
            this.Size = new Size(542, 337);
            listView1.Columns.Clear();
            listView1.Items.Clear();
            listView1.Columns.Add("Id", 100);
            listView1.Columns.Add("Name", 100);
            listView1.Columns.Add("Price", 100);
            listView1.Columns.Add("Quantity", 100);
            listView1.Columns.Add("Issue", 100);
            listView1.Columns.Add("Type", 100);
            ProductLists magazines = ProductLists.CreateList();
            for (int i = 0; i < magazines.Magazinelist.Count; i++)
            {
                ListViewItem magazine = new ListViewItem(magazines.Magazinelist[i].printProperties());
                listView1.Items.Add(magazine);
            }
        }
Esempio n. 6
0
 public static ProductLists Createtor()
 {
     if (Lists == null)
     {
         Lists = new ProductLists();
     }
     return(Lists);
 }
 private void btnAdatocart_Click(object sender, EventArgs e)
 {
     try
     {
         if (int.Parse(txtQuantitypro.Text) > 0)
         {
             ProductLists prolis = ProductLists.Createtor();
             if (productdisplaycount == 1)
             {
                 for (int i = 0; i < prolis.Boklist.Count; i++)
                 {
                     if (txtnamepro.Text == prolis.Boklist[i].Name)
                     {
                         myShoppingChart.addProduct(prolis.Boklist[i], int.Parse(txtQuantitypro.Text));
                         break;
                     }
                 }
             }
             if (productdisplaycount == 2)
             {
                 for (int i = 0; i < prolis.MusicCDlist.Count; i++)
                 {
                     if (txtnamepro.Text == prolis.MusicCDlist[i].Name)
                     {
                         myShoppingChart.addProduct(prolis.MusicCDlist[i], int.Parse(txtQuantitypro.Text));
                         break;
                     }
                 }
             }
             if (productdisplaycount == 3)
             {
                 for (int i = 0; i < prolis.Magazinelist.Count; i++)
                 {
                     if (txtnamepro.Text == prolis.Magazinelist[i].Name)
                     {
                         myShoppingChart.addProduct(prolis.Magazinelist[i], int.Parse(txtQuantitypro.Text));
                         break;
                     }
                 }
             }
             txtQuantitypro.Text = "";
             MessageBox.Show("Product have added your cart");
         }
         else
         {
             MessageBox.Show("Enter Positive Quantity");
             txtQuantitypro.Text = "";
         }
     }
     catch
     {
         MessageBox.Show("Please Enter int value to Quantity");
         txtQuantitypro.Text = "";
     }
 }
Esempio n. 8
0
        private void buttonDelete_Click(object sender, EventArgs e)
        {
            string name = cmbBoxDeleteName.Text;
            bool gasit = false;
            ProductLists items = ProductLists.CreateList();
            for (int i = 0; i < items.Booklist.Count; i++)
            {
                gasit = name.Equals(items.Booklist[i].Name);
                if (gasit)
                {
                    items.Booklist.RemoveAt(i);
                    cmbBoxDeleteName.Items.Clear();
                    break;
                }

             }

            for (int i = 0; i < items.MusicCDlist.Count; i++)
            {
                gasit = name.Equals(items.MusicCDlist[i].Name);
                if (gasit)
                {
                    items.MusicCDlist.RemoveAt(i);
                    cmbBoxDeleteName.Items.Clear();
                    break;
                }



            }

            for (int i = 0; i < items.Magazinelist.Count; i++)
            {
                gasit = name.Equals(items.Magazinelist[i].Name);
                if (gasit)
                {
                    items.Magazinelist.RemoveAt(i);
                    cmbBoxDeleteName.Items.Clear();
                    break;
                }



            }
        }
        private void btnListmagazine_Click(object sender, EventArgs e)
        {
            listView1.Visible = true;
            listView1.Columns.Clear();
            listView1.Items.Clear();
            listView1.Columns.Add("Id", 100);
            listView1.Columns.Add("Name", 100);
            listView1.Columns.Add("Price", 100);
            ProductLists magazines = ProductLists.Createtor();

            for (int i = 0; i < magazines.Magazinelist.Count; i++)
            {
                ListViewItem mgzn = new ListViewItem(magazines.Magazinelist[i].printProperties());
                listView1.Items.Add(mgzn);
            }
            productdisplaycount  = 3;
            grpbxdetails.Visible = false;
            txtQuantitypro.Text  = "";
        }
Esempio n. 10
0
        private void btnListbook_Click(object sender, EventArgs e)
        {
            listView1.Visible = true;
            listView1.Columns.Clear();
            listView1.Items.Clear();
            listView1.Columns.Add("Id", 100);
            listView1.Columns.Add("Name", 100);
            listView1.Columns.Add("Price", 100);
            ProductLists books = ProductLists.Createtor();

            for (int i = 0; i < books.Boklist.Count; i++)
            {
                ListViewItem bk = new ListViewItem(books.Boklist[i].printProperties());
                listView1.Items.Add(bk);
            }
            productdisplaycount  = 1;
            grpbxdetails.Visible = false;
            txtQuantitypro.Text  = "";
        }
Esempio n. 11
0
        private void btnListMusicCD_Click(object sender, EventArgs e)
        {
            listView1.Visible = true;
            listView1.Columns.Clear();
            listView1.Items.Clear();
            listView1.Columns.Add("Id", 100);
            listView1.Columns.Add("Name", 100);
            listView1.Columns.Add("Price", 100);
            listView1.Columns.Add("Quantity", 100);
            ProductLists musiccds = ProductLists.CreateList();

            for (int i = 0; i < musiccds.MusicCDlist.Count; i++)
            {
                ListViewItem msccd = new ListViewItem(musiccds.MusicCDlist[i].printProperties());
                listView1.Items.Add(msccd);
            }
            productdisplaycount  = 2;
            grpbxdetails.Visible = false;
            txtQuantitypro.Text  = "";
        }
Esempio n. 12
0
        private void musicCDToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            listView1.Visible     = true;
            grpbxBook.Visible     = false;
            grpbxMagazine.Visible = false;
            grpbxMusicCD.Visible  = false;
            listView1.Size        = new Size(504, 265);
            this.Size             = new Size(542, 337);
            listView1.Columns.Clear();
            listView1.Items.Clear();
            listView1.Columns.Add("Id", 100);
            listView1.Columns.Add("Name", 100);
            listView1.Columns.Add("Price", 100);
            listView1.Columns.Add("Singer", 100);
            listView1.Columns.Add("Type", 100);
            ProductLists musiccds = ProductLists.Createtor();

            for (int i = 0; i < musiccds.MusicCDlist.Count; i++)
            {
                ListViewItem msccd = new ListViewItem(musiccds.MusicCDlist[i].printProperties());
                listView1.Items.Add(msccd);
            }
        }
Esempio n. 13
0
        private void cmbBoxDeleteName_DropDown(object sender, EventArgs e)
        {
            
            ProductLists items = ProductLists.CreateList();
            for (int i = 0; i < items.Booklist.Count; i++)
            {

                cmbBoxDeleteName.Items.Add(items.Booklist[i].Name);

            }
            for (int i = 0; i < items.MusicCDlist.Count; i++)
            {

                cmbBoxDeleteName.Items.Add(items.MusicCDlist[i].Name);

            }
            for (int i = 0; i < items.Magazinelist.Count; i++)
            {

                cmbBoxDeleteName.Items.Add(items.Magazinelist[i].Name);

            }

        }
Esempio n. 14
0
        private void Form1_Load(object sender, EventArgs e)
        {
            grpbxMain.Location    = new Point(0, -6);
            this.Size             = new Size(420, 260);
            grpbxLogin.Visible    = false;
            grpbxSignup.Visible   = false;
            grpbxSupplier.Visible = false;
            IdCount      Cn   = IdCount.Creator();
            CustomerList list = CustomerList.Createtor();
            Customer     cs1  = new Customer();

            cs1.CustomerID1 = Cn.CustumerId1;
            Cn.CustumerId1 += 1;
            cs1.Name1       = "Ali Demir";
            cs1.Address1    = "Eskişehir";
            cs1.Email1      = "*****@*****.**";
            cs1.Username1   = "Ali.26";
            cs1.Password1   = "123456";
            list.Cstmrlist.Add(cs1);
            Customer cs2 = new Customer();

            cs2.CustomerID1 = Cn.CustumerId1;
            Cn.CustumerId1 += 1;
            cs2.Name1       = "Mustafa Aydın";
            cs2.Address1    = "İstanbul";
            cs2.Email1      = "*****@*****.**";
            cs2.Username1   = "M.34";
            cs2.Password1   = "123456";
            list.Cstmrlist.Add(cs2);
            Customer cs3 = new Customer();

            cs3.CustomerID1 = Cn.CustumerId1;
            Cn.CustumerId1 += 1;
            cs3.Name1       = "Zehra Çevik";
            cs3.Address1    = "Antalya";
            cs3.Email1      = "*****@*****.**";
            cs3.Username1   = "Zehra.07";
            cs3.Password1   = "123456";
            list.Cstmrlist.Add(cs3);
            Customer cs4 = new Customer();

            cs4.CustomerID1 = Cn.CustumerId1;
            Cn.CustumerId1 += 1;
            cs4.Name1       = "Ayşe Gök";
            cs4.Address1    = "Zonguldak";
            cs4.Email1      = "*****@*****.**";
            cs4.Username1   = "Ayse_1";
            cs4.Password1   = "123456";
            list.Cstmrlist.Add(cs4);
            Customer cs5 = new Customer();

            cs5.CustomerID1 = Cn.CustumerId1;
            Cn.CustumerId1 += 1;
            cs5.Name1       = "Özge Esen";
            cs5.Address1    = "Ankara";
            cs5.Email1      = "*****@*****.**";
            cs5.Username1   = "Ozge.06";
            cs5.Password1   = "123456";
            list.Cstmrlist.Add(cs5);


            ProductLists Prlist = ProductLists.Createtor();
            Book         bk1    = new Book(Cn.ProductId1, "Tutunamayanlar", 32.68, 78975470, "Oğuz Atay", "İletişim Y.", 724);

            Cn.ProductId1 += 1;
            Prlist.Boklist.Add(bk1);
            Book bk2 = new Book(Cn.ProductId1, "Olasılıksız", 15.6, 97897560, "Adam Fawer", "April Y.", 475);

            Cn.ProductId1 += 1;
            Prlist.Boklist.Add(bk2);
            Book bk3 = new Book(Cn.ProductId1, "Ölü Ozanlar Derneği", 9.88, 97860552, "Nancy H. Kleinbaum", "Bilge Kültür Sanat", 136);

            Cn.ProductId1 += 1;
            Prlist.Boklist.Add(bk3);
            MusicCD ms1 = new MusicCD(Cn.ProductId1, "Red", 10, "Taylor Swift", "Pop");

            Cn.ProductId1 += 1;
            Prlist.MusicCDlist.Add(ms1);
            MusicCD ms2 = new MusicCD(Cn.ProductId1, "Rolling Deep", 12, "Adele", "Caz");

            Cn.ProductId1 += 1;
            Prlist.MusicCDlist.Add(ms2);
            MusicCD ms3 = new MusicCD(Cn.ProductId1, "Every Way That I Can", 15, "Sertab Erener", "pop");

            Cn.ProductId1 += 1;
            Prlist.MusicCDlist.Add(ms3);
            Magazine mg1 = new Magazine(Cn.ProductId1, "4-4-2", 4.3, 54657856, "Sport");

            Cn.ProductId1 += 1;
            Prlist.Magazinelist.Add(mg1);
            Magazine mg2 = new Magazine(Cn.ProductId1, "Otomobil", 5.3, 48567896, "Auto");

            Cn.ProductId1 += 1;
            Prlist.Magazinelist.Add(mg2);
            Magazine mg3 = new Magazine(Cn.ProductId1, "PcMagazine", 6, 85623458, "Technology");

            Cn.ProductId1 += 1;
            Prlist.Magazinelist.Add(mg3);
        }
Esempio n. 15
0
        private void Form1_Load(object sender, EventArgs e)
        {
            grpbxMain.Location    = new Point(0, -6);
            this.Size             = new Size(420, 260);
            grpbxLogin.Visible    = false;
            grpbxSignup.Visible   = false;
            grpbxSupplier.Visible = false;
            IdCount      Cn   = IdCount.Creator();
            CustomerList list = CustomerList.CreateList();
            Customer     cs1  = new Customer();

            cs1.CustomerID1 = Cn.CustumerId1;
            Cn.CustumerId1 += 1;
            cs1.Name1       = "Mihai Andronache";
            cs1.Address1    = "Sector 1 Bucuresti";
            cs1.Email1      = "*****@*****.**";
            cs1.Username1   = "Mihai.26";
            cs1.Password1   = "123456";
            list.Cstmrlist.Add(cs1);
            Customer cs2 = new Customer();

            cs2.CustomerID1 = Cn.CustumerId1;
            Cn.CustumerId1 += 1;
            cs2.Name1       = "Beldea Cornelia";
            cs2.Address1    = "Upstate New York";
            cs2.Email1      = "*****@*****.**";
            cs2.Username1   = "C.34";
            cs2.Password1   = "123456";
            list.Cstmrlist.Add(cs2);
            Customer cs3 = new Customer();

            cs3.CustomerID1 = Cn.CustumerId1;
            Cn.CustumerId1 += 1;
            cs3.Name1       = "Paun Cosmin";
            cs3.Address1    = "Paris,Franta";
            cs3.Email1      = "*****@*****.**";
            cs3.Username1   = "Cosmin.07";
            cs3.Password1   = "123456";
            list.Cstmrlist.Add(cs3);
            Customer cs4 = new Customer();

            cs4.CustomerID1 = Cn.CustumerId1;
            Cn.CustumerId1 += 1;
            cs4.Name1       = "Qui-Gon-Jinn";
            cs4.Address1    = "Spatiu";
            cs4.Email1      = "*****@*****.**";
            cs4.Username1   = "QCJTheBest";
            cs4.Password1   = "123456";
            list.Cstmrlist.Add(cs4);
            Customer cs5 = new Customer();

            cs5.CustomerID1 = Cn.CustumerId1;
            Cn.CustumerId1 += 1;
            cs5.Name1       = "Cristina Ovidiu";
            cs5.Address1    = "Braila,Braila";
            cs5.Email1      = "*****@*****.**";
            cs5.Username1   = "Ovicriss.06";
            cs5.Password1   = "123456";
            list.Cstmrlist.Add(cs5);


            ProductLists Prlist = ProductLists.CreateList();
            Book         bk1    = new Book(Cn.ProductId1, "Cel mai iubit dintre pamanteni", 32.68, 6, 78975470, "Daniel Negreanu", "Humanitas", 724);

            Cn.ProductId1 += 1;
            Prlist.Booklist.Add(bk1);
            Book bk2 = new Book(Cn.ProductId1, "The Dark Forest", 15.6, 12, 97897560, "Adam Fawer", "April Y.", 475);

            Cn.ProductId1 += 1;
            Prlist.Booklist.Add(bk2);
            Book bk3 = new Book(Cn.ProductId1, "Cei Trei Muschetari", 9.88, 14, 97860552, "Gabreil Garcia Marquez", "Editura Universitara", 136);

            Cn.ProductId1 += 1;
            Prlist.Booklist.Add(bk3);
            MusicCD ms1 = new MusicCD(Cn.ProductId1, "Red", 10, 5, "Taylor Swift", "Pop");

            Cn.ProductId1 += 1;
            Prlist.MusicCDlist.Add(ms1);
            MusicCD ms2 = new MusicCD(Cn.ProductId1, "Rolling Deep", 12, 13, "Adele", "Caz");

            Cn.ProductId1 += 1;
            Prlist.MusicCDlist.Add(ms2);
            MusicCD ms3 = new MusicCD(Cn.ProductId1, "Every Way That I Can", 15, 11, "Sertab Erener", "pop");

            Cn.ProductId1 += 1;
            Prlist.MusicCDlist.Add(ms3);
            Magazine mg1 = new Magazine(Cn.ProductId1, "4-4-2", 4.3, 12, 54657856, "Sport");

            Cn.ProductId1 += 1;
            Prlist.Magazinelist.Add(mg1);
            Magazine mg2 = new Magazine(Cn.ProductId1, "Otomobil", 5.3, 4, 48567896, "Auto");

            Cn.ProductId1 += 1;
            Prlist.Magazinelist.Add(mg2);
            Magazine mg3 = new Magazine(Cn.ProductId1, "PcMagazine", 6, 6, 85623458, "Technology");

            Cn.ProductId1 += 1;
            Prlist.Magazinelist.Add(mg3);
        }
Esempio n. 16
0
        private void btnAdatocart_Click(object sender, EventArgs e)
        {
            ProductLists prolis = ProductLists.CreateList();


            try
            {
                if (int.Parse(txtQuantitypro.Text) > 0)
                {
                    if (productdisplaycount == 1)
                    {
                        for (int i = 0; i < prolis.Booklist.Count; i++)
                        {
                            if (txtnamepro.Text == prolis.Booklist[i].Name)
                            {
                                if (checkIfPossible(prolis.Booklist[i].quantity, txtQuantitypro.Text))
                                {
                                    myShoppingChart.addProduct(prolis.Booklist[i], int.Parse(txtQuantitypro.Text));
                                    prolis.Booklist[i].quantity -= int.Parse(txtQuantitypro.Text);
                                    MessageBox.Show("Products have been added your cart");
                                    break;
                                }
                                else
                                {
                                    MessageBox.Show("We don't have that many items");
                                }
                            }
                        }
                    }
                    if (productdisplaycount == 2)
                    {
                        for (int i = 0; i < prolis.MusicCDlist.Count; i++)
                        {
                            if (txtnamepro.Text == prolis.MusicCDlist[i].Name)
                            {
                                if (checkIfPossible(prolis.MusicCDlist[i].quantity, txtQuantitypro.Text))
                                {
                                    myShoppingChart.addProduct(prolis.MusicCDlist[i], int.Parse(txtQuantitypro.Text));
                                    prolis.MusicCDlist[i].quantity -= int.Parse(txtQuantitypro.Text);
                                    MessageBox.Show("Products have been added your cart");
                                    break;
                                }
                            }
                        }
                    }
                    if (productdisplaycount == 3)
                    {
                        for (int i = 0; i < prolis.Magazinelist.Count; i++)
                        {
                            if (txtnamepro.Text == prolis.Magazinelist[i].Name)
                            {
                                if (checkIfPossible(prolis.Magazinelist[i].quantity, txtQuantitypro.Text))
                                {
                                    myShoppingChart.addProduct(prolis.Magazinelist[i], int.Parse(txtQuantitypro.Text));
                                    prolis.Magazinelist[i].quantity -= int.Parse(txtQuantitypro.Text);
                                    MessageBox.Show("Products have been added your cart");
                                    break;
                                }
                            }
                        }
                    }
                    txtQuantitypro.Text = "";
                }
                else
                {
                    MessageBox.Show("Incorrect data");
                    txtQuantitypro.Text = "";
                }
            }
            catch
            {
                MessageBox.Show("Please Enter number value to Quantity");
                txtQuantitypro.Text = "";
            }
        }