Beispiel #1
0
        public static IDriverMedicalManager CreateEdit(uint driverMedicalID)
        {
            using (var db = DB.GetContext())
            {
                var manager = new DriverMedicalManager();
                manager.ActiveModel = DriverMedicalRepository.GetMedical(db, driverMedicalID);

                return(manager);
            }
        }
Beispiel #2
0
        public static IDriverMedicalManager CreateNewFromOld(uint oldDriverMedicalID)
        {
            using (var db = DB.GetContext())
            {
                var manager = new DriverMedicalManager();
                manager.ActiveModel = DriverMedicalRepository.GetMedical(db, oldDriverMedicalID);
                manager.ActiveModel.DriverMedicalID = 0;
                manager.ActiveModel.ExaminationDate = manager.ActiveModel.ExaminationDate.Date.AddDays(1);
                manager.ActiveModel.ValidityDate    = manager.ActiveModel.ExaminationDate.Date.AddYears(1);

                return(manager);
            }
        }