Exemplo n.º 1
0
        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),

                });
        }
Exemplo n.º 2
0
        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;
        }
Exemplo n.º 3
0
 public UserWrapper GetUser(string username)
 {
     UserAccess ua = new UserAccess();
     return ua.GetUserWithUsername(username);
 }