private void Button_Click(object sender, RoutedEventArgs e)
        {
            int itemId = Convert.ToInt32(((Button)sender).Tag);
            //get item by above Id then add it to bill
            InventoryManager manager = new InventoryManager();
            Inventory item = manager.GetItem(itemId);
            if(item != null)
            {
                //Add it to bill(trnsaction table)

            }
        }        
 private void btnSave_Click(object sender, RoutedEventArgs e)
 {
     //validate input before using validator class
     //Add new inventory by invoking a method in inventory manager
     if(lblNameError.IsVisible || lblManufacturerError.IsVisible||lblExpiryDateError.IsVisible || lblMRPError.IsVisible||lblCostPriceError.IsVisible||lblQuantityError.IsVisible)
     {
         //Show a message to correct the imput informationn before saving a inventory item
     }
     else
     {
         Inventory newItem = new Inventory
         {
             Name = txtName.Text,
             Manufacturer = txtManufacturer.Text,
             ExpiryDate = Convert.ToDateTime(txtExpiryDate.Text),
             MRP = Convert.ToDecimal(txtMRP.Text),
             CostPrice = Convert.ToDecimal(txtCostPrice.Text),
             PurchaseDate = DateTime.Now,
             Quantity = Convert.ToInt32(txtQuantity.Text),
             Description = txtDescription.Text
         };
         InventoryManager manager = new InventoryManager();
         manager.AddItem(newItem);
         ClearinventoryTextBoxes();
         LoadlvFullinventory();
     }
 }
 private void txtMedicineName_TextChanged(object sender, TextChangedEventArgs e)
 {
     //we can skip the item load if the character count is in multiplles of three
     //use new thread to load the data and try to implement loading progress.
     //call method in inventory manager to get Items by name
     if(!string.IsNullOrEmpty(txtMedicineName.Text))
     {
         InventoryManager manager = new InventoryManager();
         lvMedicines.ItemsSource = manager.GetAllItemsByName(txtMedicineName.Text);                              
     }               
 }
 private void LoadlvFullinventory()
 {
     InventoryManager manager = new InventoryManager();
     lvFullinventory.ItemsSource = manager.GetAllItems();
 }