Ejemplo n.º 1
0
        public IEnumerable <BasePatientVM> GetPatient(string hn)
        {
            var data = new List <BasePatientVM>();

            int _hn       = 0;
            var query     = "";
            var p         = new DynamicParameters();
            var trySearch = hn.Replace("-", "");

            if (int.TryParse(trySearch, out _hn))
            {
                query = DBCacheQuery.GetPatientByHN();
                p.AddDynamicParams(new { PAPMI_No = _hn + "%" });
            }
            else
            {
                query = DBCacheQuery.GetPatientByHN();
                p.AddDynamicParams(new { PAPMI_No = trySearch + "%" });
            }

            using (IDbConnection connection = cacheConnection)
            {
                try
                {
                    data = connection.QueryAsync <BasePatientVM>(query, p).Result.ToList();
                }
                catch (Exception ex)
                {
                    throw;
                }
            }

            return(data);
        }
Ejemplo n.º 2
0
        public BasePatientVM GetPatientByHN(string hn)
        {
            var data = new BasePatientVM();

            using (IDbConnection connection = cacheConnection)
            {
                data = connection.QueryFirstOrDefaultAsync <BasePatientVM>(DBCacheQuery.GetPatientByHN(), new { PAPMI_No = hn }).Result;
            }

            return(data);
        }
Ejemplo n.º 3
0
        public Tuple <bool, User> LogonTrakCare(User user)
        {
            var userTC = new User();

            using (IDbConnection connection = cacheConnection)
            {
                userTC = connection.QueryFirstOrDefaultAsync <User>(DBCacheQuery.Logon(), new { SSUSR_Initials = user.SSUSR_Initials }).Result;
            }

            return(new Tuple <bool, User>(userTC.CheckPassword(user.SSUSR_Password), userTC));;
        }
Ejemplo n.º 4
0
        public IEnumerable <BasePatientVM> GetPatient(string firstName, string lastName)
        {
            var data = new List <BasePatientVM>();
            var p    = PatientDynamicParameters(firstName, lastName);

            using (IDbConnection connection = cacheConnection)
            {
                data = connection.QueryAsync <BasePatientVM>(DBCacheQuery.GetPatientByName(firstName, lastName), p).Result.ToList();
            }

            return(data);
        }