예제 #1
0
 public static HumanCaseListInfo[] GetAll(HumanCaseListInfo filter)
 {
     using (DbManagerProxy manager = DbManagerFactory.Factory.Create(EidssUserContext.Instance))
     {
         return(HumanCaseListItem.Accessor.Instance(null)
                .SelectListT(manager, FilterAutoBuilder.BuildFilter(filter))
                .Select(
                    c => new HumanCaseListInfo()
         {
             Id = c.idfCase,
             CaseID = c.strCaseID,
             LocalID = c.strLocalIdentifier,
             Diagnosis = new BaseReferenceItem()
             {
                 Id = c.idfsDiagnosis, Name = c.DiagnosisName
             },
             CaseClassification = new BaseReferenceItem()
             {
                 Id = c.idfsInitialCaseStatus, Name = c.CaseClassification != null ? c.CaseClassification.name : ""
             },
             CaseStatus = new BaseReferenceItem()
             {
                 Id = c.idfsCaseStatus, Name = c.CaseStatusName
             },
             EnteredDate = c.datEnteredDate,
             DateOfBirth = c.datDateofBirth,
             Location = c.GeoLocationName,
             PatientAge = c.intPatientAge,
             PatientAgeType = new BaseReferenceItem()
             {
                 Id = c.idfsHumanAgeType, Name = c.HumanAgeType != null ? c.HumanAgeType.name : ""
             }
         }).ToArray());
     }
 }
예제 #2
0
 public static VetCaseListInfo[] GetAll(VetCaseListInfo filter)
 {
     using (DbManagerProxy manager = DbManagerFactory.Factory.Create(EidssUserContext.Instance))
     {
         return(VetCaseListItem.Accessor.Instance(null)
                .SelectListT(manager, FilterAutoBuilder.BuildFilter(filter))
                .Select(
                    c => new VetCaseListInfo()
         {
             Id = c.idfCase,
             CaseID = c.strCaseID,
             CaseClassification = new BaseReferenceItem()
             {
                 Id = c.idfsCaseClassification, Name = c.CaseClassification != null ? c.CaseClassification.name : ""
             },
             ReportedDate = c.datReportDate,
             FarmName = c.strNationalName,
             FarmID = c.strFarmCode,
             FarmAddress = new AddressInfo()
             {
                 idfGeoLocation = c.idfAddress.Value,
                 Country = new BaseReferenceItem()
                 {
                     Id = c.idfsCountry, Name = c.Country != null ? c.Country.strCountryName : ""
                 },
                 Region = new BaseReferenceItem()
                 {
                     Id = c.idfsRegion, Name = c.Region != null ? c.Region.strRegionName : ""
                 },
                 Rayon = new BaseReferenceItem()
                 {
                     Id = c.idfsRayon, Name = c.Rayon != null ? c.Rayon.strRayonName : ""
                 },
                 Settlement = new BaseReferenceItem()
                 {
                     Id = c.idfsSettlement, Name = c.Settlement != null ? c.Settlement.strSettlementName : ""
                 }
             },
             TotalAnimals = c.intTotalAnimalQty,
             SickAnimals = c.intSickAnimalQty,
             DeadAnimals = c.intDeadAnimalQty,
             Diagnosis = new BaseReferenceItem()
             {
                 Id = c.idfsDiagnosis, Name = c.Diagnosis != null ? c.Diagnosis.name : ""
             }
         }).ToArray());
     }
 }