Example #1
0
        void GuncelleSatilacakListe()
        {
            try
            {
                listView5.Items.Clear();

                foreach (var product in DalProduct.GetProductModels((int)comboBox3.SelectedValue))
                {
                    if (product.Count > 0)
                    {
                        ListViewItem c = new ListViewItem();
                        c.SubItems.Add(product.ProductID.ToString());
                        c.SubItems.Add(product.ProductName);
                        c.SubItems.Add(product.Count.ToString());
                        c.SubItems.Add(product.SalePrice.ToString());
                        c.SubItems.Add(product.Description);
                        listView5.Items.Add(c);
                    }
                }
                if (listView5.Items.Count == 0)
                {
                    MessageBox.Show("Bu kategoride gösterilecek ürün yoktur.", "Hata", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
                else
                {
                    groupBox19.Visible = true;
                }
            }
            catch (Exception)
            {
                MessageBox.Show("Kategori seçmediniz.", "Hata", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }
Example #2
0
        private void GuncelleUrunler()
        {
            try
            {
                listView2.Items.Clear();

                foreach (var product in DalProduct.GetProductModels())
                {
                    ListViewItem c = new ListViewItem();
                    c.SubItems.Add(product.ProductID.ToString());
                    c.SubItems.Add(product.ProductName);
                    c.SubItems.Add(product.Category.CategoryName);
                    c.SubItems.Add(product.PurchasePrice.ToString());
                    c.SubItems.Add(product.SalePrice.ToString());
                    c.SubItems.Add(product.Count.ToString());
                    c.SubItems.Add(product.Description);

                    listView2.Items.Add(c);
                }
            }
            catch (Exception)
            {
            }
        }