public void Delete(int id)
        {
            VaccinationTypesRepository       vaccinationTypes;
            VaccinationReservationRepository vaccinationReservation = dataBaseGateWay.GetById(c => c.Id == id);

            dataBaseGateWay.Delete(vaccinationReservation);
        }
        public void Edit(VaccinationTypesDataModel model)
        {
            VaccinationTypesRepository VaccinationType           = new VaccinationTypesRepository();
            VaccinationTypesRepository VaccinationTypeStoredInDb = dataBaseGateWay.GetById(g => g.Id == model.Id);

            VaccinationType.Id   = model.Id;
            VaccinationType.Name = model.Name;

            dataBaseGateWay.Edit(VaccinationTypeStoredInDb, VaccinationType);
        }
Пример #3
0
        public void Edit(SystemSettingsDataModel model)
        {
            SystemSettingsRepository SystemSettings           = new SystemSettingsRepository();
            SystemSettingsRepository SystemSettingsStoredInDb = dataBaseGateWay.GetById(g => g.Id == model.Id);

            SystemSettings.Token            = model.Token;
            SystemSettings.NotificationType = (byte)model.NotificationType;
            SystemSettings.Id = model.Id;
            dataBaseGateWay.Edit(SystemSettingsStoredInDb, SystemSettings);
        }
Пример #4
0
        public void Edit(RegistrarsDataModel model)
        {
            RegistrarsRepository RegistrarsStoredInModel = dataBaseGateWay.GetById(g => g.Id == model.Id), registrars;

            registrars           = new RegistrarsRepository();
            registrars.Id        = model.Id;
            registrars.Name      = model.Name;
            registrars.Telephone = model.Telephone;
            registrars.Notified  = model.Notified;
            dataBaseGateWay.Edit(RegistrarsStoredInModel, registrars);
        }
        public VaccinationReservationDataModel GetById(int id)
        {
            RepositoryGateWay <RegistrarsRepository>       RegistrarsDataBaseGateWay;
            RepositoryGateWay <VaccinationTypesRepository> VaccinationTypeDataBaseGateWay;
            RegistrarsRepository       registrar;
            VaccinationTypesRepository VaccinationTypes;

            VaccinationReservationRepository vaccinationReservation = dataBaseGateWay.GetById(c => c.Id == id);

            RegistrarsDataBaseGateWay      = new RepositoryGateWay <RegistrarsRepository>();
            VaccinationTypeDataBaseGateWay = new RepositoryGateWay <VaccinationTypesRepository>();

            registrar        = RegistrarsDataBaseGateWay.GetById(c => c.Id == vaccinationReservation.RegistrarId);
            VaccinationTypes = VaccinationTypeDataBaseGateWay.GetById(c => c.Id == vaccinationReservation.VaccinationTypeId);
            return(new VaccinationReservationDataModel
            {
                Id = vaccinationReservation.Id,
                RegistrarId = vaccinationReservation.RegistrarId,
                Registrar = new RegistrarsDataModel {
                    Name = registrar.Name, Telephone = registrar.Telephone
                },
                VaccinationType = new VaccinationTypesDataModel {
                    Name = VaccinationTypes.Name
                },

                ReservationDateTime = vaccinationReservation.ReservationDateTime
            });
        }