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);
        }
示例#3
0
 public TenureTypeDbAccess(HMSDbContext db)
 {
     this.db = db;
 }
示例#4
0
 public PropertyAttributeDbAccess(HMSDbContext db)
 {
     this.db = db;
 }
示例#5
0
 public ReservationRepository(HMSDbContext context, IMapper mapper)
     : base(context)
 {
     _mapper = mapper;
 }
示例#6
0
 public CompanyRepository(HMSDbContext context)
     : base(context)
 {
 }
示例#7
0
 public SystemJobDbAccess(HMSDbContext db)
 {
     this.db = db;
 }
示例#8
0
 public RoomRepository(HMSDbContext context)
     : base(context)
 {
 }
示例#9
0
 public roomrep(HMSDbContext _db)
 {
     db = _db;
 }
示例#10
0
 public PatientCommandHandler(HMSDbContext context)
 {
     _context = context ?? throw new ArgumentNullException(nameof(context));
 }
示例#11
0
 public SysUserDomin(HMSDbContext dbContext)
 {
     _dbContext = dbContext;
 }
示例#12
0
 public EPCRatingDbAcess(HMSDbContext db)
 {
     this.db = db;
 }
示例#13
0
 public RepositoryBase(HMSDbContext context)
 {
     Context = context;
 }
示例#14
0
 public TradeCodeDbAccess(HMSDbContext db)
 {
     this.db = db;
 }
示例#15
0
 public PersonRepository(HMSDbContext context)
     : base(context)
 {
 }
示例#16
0
 public PropertyTypeDbAccess(HMSDbContext db)
 {
     this.db = db;
 }
示例#17
0
 public CountryRepository(HMSDbContext context)
     : base(context)
 {
 }
示例#18
0
 public bookingrep(HMSDbContext _db)
 {
     db = _db;
 }
示例#19
0
 public GroupRepository(HMSDbContext context)
     : base(context)
 {
 }
示例#20
0
 public userrep(HMSDbContext _db)
 {
     db = _db;
 }