/// <summary>
        /// Creator: Tener Karar
        /// Created: 2020/02/7
        /// Approver: Steven Cardona
        ///
        /// this event for main window class
        /// desplay the item in the screen item
        /// </summary>
        ///
        /// <remarks>
        /// Updater: Zach Behrensmeyer
        /// Updated: 4/13/2020
        /// Update: Added if item = null logic
        /// </remarks>
        private void btnUpdateItem_Click(object sender, RoutedEventArgs e)
        {
            item = (Item)DGViewDatat.SelectedItem;
            List <int> locations = null;

            if (item != null)
            {
                try
                {
                    locations               = StockManger.getItemLocations(item.ItemID);
                    txtItemID.Text          = item.ItemID.ToString();
                    txtItemName.Text        = item.ItemName;
                    txtItemLocation.Text    = locations[0].ToString();
                    txtNewItemLocation.Text = "";
                    txtItemDescription.Text = item.Description;
                    txtItemCount.Text       = locations.Count.ToString();
                }
                catch (Exception)
                {
                    locations = new List <int>();
                }


                canViewItems.Visibility         = Visibility.Hidden;
                canEditItemsLocation.Visibility = Visibility.Visible;
            }
            else
            {
                WPFErrorHandler.ErrorMessage("No Item Selected. Please select one.");
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Creator: Brandyn T. Coverdill
        /// Created: 2020/03/03
        /// Approver: Dalton Reierson
        /// Approver:  Jesse Tomash
        ///
        /// This method loads the text fields with data when loaded.
        /// </summary>
        ///
        /// <remarks>
        /// Updated By:
        /// Updated:
        /// Update:
        /// </remarks>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Page_Loaded(object sender, RoutedEventArgs e)
        {
            List <int> location = _manageBackstockRecord.getItemLocations(_item.ItemID);

            txtItemCount.Text       = _item.ItemQuantity.ToString();
            txtItemID.Text          = _item.ItemID.ToString();
            txtItemDescription.Text = _item.Description.ToString();
            txtItemName.Text        = _item.ItemName.ToString();
            try
            {
                txtItemLocation.Text = location[0].ToString();
            }
            catch (Exception)
            {
                "There is no location specified yet for this item.".ErrorMessage("Notice");
            }
        }