private void fillListView()
        {
            lvSubCategory.Items.Clear();
            var subcat = SubCategoryRepo.retrieve();

            if (subcat.Count > 0)
            {
                for (int i = 0; i < subcat.Count; i++)
                {
                    ListViewItem itm = new ListViewItem(subcat[i].SubCategoryValue);
                    itm.SubItems.Add(subcat[i].SubCategoryId.ToString());
                    lvSubCategory.Items.Add(itm);
                }
            }
        }
        private void pictureBox1_Click(object sender, EventArgs e)
        {
            DialogResult d = MessageBox.Show("Are you sure you want to exit?", "Exit", MessageBoxButtons.YesNo);

            if (d == DialogResult.Yes)
            {
                this.cmbSubCategory.Items.Clear();
                var subcat = SubCategoryRepo.retrieve();
                if (subcat.Count > 0)
                {
                    for (int i = 0; i < subcat.Count; i++)
                    {
                        this.cmbSubCategory.Items.Add(subcat[i].SubCategoryValue.ToString());
                    }
                }
                this.Hide();
            }
        }
Beispiel #3
0
        public void initCombo()
        {
            var unitOfMeasurement = UnitOfMeasurementRepo.retrieve();

            if (unitOfMeasurement.Count > 0)
            {
                foreach (var item in unitOfMeasurement)
                {
                    cmbUnitOfMeasurement.Items.Add(item.UnitOfMeasurementName.ToString());
                }
            }
            var categories = CategoryRepo.retrieve();

            if (categories.Count > 0)
            {
                foreach (var item in categories)
                {
                    cmbCategory.Items.Add(item.CategoryValue);
                }
            }

            var subcategory = SubCategoryRepo.retrieve();

            if (subcategory.Count > 0)
            {
                foreach (var item in subcategory)
                {
                    cmbSubCategory.Items.Add(item.SubCategoryValue);
                }
            }

            var supplier = SupplierRepo.suppliers();

            if (supplier.Count > 0)
            {
                foreach (var item in supplier)
                {
                    cmbSupplier.Items.Add(item.SupplierName);
                }
            }

            var warehouse = WarehouseRepo.retrieve();

            if (warehouse.Count > 0)
            {
                foreach (var item in warehouse)
                {
                    cmbWarehouse.Items.Add(item.WarehouseName);
                }
            }

            var status = StatusRepo.retrieve();

            if (status.Count > 0)
            {
                foreach (var item in status)
                {
                    cmbStatus.Items.Add(item.StatusValue);
                }
            }

            List <SMLIB.Entity.ProductAttribute> attributes = ProductAttributeRepo.retrieve();

            if (attributes.Count > 0)
            {
                foreach (var item in attributes)
                {
                    cmbAttributes.Items.Add(item.AttributeName);
                }
            }

            var store = StoreRepo.retrieve();

            if (store.Count > 0)
            {
                foreach (var item in store)
                {
                    cmbStore.Items.Add(item.StoreName);
                }
            }
        }