public static bool DeleteUser(long userID) { SqlUserProvider sqlUserProvider = new SqlUserProvider(); var isDelete = sqlUserProvider.DeleteUser(userID); return(isDelete); }
public static bool UpdateUser(User user) { SqlUserProvider sqlUserProvider = new SqlUserProvider(); var isUpdate = sqlUserProvider.UpdateUser(user); return(isUpdate); }
public static long InsertUser(User user) { SqlUserProvider sqlUserProvider = new SqlUserProvider(); var id = sqlUserProvider.InsertUser(user); return(id); }
public static List <User> GetAllUsers() { SqlUserProvider sqlUserProvider = new SqlUserProvider(); var allUsers = sqlUserProvider.GetAllUsers(); return(allUsers); }
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)); }
public static User GetUserById(long userId) { SqlUserProvider sqlUserProvider = new SqlUserProvider(); return(sqlUserProvider.GetUserById(userId)); }