Example #1
0
        private void cmbUnitOfMeasurement_SelectedIndexChanged(object sender, EventArgs e)
        {
            Guid id = UnitOfMeasurementRepo.retrieveId(cmbUnitOfMeasurement.Text);

            if (id != null)
            {
                this.unitOfMeasurementId = id;
            }
        }
Example #2
0
 private void AddProduct_Load(object sender, EventArgs e)
 {
     try
     {
         Guid categoryId = CategoryRepo.getCategoryId(cmbCategory.Text);
         if (categoryId != null)
         {
             this.CategoryId = categoryId;
         }
         Guid SubcategoryId = SubCategoryRepo.getSubCategoryId(cmbSubCategory.Text);
         if (SubcategoryId != null)
         {
             this.subcategory = SubcategoryId;
         }
         Guid SupplierId = SupplierRepo.getSupplierId(cmbSupplier.Text);
         if (SupplierId != null)
         {
             this.supplier = SupplierId;
         }
         Guid WarehouseId = WarehouseRepo.getWarehouseId(cmbWarehouse.Text);
         if (WarehouseId != null)
         {
             this.warehouse = WarehouseId;
         }
         Guid statusId = StatusRepo.getStatusId(cmbStatus.Text);
         if (statusId != null)
         {
             this.status = statusId;
         }
         Guid StoreId = StoreRepo.getStoreId(cmbStore.Text);
         if (StoreId != null)
         {
             this.store = StoreId;
         }
         Guid id = UnitOfMeasurementRepo.retrieveId(cmbUnitOfMeasurement.Text);
         if (id != null)
         {
             this.unitOfMeasurementId = id;
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
Example #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);
                }
            }
        }