private void btnUserSave_Click(object sender, EventArgs e) { if (ValidateText(txtOldUser.Text)) { if (ValidateOldUser(txtOldUser.Text)) { if (ValidateText(txtNewUser.Text)) { UpdateUser(Gulipso.DataEncrypt(txtNewUser.Text)); } else { MessageBox.Show("Please Enter New Username!", "Alert - GO TECH Terminal", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } } else { MessageBox.Show("Old Username is not correct!", "Alert - GO TECH Terminal", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } } else { MessageBox.Show("Please Enter your Old Username!", "Alert - GO TECH Terminal", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } }
/// <summary> /// DataEncrypts the Password for supplied User. /// </summary> /// <param name="user">User for whom the Password is to be DataEncrypted.</param> /// <param name="password">Password to be DataEncrypted.</param> /// <returns>Password: The Password in DataEncrypted format.</returns> public Passwords EncryptUserPasswords(Passwords password) { password.Name = Gulipso.DataEncrypt(password.Name); password.Email = Gulipso.DataEncrypt(password.Email); password.Username = Gulipso.DataEncrypt(password.Username); password.Website = Gulipso.DataEncrypt(password.Website); password.Text = Gulipso.DataEncrypt(password.Text); password.Notes = Gulipso.DataEncrypt(password.Notes); return(password); }
private void btnSave_Click(object sender, EventArgs e) { if (txtStdName.Text != "" && txtStdFname.Text != "" && txtStdEmail.Text != "" && txtStdContact.Text != "" && txtStdCNIC.Text != "") { if (IsEmailValid(txtStdEmail.Text)) { if (isNumberValid(txtStdContact.Text)) { if (IsCNICValid(txtStdCNIC.Text)) { Student_Name = Regex.Replace(txtStdName.Text, @"(^\w)|(\s\w)", m => m.Value.ToUpper()); Student_FName = Regex.Replace(txtStdFname.Text, @"(^\w)|(\s\w)", m => m.Value.ToUpper()); Student_Name = Gulipso.DataEncrypt(Student_Name); Student_FName = Gulipso.DataEncrypt(Student_FName); Student_Email = Gulipso.DataEncrypt(txtStdEmail.Text); Student_Contact = Gulipso.DataEncrypt(txtStdContact.Text); Student_CNIC = Gulipso.DataEncrypt(txtStdCNIC.Text); bw = new BackgroundWorker(); bw.DoWork += bw_DoWork; bw.RunWorkerCompleted += bw_RunWorkerCompleted; if (!bw.IsBusy) { btnSave.Enabled = false; btnSave.Text = "Saving"; bw.RunWorkerAsync(); } } else { MessageBox.Show("Student's CNIC is not valid!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } } else { MessageBox.Show("Contact number is not valid!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } } else { MessageBox.Show("Email is not valid!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } } else { MessageBox.Show("All fields are mandatory!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void DoLogin() { UserID = Gulipso.DataEncrypt(txtboxUser.Text); Password = Gulipso.DataEncrypt(txtboxPass.Text); Loginbw = new BackgroundWorker(); Loginbw.DoWork += Loginbw_DoWork; Loginbw.RunWorkerCompleted += Loginbw_RunWorkerCompleted; if (!Loginbw.IsBusy) { progress1.LoaderText = "Please Wait"; progress1.Visible = true; btnLogin.Cursor = Cursors.No; btnLogin.Enabled = false; Loginbw.RunWorkerAsync(); } }
private async void btnlogin_Click(object sender, EventArgs e) { try { if (!Verifier.Text(txtuser.Text)) { CustomMessageBox.Show("Credentials Missing", "Enter your username!", CustomMessageBox.eDialogButtons.OK, CustomMessageBox.eDialogImages.Exclamation); } else if (!Verifier.Text(txtpass.Text)) { CustomMessageBox.Show("Credentials Missing", "Enter your password!", CustomMessageBox.eDialogButtons.OK, CustomMessageBox.eDialogImages.Exclamation); } else { pictureBox1.Visible = true; Users user = new Users() { Username = txtuser.Text, Master = Gulipso.DataEncrypt(txtpass.Text) }; Users Checkuser = await UsersService.Instance().LoginUserAsync(user); if (Checkuser != null) { this.Hide(); CustomMessageBox.Show("Login Successfull", "You have succesfully Logged On to your app!", CustomMessageBox.eDialogButtons.OK, CustomMessageBox.eDialogImages.Success); FormDashboard das = new FormDashboard(); das.Show(); } else { CustomMessageBox.Show("Invalid Credentials", "You have entered an incorrect username and password!", CustomMessageBox.eDialogButtons.OK, CustomMessageBox.eDialogImages.Error); pictureBox1.Visible = false; } } } catch (Exception ex) { CustomMessageBox.Show("An Error Occurred", ex.Message.ToString(), CustomMessageBox.eDialogButtons.OK, CustomMessageBox.eDialogImages.Error); } }
private void btnPassSave_Click(object sender, EventArgs e) { if (ValidateText(txtOldPass.Text)) { if (ValidateOldPass(txtOldPass.Text)) { if (ValidateText(txtNewPass.Text)) { if (ValidateText(txtConfirmPass.Text)) { if (ComparePass(txtNewPass.Text, txtConfirmPass.Text)) { UpdatePass(Gulipso.DataEncrypt(txtConfirmPass.Text)); } else { MessageBox.Show("Confirm Password is not correct!", "Alert - GO TECH Terminal", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } } else { MessageBox.Show("Please Enter your Confirm Password!", "Alert - GO TECH Terminal", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } } else { MessageBox.Show("Please Enter your New Password!", "Alert - GO TECH Terminal", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } } else { MessageBox.Show("Old Password is not correct!", "Alert - GO TECH Terminal", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } } else { MessageBox.Show("Please Enter your Old Password!", "Alert - GO TECH Terminal", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } }