public ActionResult Register(Registration user)
 {
     if (ModelState.IsValid)
     {
         using (HMSDbContext db = new HMSDbContext())
         {
             //user.Category = fc["Category"];
             //var NewUser = db.Registrations.Create();
             //NewUser.Email = user.Email;
             //NewUser.Password = user.Password;
             db.Registrations.Add(user);
             db.SaveChanges();
             return(RedirectToAction("LogIn", "", new { s = "Registered Succesfully" }));
         }
     }
     return(View(user));
 }
        private bool IsValid(string email, string password, string category)
        {
            bool IsValid = false;

            using (HMSDbContext db1 = new HMSDbContext())
            {
                var user = db1.Registrations.FirstOrDefault(u => u.Email == email);
                if (user != null)
                {
                    if (user.Password == password /*crypto.Compute(password,user.PasswordSalt)*/)
                    {
                        if (user.Category == category)
                        {
                            IsValid = true;
                        }
                    }
                }
            }
            return(IsValid);
        }
Beispiel #3
0
 public TenureTypeDbAccess(HMSDbContext db)
 {
     this.db = db;
 }
Beispiel #4
0
 public PropertyAttributeDbAccess(HMSDbContext db)
 {
     this.db = db;
 }
Beispiel #5
0
 public ReservationRepository(HMSDbContext context, IMapper mapper)
     : base(context)
 {
     _mapper = mapper;
 }
Beispiel #6
0
 public CompanyRepository(HMSDbContext context)
     : base(context)
 {
 }
Beispiel #7
0
 public SystemJobDbAccess(HMSDbContext db)
 {
     this.db = db;
 }
Beispiel #8
0
 public RoomRepository(HMSDbContext context)
     : base(context)
 {
 }
Beispiel #9
0
 public roomrep(HMSDbContext _db)
 {
     db = _db;
 }
Beispiel #10
0
 public PatientCommandHandler(HMSDbContext context)
 {
     _context = context ?? throw new ArgumentNullException(nameof(context));
 }
Beispiel #11
0
 public SysUserDomin(HMSDbContext dbContext)
 {
     _dbContext = dbContext;
 }
 public EPCRatingDbAcess(HMSDbContext db)
 {
     this.db = db;
 }
Beispiel #13
0
 public RepositoryBase(HMSDbContext context)
 {
     Context = context;
 }
Beispiel #14
0
 public TradeCodeDbAccess(HMSDbContext db)
 {
     this.db = db;
 }
Beispiel #15
0
 public PersonRepository(HMSDbContext context)
     : base(context)
 {
 }
Beispiel #16
0
 public PropertyTypeDbAccess(HMSDbContext db)
 {
     this.db = db;
 }
Beispiel #17
0
 public CountryRepository(HMSDbContext context)
     : base(context)
 {
 }
Beispiel #18
0
 public bookingrep(HMSDbContext _db)
 {
     db = _db;
 }
Beispiel #19
0
 public GroupRepository(HMSDbContext context)
     : base(context)
 {
 }
Beispiel #20
0
 public userrep(HMSDbContext _db)
 {
     db = _db;
 }