public static IDriverMedicalManager CreateNew(uint driverID = 0)
        {
            var manager = new DriverMedicalManager();
            manager.ActiveModel.ExaminationDate = DateTime.Now.Date;
            manager.ActiveModel.ValidityDate = DateTime.Now.Date.AddYears(1);

            return manager;
        }
Пример #2
0
        public static IDriverMedicalManager CreateNew(uint driverID = 0)
        {
            var manager = new DriverMedicalManager();

            manager.ActiveModel.ExaminationDate = DateTime.Now.Date;
            manager.ActiveModel.ValidityDate    = DateTime.Now.Date.AddYears(1);

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

                return manager;
            }
        }
Пример #4
0
        public static IDriverMedicalManager CreateEdit(uint driverMedicalID)
        {
            using (var db = DB.GetContext())
            {
                var manager = new DriverMedicalManager();
                manager.ActiveModel = DriverMedicalRepository.GetMedical(db, driverMedicalID);

                return(manager);
            }
        }
        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;
            }
        }
Пример #6
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);
            }
        }