private void ResetControls() { DeleteTxt(); BsID = 0; CorpID = 0; cmbID.ItemsSource = null; cmbID2.ItemsSource = null; if (Classes.GlobalVar.CreateMFAction) { lblID.Visibility = Visibility.Hidden; cmbID.Visibility = Visibility.Hidden; cmbID.IsEnabled = false; DeleteTxt(); if (WorkWithMF_BussinessType.LoadComboBox(ref this.cmbID2)) { this.Close(); } this.chkActive.IsChecked = true; Corporation_.IsActive = true; } else { lblID.Visibility = Visibility.Visible; cmbID.Visibility = Visibility.Visible; cmbID.IsEnabled = true; if (Corporation_.LoadComboBox(ref this.cmbID)) { this.Close(); } } }
private void btmCreate_Click(object sender, RoutedEventArgs e) { if (!(AllComboBoxFilled())) { Corporation_.Create(CorpID, txtName.Text, txtAddress.Text, txtPostal.Text, txtPhone.Text, txtEmail.Text, txtFAX.Text, BsID, Corporation_.IsActive, GlobalVar.CreateMFAction); //IISM.MF_Forms.Corporation.Corp_Create OpenW = new IISM.MF_Forms.Corporation.Corp_Create(); //OpenW.Show(); //this.Close(); ResetControls(); } else { MessageBox.Show("Not All fields were filled.", "Error", MessageBoxButton.OK, MessageBoxImage.Error); } }
private void cmbID_SelectionChanged(object sender, SelectionChangedEventArgs e) { try { CorpID = Convert.ToInt32(cmbID.SelectedValue.ToString()); cmbID2.ItemsSource = null; if (WorkWithMF_BussinessType.LoadComboBox(ref this.cmbID2)) { this.Close(); } Corporation_.LoadWindow(CorpID, ref txtName, ref txtAddress, ref txtPostal, ref txtPhone, ref txtEmail, ref txtFAX, ref cmbID2, ref chkActive, ref BsID); } catch (Exception) { CorpID = 0; } }