Example #1
0
        public void setup()
        {
            uRepo = new UserRepo();
            userA = new USER
            {
                USER_ID = 1,
                USER_FNAME = "Ermin",
                USER_LNAME = "Avdagic",
                USER_DISPLAYNAME = "Me",
                USER_EMAIL = "*****@*****.**",
                PASSWORD = "******",
                REPUTATION = 1,
                CREATED_TIMESTAMP = DateTime.Now
            };
            //uRepo.add(userA);

            uRepo.add(new USER
            {
                USER_ID = 2,
                USER_FNAME = "Jon",
                USER_LNAME = "Smith",
                USER_EMAIL = "*****@*****.**",
                USER_DISPLAYNAME = "JonSmith",
                REPUTATION = 5,
                PASSWORD = "******",
                CREATED_TIMESTAMP = DateTime.Now
            });
        }
Example #2
0
        public User insertUser(User newUser)
        {
            User user2add = newUser;
            USER u3 = new USER();
            UserRepo userRepo = new UserRepo();

            u3.USER_FNAME = user2add.USER_FNAME;
            u3.USER_LNAME = user2add.USER_LNAME;
            u3.USER_EMAIL = user2add.EMAIL;
            u3.USER_DISPLAYNAME = user2add.USER_DISPLAYNAME;
            u3.PASSWORD = user2add.PASSWORD;
            u3.CREATED_TIMESTAMP = DateTime.Now;
            userRepo.add(u3);

            return user2add;
        }
Example #3
0
        public void setup()
        {
            bRepo = new BookRepo();
            uRepo = new UserRepo();

            userA = new USER
            {
                USER_FNAME = "Ermin",
                USER_LNAME = "Avdagic",
                USER_DISPLAYNAME = "Me",
                USER_EMAIL = "*****@*****.**",
                PASSWORD = "******",
                REPUTATION = 1,
                CREATED_TIMESTAMP = DateTime.Now
            };
            uRepo.add(userA);

            bookA = new BOOK
            {
                USER_ID=333,
                BOOK_AUTHOR = "Me",
                BOOK_DESC = "About my life",
                BOOK_EDITION = 10,
                BOOK_PRICE = 20,
                BOOK_PUBLISHER = "IDK",
                BOOK_TITLE = "My Life",
                ISBN10 = 12345678910,
                ISBN13 = 12345678910111,
                CREATED_TIMESTAMP = DateTime.Now,
                CATEGORY_ID=1,
                CONDITION_ID=1
            };
            bRepo.add(bookA);

            uRepo.add(new USER
            {
                USER_FNAME = "Jon",
                USER_LNAME = "Smith",
                USER_EMAIL = "*****@*****.**",
                USER_DISPLAYNAME = "JonSmith",
                REPUTATION = 5,
                PASSWORD = "******",
                CREATED_TIMESTAMP = DateTime.Now
            });
        }
        public User insertUser(User newUser)
        {
            User user2add = newUser;
            USER u3 = null;
            UserRepo userRepo = new UserRepo();
            DateTime dt = DateTime.Now;
            long a = dt.Ticks;

            u3.USER_FNAME = newUser.USER_FNAME;
            u3.USER_LNAME = newUser.USER_LNAME;
            u3.USER_EMAIL = newUser.EMAIL;
            u3.USER_DISPLAYNAME = newUser.USER_DISPLAYNAME;
            u3.PASSWORD = newUser.PASSWORD;
            u3.CREATED_TIMESTAMP = BitConverter.GetBytes(a);
            userRepo.add(u3);

            return newUser;
        }
        public void bookSetup()
        {
            bookService = new BookService();
            bRepo = new BookRepo();
            uRepo = new UserRepo();

            userA = new USER
            {

              USER_FNAME = "Cory",
              USER_LNAME = "Jenkings",
              PASSWORD = "******",
              USER_EMAIL = "*****@*****.**",
              USER_DISPLAYNAME = "C.J",
              CREATED_TIMESTAMP = DateTime.Now,
              REPUTATION = 509};

            uRepo.add(userA);

            bookA = new BOOK
            {
                USER_ID=333,
                BOOK_PRICE = 20,
                BOOK_PUBLISHER = "idk",
                BOOK_TITLE = "my life",
                BOOK_AUTHOR = "Ermin",
                BOOK_EDITION = 10,
                BOOK_DESC = "A book with words and pictures",
                CREATED_TIMESTAMP = DateTime.Now,
                ISBN10 = 1111111111,
                ISBN13 = 1111111111111,
                CATEGORY_ID=1,
                CONDITION_ID=1
            };
            bRepo.add(bookA);
        }