public List <StudyModel> GeStudiesBySiteId(SiteApiParameter param) { var Result = dbContext.sp_site_GetStudiesBySiteId(param.SiteId, param.Search, param.FromRecord, param.ToRecord).Select(value => new StudyModel { Id = value.Id, StudyTitle = value.StudyTitle, Status = value.Status, StatusId = value.StatusId ?? 0, StudyCode = value.StudyCode, }).ToList(); return(Result); }
public List <ReferalModel> GeReferalByStudyId(SiteApiParameter param) { var data = dbContext.sp_site_GetReferalsByStudyId(param.SiteId, param.StudyId, param.Search, param.FromRecord, param.ToRecord) .Select(value => new ReferalModel { ReferalId = value.RefrelId ?? 0, ReferalCode = value.ReferalCode, SiteId = value.SiteId ?? 0, Status = value.ReferalStatus, StatusId = value.ReferalStatusId ?? 0, StudyId = value.StudyId ?? 0, }).ToList(); return(data); }
public string GetReferalsByStudy(SiteApiParameter model) { var result = new DataServiceResult <List <ReferalModel> >(); try { var data = siterepo.GeReferalByStudyId(model); if (data != null) { result.Success = true; result.Value = data; } } catch (Exception ex) { result.Success = false; result.ExceptionInfo = new ExceptionInfo(ex); } return(JsonConvert.SerializeObject(result)); }