/// <summary> /// Michael Takrama /// Created: 2017/02/10 /// /// Saves User Input To DB /// /// Updated by Mason Allen /// Updated on 5/2/17 /// Method now creates a product category record for new product upon creation /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnSave_Click(object sender, RoutedEventArgs e) { if (1 == ValidateInput()) { return; } GetUserInput(); int productId; try { productId = _productManager.CreateProductReturnProductId(_product); if (productId > 0) { try { _productCategoryManager.CreateProductCategoryRecord(productId, ((Category)cboCategory.SelectedItem).CategoryID.ToString()); MessageBox.Show("Product Created Successfully"); } catch (Exception ex) { MessageBox.Show(ex.ToString()); } this.Close(); } } catch (Exception ex) { MessageBox.Show(ex.Message); } }