Esempio n. 1
0
        public UserLogin LoginUser(string email, string password, string companyId)
        {
            UserLogin loggedUser = null;

            if (!_commonService.IsCompanyActive(companyId))
            {
                throw new Exception(String.Format("Selected [{0}] institute has not valid licence.", companyId));
            }

            using (var db = ObjectFactory.CreateDbContext(_commonService.GetCompanyDbFilePath(companyId)))
            {
                loggedUser = db.GetQueryData <UserLogin>(SQL.UserLoginCheck, new { Email = email, Password = password }).FirstOrDefault();
            }

            return(loggedUser);
        }