示例#1
0
 public bool Login(string login, string password)
 {
     if (IsValidUser(login, password))
     {
         ApplicationState.CurrentUser = DbCommunication.GetUser(login);
         return(true);
     }
     return(false);
 }
示例#2
0
        public string GetPasswordByUser(string login)
        {
            if (string.IsNullOrWhiteSpace(login))
            {
                return(string.Empty);
            }

            DataTable dataTable = DbCommunication.PullData(login);

            if (dataTable.Rows.Count == 0)
            {
                return(string.Empty);
            }

            int firtstRowIndex      = 0;
            int passwordColumnIndex = 0;

            return(dataTable.Rows[firtstRowIndex][passwordColumnIndex].ToString());
        }
示例#3
0
 private void button1_Click(object sender, EventArgs e)
 {
     DbCommunication.CreateUser(null, null);
 }