Exemplo n.º 1
0
        public static AccountInfo AuthenticateUser(AccountInfo account)
        {
            int         retValue    = -1;
            AccountInfo accountInfo = new AccountInfo();

            using (SqlDataReader dr = ProjManagementAdmin.AuthenticateUser(account.UserName, account.Password, out retValue)) //Initialize and retrieve code for Datareader goes here
            {
                if (dr != null && dr.HasRows)
                {
                    while (dr.Read())
                    {
                        accountInfo.AccountId = Convert.ToInt32(dr["account_id"]);
                        accountInfo.UserName  = dr["user_name"].ToString();
                        accountInfo.Password  = dr["password"].ToString();
                        accountInfo.FirstName = dr["first_name"].ToString();
                        accountInfo.LastName  = dr["last_name"].ToString();
                    }
                }
            }

            return(accountInfo);
        }