Exemplo n.º 1
0
        // Check if a user with the given username and password exists in the database.
        public static bool ValidateUser(BFBContext db, string username, string password)
        {
            List <BfbUser> user = db.BfbUser
                                  .Where(u => u.Username == username && u.Password == password)
                                  .ToList();

            return(user.Count == 1);
        }
Exemplo n.º 2
0
        // Add a user to BFB_User table
        public static void AddUserEntry(BFBContext db, string username, string email, string password)
        {
            DateTime currentDate = DateTime.Now;

            db.BfbUser.Add(new BfbUser
            {
                Username   = username,
                Email      = email,
                Password   = password,
                IsVerified = false,
                IsBanned   = false,
                IsActive   = false,
                InsertedOn = currentDate,
                UpdatedOn  = currentDate,
                UpdatedBy  = currentDate,
                EmailToken = null
            });
            db.SaveChanges();
        }
Exemplo n.º 3
0
 public RegisterFormController(BFBContext db)
 {
     _db = db;
 }
 public LoginFormController(BFBContext db)
 {
     _db = db;
 }