Esempio n. 1
0
 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());
 }
Esempio n. 2
0
 public MovieRepository(CourseProjectDbContext ctx)
 {
     this.ctx = ctx;
 }
 public UsersRepository(CourseProjectDbContext context)
 {
     this.ctx = ctx;
 }
Esempio n. 4
0
 public UserService(CourseProjectDbContext dbContext)
 {
     this.dbContext = dbContext;
 }
 public PropertyController(CourseProjectDbContext ctx)
 {
     Context = ctx;
     repo    = new BaseRepository <Property>(Context);
 }
Esempio n. 6
0
 public MoviesController(CourseProjectDbContext context)
 {
     UnitOW = new UnitOfWork(context);
 }
 public RepositoryBase(CourseProjectDbContext ctx)
 {
     Context = ctx;
 }
Esempio n. 8
0
 public UserController(CourseProjectDbContext context)
 {
     uow = new UnitOfWork(context);
 }
 public UnitOfWork(CourseProjectDbContext ctx)
 {
     context = ctx;
 }
Esempio n. 10
0
 public CameraController(CourseProjectDbContext ctx)
 {
     Context = ctx;
     repo    = new BaseRepository <Camera>(Context);
 }