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