//Done DVG 07-10-18 private void ResetControls() { cmbID.ItemsSource = null; cmbID2.ItemsSource = null; DeleteTxt(); BsID = 0; SPId = 0; if (Classes.GlobalVar.CreateMFAction) { lblSPId.Visibility = Visibility.Hidden; cmbID.Visibility = Visibility.Hidden; cmbID.IsEnabled = false; DeleteTxt(); if (WorkWithMF_BussinessType.LoadComboBox(ref this.cmbID2)) { this.Close(); } } else { lblSPId.Visibility = Visibility.Visible; cmbID.Visibility = Visibility.Visible; cmbID.IsEnabled = true; if (Supplier_.LoadComboBox(ref this.cmbID)) { this.Close(); } } }
private void btmCreate_Click(object sender, RoutedEventArgs e) { if (!(AllComboBoxFilled())) { Supplier_.Create(SPId, txtName.Text, txtAddress.Text, txtPostal.Text, txtPhone.Text, txtEmail.Text, txtFAX.Text, BsID, GlobalVar.CreateMFAction); ResetControls(); } else { MessageBox.Show("Not All fields were filled.", "Error", MessageBoxButton.OK, MessageBoxImage.Error); } }
private void cmbID_SelectionChanged(object sender, SelectionChangedEventArgs e) { try { SPId = Convert.ToInt32(cmbID.SelectedValue.ToString()); cmbID2.ItemsSource = null; if (WorkWithMF_BussinessType.LoadComboBox(ref this.cmbID2)) { this.Close(); } Supplier_.LoadWindow(SPId, ref txtName, ref txtAddress, ref txtPostal, ref txtPhone, ref txtEmail, ref txtFAX, ref cmbID2, ref BsID); } catch (Exception) { SPId = 0; } }