Exemple #1
0
        private void LoadExistingData()
        {
            InventoryItemBLL aInventoryItemBll=new InventoryItemBLL();
            InventoryItem aInventoryItem=new InventoryItem();
            aInventoryItem = aInventoryItemBll.GetInventoryItem(itemId);
            itemNametextBox.Text = aInventoryItem.ItemName;

            int index = SelectedIndesForFoodType(aInventoryItem.CategoryId, categoryNamecomboBox);
            categoryNamecomboBox.SelectedIndex = index;

            index = SelectedIndesForItemUnit(aInventoryItem.UnitName, unitNamecomboBox);
            unitNamecomboBox.SelectedIndex = index;
        }
Exemple #2
0
 private void updatebutton_Click(object sender, EventArgs e)
 {
     if(ValidForm())
     {
         InventoryItem aInventoryItem=new InventoryItem();
         InventoryItemBLL aInventoryItemBll=new InventoryItemBLL();
         aInventoryItem.ItemId = itemId;
         aInventoryItem.CategoryId = Convert.ToInt32(categoryNamecomboBox.SelectedValue);
         aInventoryItem.CategoryName = categoryNamecomboBox.Text;
         aInventoryItem.ItemName = itemNametextBox.Text;
         aInventoryItem.UnitName = unitNamecomboBox.Text;
         string result = aInventoryItemBll.UpdateItem(aInventoryItem);
         updatestatuslabel.Visible = true;
         updatestatuslabel.Text = result;
     }
 }