Example #1
0
        public static bool DeleteUser(long userID)
        {
            SqlUserProvider sqlUserProvider = new SqlUserProvider();
            var             isDelete        = sqlUserProvider.DeleteUser(userID);

            return(isDelete);
        }
Example #2
0
        public static bool UpdateUser(User user)
        {
            SqlUserProvider sqlUserProvider = new SqlUserProvider();
            var             isUpdate        = sqlUserProvider.UpdateUser(user);

            return(isUpdate);
        }
Example #3
0
        public static long InsertUser(User user)
        {
            SqlUserProvider sqlUserProvider = new SqlUserProvider();
            var             id = sqlUserProvider.InsertUser(user);

            return(id);
        }
Example #4
0
        public static List <User> GetAllUsers()
        {
            SqlUserProvider sqlUserProvider = new SqlUserProvider();
            var             allUsers        = sqlUserProvider.GetAllUsers();

            return(allUsers);
        }
Example #5
0
        public ActionResult Login(User user)
        {
            ViewBag.Error = "Проверьте корректность ввода данных";

            if (!ModelState.IsValid)
            {
                return(View("Login"));
            }
            var dataProvider = new SqlUserProvider();
            var dbUser       = dataProvider.GetUserByLogin(user.Login);

            if (user.Login == dbUser.Login &&
                user.Password == dbUser.Password.Decrypt())
            {
                FormsAuthentication.RedirectFromLoginPage(user.Login, false);
            }

            return(View("Login"));
        }
        public static User GetUserByUserNameNPassword(string userName, string password)
        {
            SqlUserProvider provider = new SqlUserProvider();

            return(provider.GetUserByUserNameNPassword(userName, password));
        }
Example #7
0
        public static User GetUserById(long userId)
        {
            SqlUserProvider sqlUserProvider = new SqlUserProvider();

            return(sqlUserProvider.GetUserById(userId));
        }