public Staff Login(Staff staff) { byte[] hashedBytes = md5.ComputeHash(Encoding.ASCII.GetBytes(staff.Password)); string hashedPassword = Encoding.ASCII.GetString(hashedBytes); Staff information = StaffDAL.GetByEmail(staff.Email); if (information != null && information.Password == hashedPassword) { return(information); } return(null); }
public int Create(Staff staff) { byte[] hashedBytes = md5.ComputeHash(Encoding.ASCII.GetBytes(staff.Password)); string hashedPassword = Encoding.ASCII.GetString(hashedBytes); staff.Password = hashedPassword; if (StaffDAL.GetByEmail(staff.Email) != null) { return(-1); } return(StaffDAL.Create(staff)); }