Esempio n. 1
0
 public DataLayer.Models.UserDTO map(ServicesLayer.Models.UserModel model)
 {
     DataLayer.Models.UserDTO dto = new DataLayer.Models.UserDTO();
     dto.ID       = model.ID;
     dto.Username = model.Username;
     dto.Title    = model.Title;
     dto.Password = model.Password;
     return(dto);
 }
Esempio n. 2
0
 public ServicesLayer.Models.UserModel map(DataLayer.Models.UserDTO dto)
 {
     ServicesLayer.Models.UserModel model = new ServicesLayer.Models.UserModel();
     model.Username = dto.Username;
     model.Title    = dto.Title;
     model.Password = dto.Password;
     model.ID       = dto.ID;
     return(model);
 }
Esempio n. 3
0
 public string login(string username, string password)
 {
     ServicesLayer.Models.UserModel model = this.getAll().FirstOrDefault(x => x.Username == username);
     if (model == null)
     {
         return("failed");// "no user wes found with username: "******". Please try again!";
     }
     if (model.Password == password)
     {
         return(model.Title);// "Logged in succesfully as " + username+"("+model.Title+")";
     }
     return("failed");
 }