Beispiel #1
0
        public void ConfirmFaultEdit(int faultId, string buildingAddress, int residenceNumber,
                                     string description, string state)
        {
            var building    = residencesService.GetSingleBuilding(buildingAddress);
            var residenceId = residencesService.GetSingleResidenceByNumber(building.id_budynku, residenceNumber).id_mieszkania;

            var newRental = new FaultViewModel()
            {
                id_usterki    = faultId,
                id_mieszkania = residenceId,
                opis          = description,
                stan          = state
            };

            faultService.AddOrEditFault(ViewModelMapper.Mapper.Map <FaultModel>(newRental));
        }
Beispiel #2
0
        public void ConfirmRentalEdit(int rentalId, string residentPESEL, string buildingAddress,
                                      int residenceNumber, DateTime?startDate, DateTime?expiringDate, float?rentalPrice)
        {
            var residentId  = residentService.GetSingleResident(residentPESEL).id_najemcy;
            var building    = residencesService.GetSingleBuilding(buildingAddress);
            var residenceId = residencesService.GetSingleResidenceByNumber(building.id_budynku, residenceNumber).id_mieszkania;

            var newRental = new StrictRentalDataViewModel()
            {
                cena_miesieczna  = rentalPrice,
                data_rozpoczecia = startDate,
                data_zakonczenia = expiringDate,
                id_mieszkania    = residenceId,
                id_najemcy       = residentId,
                id_wynajmu       = rentalId
            };

            rentalService.AddOrEditRental(ViewModelMapper.Mapper.Map <StrictRentalDataModel>(newRental));
        }