コード例 #1
0
ファイル: Create.aspx.cs プロジェクト: sparklingese/proyecto
 protected void Unnamed1_Click(object sender, EventArgs e)
 {
     if (txtUser.Text.Trim() != "" && txtContra.Text.Trim() != "" && txtConfirm.Text.Trim() != "" && txtName.Text.Trim() != "" && dxtGenero.Text.Trim() != "" && dxtCargo.Text.Trim() != "")
     {
         if (txtContra.Text == txtConfirm.Text)
         {
             string name;
             string user;
             string encriptada;
             string gender;
             string position;
             name       = txtName.Text;
             user       = txtUser.Text;
             encriptada = EncryptString(txtContra.Text, initVector);
             gender     = dxtGenero.Text;
             position   = dxtCargo.Text;
             if (Conection.RepeatUsers(user, encriptada, name, gender, position) == 0)
             {
                 alert.Text      = "<script>Swal.fire('Successfully registered', 'You've registered satisfactorily!', 'success');</script>";
                 txtName.Text    = "";
                 txtUser.Text    = "";
                 txtContra.Text  = "";
                 txtConfirm.Text = "";
                 dxtGenero.Text  = "";
                 dxtCargo.Text   = "";
             }
             else
             {
                 alert.Text = "<script>Swal.fire('This user already exists', 'Choose new user name', 'error');</script>";
             }
         }
         else
         {
             alert.Text = "<script>Swal.fire('Wrong password', 'Repeat your password.', 'error');</script>";
         }
     }
     else
     {
         alert.Text = "<script>Swal.fire('WARNING', 'Do not leave blank', 'error') </script>";
     }
 }