Beispiel #1
0
 public static SecureDA getInstance()
 {
     if (instance == null)
     {
         instance = new SecureDA();
     }
     return(instance);
 }
Beispiel #2
0
        /// <summary>
        /// check availability of the user in database
        /// </summary>
        /// <returns>ture if user is available.</returns>
        private bool checkUser()
        {
            userSensitiveData = SecureDA.getInstance().readFromDatabase(this.username);


            if (!(userSensitiveData == null))
            {
                return(true);
            }

            return(false);
        }
Beispiel #3
0
        private bool VerifyPassword(String Password)            // verify the current password retun true if ok else false
        {
            ModelUser = SecureDA.getInstance().readFromDatabase(frmMain.AppUser.UserName);

            if ((ModelUser.Password).Equals(Cryptography.Encrypt(Password)))
            {
                return(true);
            }
            else
            {
                MessageBox.Show("Wrong Password");
                return(false);
            }
        }
Beispiel #4
0
 public bool update()  //update to database using secure Data Acess
 {
     return(SecureDA.getInstance().updateToDatabase(this));
 }
Beispiel #5
0
 public bool create()  // add to database using secure Data Acess
 {
     return(SecureDA.getInstance().addToDatabase(this));
 }