Beispiel #1
0
 public void CreateUser(string username, string password)
 {
     UserDaoDatabase dao = new UserDaoDatabase();
     UserItem user = new UserItem();
     user.Password = password;
     user.Username = username;
     dao.Add(user);
 }
Beispiel #2
0
        public IEnumerable<ToDoItem> GetToDosForUser(string user, bool showCompleted)
        {
            ToDoDaoDatabase daoToDo = new ToDoDaoDatabase();
            UserDaoDatabase daoUser = new UserDaoDatabase();
            int userId = daoUser.FindIdByUsername(user);
            IEnumerable<Model.ToDoItem> result = daoToDo.GetToDosByUserId(userId,showCompleted);

            return result;
        }
Beispiel #3
0
 public void AddToDo(string todoText, string user)
 {
     ToDoDaoDatabase daoToDo = new ToDoDaoDatabase();
     UserDaoDatabase daoUser = new UserDaoDatabase();
     ToDoItem item = new ToDoItem();
     int userId = daoUser.FindIdByUsername(user);
     item.Text = todoText;
     item.UserId = userId;
     daoToDo.Add(item);
 }
Beispiel #4
0
 public bool ValidateUser(string username, string password)
 {
     UserDaoDatabase dao =  new UserDaoDatabase();
     IEnumerable<UserItem> userItems = dao.GetAll();
     foreach(UserItem useritem in userItems)
     {
         if (useritem.Username == username && useritem.Password == password)
         {
             return true;
         }
     }
     return false;
 }