Пример #1
0
        public async Task <List <SP_AntimicrobialResistanceDTO> > GetAMRModelAsync(SP_AntimicrobialResistanceSearchDTO searchData)
        {
            List <SP_AntimicrobialResistanceDTO> objList = new List <SP_AntimicrobialResistanceDTO>();

            objList = await _apiHelper.GetDataListByModelAsync <SP_AntimicrobialResistanceDTO, SP_AntimicrobialResistanceSearchDTO>("antibiotrend_api/GetAMRModel", searchData);

            return(objList);
        }
Пример #2
0
        public List <SP_AntimicrobialResistanceDTO> GetAMRWithModel(SP_AntimicrobialResistanceSearchDTO searchModel)
        {
            log.MethodStart();

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

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

            using (var trans = _db.Database.BeginTransaction())
            {
                try
                {
                    var objDataList = _db.DropdownAMRListDTOs.FromSqlRaw <SP_AntimicrobialResistanceDTO>("sp_GET_RPAntibicromialResistance {0},{1},{2},{3}"
                                                                                                         , searchModel.org_codes
                                                                                                         , searchModel.anti_codes
                                                                                                         , searchModel.start_year
                                                                                                         , searchModel.end_year
                                                                                                         ).ToList();

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

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

            log.MethodFinish();

            return(objList);
        }
Пример #3
0
        public IEnumerable <SP_AntimicrobialResistanceDTO> GetAMRWardType([FromBody] SP_AntimicrobialResistanceSearchDTO searchModel)
        {
            var objReturn = _service.GetAMRByWardWithModel(searchModel);

            return(objReturn);
        }