Exemple #1
0
        private void btReg_Click(object sender, RoutedEventArgs e)
        {
            List <TextBox> tb = new List <TextBox>()
            {
                tbFam, tbIm, tbOtch, tbdate_Rojd, tbSer_Pas, tbNum_Pas, tbLogin
            };
            ArrayList field = new ArrayList()
            {
                DBNull.Value
            };
            Procedure_CLass procedureCLass = new Procedure_CLass();

            foreach (TextBox textBox in tb)
            {
                field.Add(textBox.Text);
            }
            HashClass hashClass = new HashClass();

            if (tbPassword.Password == tbConfPassword.Password)
            {
                field.Add(hashClass.HashPassword(tbPassword.Password));
            }
            else
            {
                MessageBox.Show("Не совпадают пароли!!!", "ИНЖПРОМТОРГ", MessageBoxButton.OK, MessageBoxImage.Warning);
                return;
            }

            field.Add(DBNull.Value);
            field.Add(DBNull.Value);

            procedureCLass.procedure_Execution("Sotrudniki_IU", field);

            MainWindow mainWindow = new MainWindow();

            mainWindow.Show();
            Visibility = Visibility.Collapsed;
        }