public ActionResult Login(User user) { using (CourseProjectDbContext db = new CourseProjectDbContext()) { var usr = db.Users.Single(u => u.UserName == user.UserName && u.Password == user.Password); if (usr != null) { Session["UserId"] = usr.UserId.ToString(); Session["UserName"] = usr.UserName.ToString(); return(RedirectToAction("LoggedIn")); } else { ModelState.AddModelError("", "Username or password is incorrect."); } } return(View()); }
public MovieRepository(CourseProjectDbContext ctx) { this.ctx = ctx; }
public UsersRepository(CourseProjectDbContext context) { this.ctx = ctx; }
public UserService(CourseProjectDbContext dbContext) { this.dbContext = dbContext; }
public PropertyController(CourseProjectDbContext ctx) { Context = ctx; repo = new BaseRepository <Property>(Context); }
public MoviesController(CourseProjectDbContext context) { UnitOW = new UnitOfWork(context); }
public RepositoryBase(CourseProjectDbContext ctx) { Context = ctx; }
public UserController(CourseProjectDbContext context) { uow = new UnitOfWork(context); }
public UnitOfWork(CourseProjectDbContext ctx) { context = ctx; }
public CameraController(CourseProjectDbContext ctx) { Context = ctx; repo = new BaseRepository <Camera>(Context); }