Exemplo n.º 1
0
        public Link AddLink(Link l)
        {
            using (UserDataContext dataContext = new UserDataContext())
            {
                dataContext.Links.InsertOnSubmit(l);
                dataContext.SubmitChanges();

                return(l);
            }
        }
Exemplo n.º 2
0
        public Link AddLink(Link l)
        {
            using (UserDataContext dataContext = new UserDataContext())
            {
                dataContext.Links.InsertOnSubmit(l);
                dataContext.SubmitChanges();

                return l;
            }
        }
Exemplo n.º 3
0
        public User AddUser(string userName, string password)
        {
            //we should really check if username exists.....
            using (UserDataContext dataContext = new UserDataContext())
            {

                User user = new User();
                user.Salt = PasswordHelper.GenerateSalt();
                user.UserName = userName;
                user.HashPassword = PasswordHelper.HashPassword(password, user.Salt);

                dataContext.Users.InsertOnSubmit(user);

                dataContext.SubmitChanges();

                //user.Id = (int)(decimal)cmd.ExecuteScalar();

                return user;
            }
        }
Exemplo n.º 4
0
        public User AddUser(string userName, string password)
        {
            //we should really check if username exists.....
            using (UserDataContext dataContext = new UserDataContext())
            {
                User user = new User();
                user.Salt         = PasswordHelper.GenerateSalt();
                user.UserName     = userName;
                user.HashPassword = PasswordHelper.HashPassword(password, user.Salt);


                dataContext.Users.InsertOnSubmit(user);


                dataContext.SubmitChanges();

                //user.Id = (int)(decimal)cmd.ExecuteScalar();

                return(user);
            }
        }