private void buttonFindEmployee_Click(object sender, RoutedEventArgs e) { int proID = Convert.ToInt32(textBlockProductIDEditOrderDetailedInformationWindow.Text.ToString()); Product thisProduct = (from tp in jackyDigitalXDBEntities.Products where tp.ProductID == proID select tp).FirstOrDefault(); int currentStocks = thisProduct.UnitsInStock; if (currentStocks >= Convert.ToInt32(textBoxQuantityEditDetailedOrderInformationWindow.Text)) { SearchEmployee searchEmployee = new SearchEmployee(); searchEmployee.ShowDialog(); if (searchEmployee.IsSelected == true) { Packaged = true; textBlockEmployeeIDEditOrderDetailedInformationWindow_Copy.Text = Convert.ToString(searchEmployee.Employee.EmployeeID); } if (textBlockEmployeeIDEditOrderDetailedInformationWindow_Copy.Text != null && textBlockEmployeeIDEditOrderDetailedInformationWindow_Copy.Text != "") { textBlockPackaged.Visibility = Visibility.Visible; textBlockUnpackaged.Visibility = Visibility.Collapsed; } else { textBlockUnpackaged.Visibility = Visibility.Visible; textBlockPackaged.Visibility = Visibility.Collapsed; } } else { MessageBox.Show("This order cannot be Packaged because the unit in stock is NOT sufficient."); } }
private void buttonFindEmployee_Click(object sender, RoutedEventArgs e) { SearchEmployee searchEmployee = new SearchEmployee(); searchEmployee.ShowDialog(); if (searchEmployee.IsSelected == true) { textBlockEmployeeIDAddOrderDetailedInformationWindow_Copy.Text = Convert.ToString(searchEmployee.Employee.EmployeeID); Packaged = true; } if (textBlockEmployeeIDAddOrderDetailedInformationWindow_Copy.Text != null && textBlockEmployeeIDAddOrderDetailedInformationWindow_Copy.Text != "") { textBlockPackaged.Visibility = Visibility.Visible; textBlockUnpackaged.Visibility = Visibility.Collapsed; } else { textBlockUnpackaged.Visibility = Visibility.Visible; textBlockPackaged.Visibility = Visibility.Collapsed; } }