Beispiel #1
0
 /// <summary>
 /// Do debugowania, w przyszłości należy wyłączyć.
 /// </summary>
 public UserProfileModule()
 {
     this.dao = new UserProfileDAO();
     Get["/users/{id}/profile"]  = GetProfile;
     Post["/users/{id}/profile"] = PostProfile;
     Get["/users/{id}/photo"]    = GetProfilePhoto;
     Post["/users/{id}/photo"]   = PostProfilePhoto;
 }
        public bool PostUserProfile(UserProfileDAO uspro)
        {
            UserProfileServiceClient client = new UserProfileServiceClient();

            try
            {
                bool result = client.CreateUserProfile(uspro);
                return result;
            }
            catch (FaultException<KaskServiceException> e)
            {
                throw new HttpException(e.Message);
            }
        }
Beispiel #3
0
        private static void Deploy()
        {
            DeploymentDAO dao = new DeploymentDAO();

            dao.Redeploy();
            UserDAO registrator = new UserDAO();
            User    user1       = new User()
            {
                Email    = "*****@*****.**",
                Password = "******"
            };

            registrator.Register(user1);
            User user2 = new User()
            {
                Email    = "*****@*****.**",
                Password = "******"
            };

            registrator.Register(user2);
            UserProfileDAO profiler = new UserProfileDAO();

            user1 = profiler.GetUserByEmail(user1.Email);

            UserProfile profile = new UserProfile
            {
                UserID      = user1.ID,
                Nick        = "JhonnyJohnTheJonniest",
                Name        = "John",
                Surname     = "Johner",
                Born        = new DateTime(2000, 1, 1),
                AgeVisible  = true,
                NameVisible = true,
            };

            profiler.SaveUserProfile(profile);

            UserPhoto photo = new UserPhoto
            {
                UserID      = user1.ID,
                PhotoBase64 = Convert.ToBase64String(File.ReadAllBytes(@"Resources\emoji.png")),
            };

            profiler.SaveUserProfilePhoto(photo);
            Console.WriteLine("Redeployment done");
        }
Beispiel #4
0
 public static List <Country> GetCountries()
 {
     return(UserProfileDAO.getCountries());
 }
Beispiel #5
0
 public static List <UserProfile> GetUserByInterest(int id)
 {
     return(UserProfileDAO.getUserByInterestId(id));
 }
Beispiel #6
0
 public static List <UserProfile> GetUserByGender(bool isMale, string role)
 {
     return(UserProfileDAO.getUserByGender(isMale, role));
 }
Beispiel #7
0
 public VictimBotStorage()
 {
     Storage      = new MemoryStorage();
     UserProfiles = new UserProfileDAO(Storage);
     Incidents    = new IncidentDAO(Storage);
 }