private void comboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            string          value = comboBox.SelectedItem.ToString();
            ProductLocation x     = ProductLocation.Get(value);

            Console.WriteLine(x.Product_Quantity);

            if (x.Product_Code == "Empty")
            {
                listBox.Items.Clear();
                listBox.Items.Add("Product location : " + x.Product_Location);
                listBox.Items.Add("Product Code     : " + x.Product_Code);
                listBox.Items.Add("Product Quantity : " + (x.Product_Quantity));

                textBox.IsEnabled = false;
                button2.IsEnabled = false;
            }
            else
            {
                Inventory item = Inventory.Get(value);

                listBox.Items.Clear();
                listBox.Items.Add("Product : " + item.Product);
                listBox.Items.Add("Product Code : " + item.Product_Code);
                listBox.Items.Add("On Hand : " + item.On_Hand);
                listBox.Items.Add("On Order : " + item.On_Order);
                listBox.Items.Add("Reorder Level : " + item.Reorder_Level);
                listBox.Items.Add("Reorder Quantity : " + item.Reorder_Quantity);


                textBox.IsEnabled = true;
                button2.IsEnabled = true;
            }
        }
示例#2
0
    public static void RemoveItemAtLocation(string Locations_Id)
    {
        ProductLocation item = ProductLocation.Get(Locations_Id);

        item.Product_Code = "Empty";

        item.Save();
    }
示例#3
0
    /// <summary>
    /// Function to update the quantity of the item at the location
    /// </summary>
    /// <param name="Locations_Id"></param>
    /// <param name="Product_Quantity"></param>
    public static void UpdateQuantity(string Locations_Id, int Product_Quantity)
    {
        ProductLocation item = ProductLocation.Get(Locations_Id);

        item.Product_Quantity = Product_Quantity;

        item.Save();
    }
示例#4
0
    /// <summary>
    /// Function to update what item is at a specific location
    /// </summary>
    /// <param name="Locations_Id">value to find the location in the database</param>
    /// <param name="Product_Code">new value for the item at the location</param>
    /// <param name="Product_Quantity">Quantity of the new item at the location</param>
    public static void ChangeItemAtLocation(string Locations_Id, string Product_Code, int Product_Quantity)
    {
        ProductLocation item = ProductLocation.Get(Locations_Id);

        item.Product_Code     = Product_Code;
        item.Product_Quantity = Product_Quantity;

        item.Save();
    }