コード例 #1
0
        private void add_admin_Click(object sender, RoutedEventArgs e)
        {
            addadmin a = new addadmin();

            a.Show();
            this.Hide();
        }
コード例 #2
0
ファイル: addadmin.xaml.cs プロジェクト: ojasvajain/SmartBuy
 private void button_Click(object sender, RoutedEventArgs e)
 {
     if ((String.IsNullOrEmpty(password.Password)) || (String.IsNullOrEmpty(password1.Password)) || String.IsNullOrEmpty(name.Text))
     {
         MessageBox.Show("Some field(s) may have been left blank.");
     }
     else
     {
         if (password.Password == password1.Password)
         {
             OracleCommand    cmd  = new OracleCommand("insert into login values('" + name.Text + "','" + password.Password + "','Admin'," + "null)", con);
             OracleDataReader odr1 = cmd.ExecuteReader();
             MessageBox.Show("New Administrator Created.");
             addadmin a = new addadmin();
             this.Hide();
             a.Show();
         }
         else
         {
             MessageBox.Show("Passwords do not match.");
         }
     }
 }