Exemplo n.º 1
0
        public List <HospitalDTO> GetListWithModel(HospitalSearchDTO searchModel)
        {
            log.MethodStart();

            List <HospitalDTO> objList = new List <HospitalDTO>();

            //var searchModel = JsonSerializer.Deserialize<MenuSearchDTO>(param);

            using (var trans = _db.Database.BeginTransaction())
            {
                try
                {
                    objList = _db.HospitalDTOs.FromSqlRaw <HospitalDTO>("sp_GET_TRHospital {0}, {1}, {2}", searchModel.hos_name, searchModel.hos_prv_code, searchModel.hos_arh_code).ToList();

                    //objList = _mapper.Map<List<HospitalDTO>>(objDataList);

                    trans.Commit();
                }
                catch (Exception ex)
                {
                    // TODO: Handle failure
                    trans.Rollback();
                }
                finally
                {
                    trans.Dispose();
                }
            }

            log.MethodFinish();

            return(objList);
        }
Exemplo n.º 2
0
        public List <HospitalLabDTO> GetLabListWithModel(HospitalSearchDTO searchModel)
        {
            log.MethodStart();

            List <HospitalLabDTO> objList = new List <HospitalLabDTO>();

            //var searchModel = JsonSerializer.Deserialize<MenuSearchDTO>(param);

            using (var trans = _db.Database.BeginTransaction())
            {
                try
                {
                    var objDataList = _db.TRHospitalLabs.Where(x => x.lab_hos_code == searchModel.hos_code).ToList();

                    objList = _mapper.Map <List <HospitalLabDTO> >(objDataList);

                    trans.Commit();
                }
                catch (Exception ex)
                {
                    // TODO: Handle failure
                    trans.Rollback();
                }
                finally
                {
                    trans.Dispose();
                }
            }

            log.MethodFinish();

            return(objList);
        }
        public async Task <List <HospitalLabDTO> > GetLabListByModelAsync(HospitalSearchDTO searchData)
        {
            List <HospitalLabDTO> objList = new List <HospitalLabDTO>();

            objList = await _apiHelper.GetDataListByModelAsync <HospitalLabDTO, HospitalSearchDTO>("hospital_api/Get_LabListByModel", searchData);

            return(objList);
        }
        public async Task <List <HospitalDTO> > GetListByParamAsync(HospitalSearchDTO searchData)
        {
            List <HospitalDTO> objList = new List <HospitalDTO>();

            var searchJson = JsonSerializer.Serialize(searchData);

            objList = await _apiHelper.GetDataListByParamsAsync <HospitalDTO>("hospital_api/Get_List", searchJson);

            return(objList);
        }
Exemplo n.º 5
0
        public IEnumerable <HospitalLabDTO> Get_LabListByModel([FromBody] HospitalSearchDTO searchModel)
        {
            var objReturn = _service.GetLabListWithModel(searchModel);

            return(objReturn);
        }