public IEnumerable<ResponseWrapper> GetResponses(string unitCode) { ResponseTableAdapter ad = new ResponseTableAdapter(); DBDataSet.ResponseDataTable tbl = ad.GetData(unitCode); UserAccess ua = new UserAccess(); return tbl.Select(r => new ResponseWrapper() { UnitCode = r.UnitCode, Comment = r.Comment, Rating = r.Rating, ResponseId = r.ResponseId, Time = r.Time, User = ua.GetUserWithID(r.UserID), }); }
public UserWrapper CreateUser(UserWrapper wrapper, out CreateUserStatus status) { validateUser(wrapper, out status); if (status == CreateUserStatus.UserValidated) { wrapper.Salt = PasswordUtilities.GenerateSalt(); wrapper.Password = PasswordUtilities.GeneratePassword(wrapper.Password, wrapper.Salt); wrapper.BirthDate = DateTime.Now; UserAccess ua = new UserAccess(); ua.AddUser(wrapper); status = CreateUserStatus.UserCreated; return wrapper; } return null; }
public UserWrapper GetUser(string username) { UserAccess ua = new UserAccess(); return ua.GetUserWithUsername(username); }