public List <TreatmentRatioViewPar> GetAll()
 {
     using (var ingredient = new TreatmentRatioRepository())
     {
         return(ingredient.GetAll().Select(x => new TreatmentRatioViewPar
         {
             TreatmentRatioId = x.TreatmentRatioId,
             IngredientName = _ingredients.GetAll().ToList().Find(y => y.IngredientId == x.IngredientId).IngredientName,
             TotalMass = x.TotalMass,
             TreatPrice = x.TreatPrice,
             TreatmentPercentage = (_percentage.GetAll().ToList().Find(y => y.TreatmentPercentageId == x.TreatmentPercentageId).Percentage),
             TreatmentName = _treatment.GetAll().ToList().Find(y => y.Tid == x.Tid).Tname
         }).ToList());
     }
 }
        public AbstractDomainModel GetAll(Core.Enumerations.SearchCriteriaEnum searchCriteria)
        {
            searchDoctor = new DomainModel.Models.DoctorsSearch();
            switch (searchCriteria)
            {
            case Core.Enumerations.SearchCriteriaEnum.GET_COUNTRIES:
                searchDoctor.Countries = countryRepository.GetAll();
                break;

            case Core.Enumerations.SearchCriteriaEnum.GET_SPECIALTIES:
                searchDoctor.Specialties = specialtyRepository.GetAll();
                break;

            case Core.Enumerations.SearchCriteriaEnum.GET_DOCTORS:
                searchDoctor.Doctors = providerRepository.GetAllDoctors();
                break;

            case Core.Enumerations.SearchCriteriaEnum.GET_PHARMACISTS:
                searchDoctor.Pharmacists = providerRepository.GetAllPharmacists();
                break;

            case Core.Enumerations.SearchCriteriaEnum.GET_NURSE:
                searchDoctor.Nurses = providerRepository.GetAllNurses();
                break;

            case Core.Enumerations.SearchCriteriaEnum.GET_TREATMENTS:
                searchDoctor.Treatments = treatmentRepository.GetAll();
                break;

            default:
                break;
            }

            return(searchDoctor);
        }
 public List <TreatmentModelView> GetAllT()
 {
     using (var treatment = new TreatmentRepository())
     {
         return(treatment.GetAll().Select(x => new TreatmentModelView
         {
             Tid = x.Tid,
             Tname = x.Tname,
         }).ToList());
     }
 }
Exemple #4
0
 public List <TreatmentRatioTotalViewPar> GetAll()
 {
     using (var ingredient = new TreatmentRatioTotalRepository())
     {
         return(ingredient.GetAll().Select(x => new TreatmentRatioTotalViewPar
         {
             TreatmentRatioTotalId = x.TreatmentRatioTotalId,
             Price = x.Price,
             TreatmentName = _treatment.GetAll().ToList().Find(y => y.Tid == x.Tid).Tname
         }).ToList());
     }
 }
        static void Main(string[] args)
        {
            // Test the pattern
            var builder = new ConfigurationBuilder()
                          .SetBasePath(Directory.GetCurrentDirectory())
                          .AddJsonFile("global.json");
            string conString = builder.Build().GetConnectionString("DefaultConnection");

            MyContext           myContext = MyContextFactory.Create(conString);
            TreatmentRepository tr        = new TreatmentRepository(myContext);

            foreach (Treatment item in tr.GetAll())
            {
                Console.WriteLine(item.Text);
            }
            Console.WriteLine(conString);
        }
 public IEnumerable <TreatmentViewModel> Get()
 {
     return(_repository.GetAll());
 }