Exemplo n.º 1
0
 private void frmProductAdd_Load(object sender, EventArgs e)
 {
     keyValues = CategoryDataAccess.GetCategoriesForProduct();
     if (keyValues != null)
     {
         foreach (var item in keyValues)
         {
             cmbCategory.Items.Add(item.Value);
             categoryIds.Add(item.Key);
         }
     }
 }
Exemplo n.º 2
0
 private void ViewCategories()
 {
     keyValues = CategoryDataAccess.GetCategoriesForProduct();
     if (keyValues != null)
     {
         cmbCategory.Items.Add("All");
         foreach (var item in keyValues)
         {
             cmbCategory.Items.Add(item.Value);
             categoryIds.Add(item.Key);
         }
     }
     cmbCategory.SelectedIndex = 0;
 }
Exemplo n.º 3
0
 private void frmProductAdd_Load(object sender, EventArgs e)
 {
     keyValues = CategoryDataAccess.GetCategoriesForProduct();
     if (keyValues != null && cmbCategory.Items.Count < 1)
     {
         foreach (var item in keyValues)
         {
             cmbCategory.Items.Add(item.Value);
             categoryIds.Add(item.Key);
         }
     }
     if (productId > 0)
     {
         btnAdd.Text = "Update";
     }
 }
Exemplo n.º 4
0
        public frmProductAdd(Form frmProduct, int userId, int productId)
        {
            this.frmProduct = frmProduct;
            this.userId     = userId;
            this.productId  = productId;
            InitializeComponent();

            keyValues = CategoryDataAccess.GetCategoriesForProduct();
            if (keyValues != null && cmbCategory.Items.Count < 1)
            {
                foreach (var item in keyValues)
                {
                    cmbCategory.Items.Add(item.Value);
                    categoryIds.Add(item.Key);
                }
            }

            ViewProductInfo();
        }