void initFormOperations()
 {
     dg_AllCategories.Items.Clear();
     foreach (tbl_KitchenInventoryCategory item in KitchenInventoryCategory.getAll())
     {
         dg_AllCategories.Items.Add(item);
     }
     UpdateLayout();
 }
예제 #2
0
        void initFormOperations()
        {
            var allCategories = KitchenInventoryCategory.getAll();

            foreach (tbl_KitchenInventoryCategory item in allCategories)
            {
                cb_Category.ItemsSource       = allCategories;
                cb_Category.DisplayMemberPath = "Name";
                cb_Category.SelectedValuePath = "Id";
            }
        }
        void initFormOperations(int id)
        {
            ki                         = KitchenInventory.getById(id);
            tb_Name.Text               = ki.Name;
            tb_Quantity.Text           = Convert.ToString(ki.Quantity);
            tb_MinimumQuantity.Text    = Convert.ToString(ki.MinimumQuantity);
            tb_PurchasePrice.Text      = Convert.ToString(ki.PurchasePrice);
            dp_ExpiryDate.SelectedDate = ki.ExpiryDate;
            catId                      = (int)ki.KitchenInventoryCategory_Id;
            cb_Category.SelectedValue  = catId;
            UpdateLayout();

            var allCategories = KitchenInventoryCategory.getAll();

            foreach (tbl_KitchenInventoryCategory item in allCategories)
            {
                cb_Category.ItemsSource       = allCategories;
                cb_Category.DisplayMemberPath = "Name";
                cb_Category.SelectedValuePath = "Id";
            }
        }