public void ResetControls() { BsID = 0; CustID = 0; cmbID.ItemsSource = null; cmbID2.ItemsSource = null; DeleteTxt(); 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; Customers_.IsActive = true; } else { lblID.Visibility = Visibility.Visible; cmbID.Visibility = Visibility.Visible; cmbID.IsEnabled = true; if (Customers_.LoadComboBox(ref this.cmbID)) { this.Close(); } } }
private void btmCreate_Click(object sender, RoutedEventArgs e) { if (!(AllComboBoxFilled())) { Customers_.Create(CustID, txtName.Text, txtAddress.Text, txtPostal.Text, txtPhone.Text, txtEmail.Text, txtFAX.Text, BsID, Customers_.IsActive, GlobalVar.CreateMFAction); //IISM.MF_Forms.Customers.Customer_MF OpenW = new IISM.MF_Forms.Customers.Customer_MF(); //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 { CustID = Convert.ToInt32(cmbID.SelectedValue.ToString()); cmbID2.ItemsSource = null; if (WorkWithMF_BussinessType.LoadComboBox(ref this.cmbID2)) { this.Close(); } Customers_.LoadWindow(CustID, ref txtName, ref txtAddress, ref txtPostal, ref txtPhone, ref txtEmail, ref txtFAX, ref cmbID2, ref chkActive, ref BsID); } catch (Exception) { CustID = 0; } }