VideoRentalService.SecurityModule.Logon C# (CSharp) Method

Logon() public method

public Logon ( string user, string password, int &userID ) : bool
user string
password string
userID int
return bool
        public bool Logon(string user, string password, ref int userID)
        {
            using (SakilaEntities dc = new SakilaEntities())
            {
                var model = from users in dc.staffs
                            where users.first_name.ToUpper() == user.ToUpper() && users.last_name.ToUpper() == password.ToUpper()
                            select users;
                //check the password

                if (model.Count() == 1)
                {
                    userID = Convert.ToInt32(model.ToArray()[0].staff_id);
                    return true;
                }
                else
                {
                    return false;
                }
            }
        }

Usage Example

Exemplo n.º 1
0
 public bool Logon(string user, string password, ref int userID)
 {
     SecurityModule sm = new SecurityModule();
     return sm.Logon(user, password, ref userID);
 }
All Usage Examples Of VideoRentalService.SecurityModule::Logon
SecurityModule