Beispiel #1
0
        public static IDriverLicenseManager CreateEdit(uint driverLicenseID)
        {
            using (var db = DB.GetContext())
            {
                var manager = new DriverLicenseManager();
                manager.ActiveModel = DriverLicenseRepository.GetDriverLicense(db, driverLicenseID);
                manager.RefreshPermits();

                return(manager);
            }
        }
Beispiel #2
0
        public static IDriverLicenseManager CreateRenew(uint oldDriverLicenseID)
        {
            using (var db = DB.GetContext())
            {
                var manager = new DriverLicenseManager();
                manager.ActiveModel = DriverLicenseRepository.GetDriverLicense(db, oldDriverLicenseID);
                manager.ActiveModel.DriverLicenseID = 0;
                manager.ActiveModel.IssueDate       = manager.ActiveModel.ExpirationDate.AddDays(1);
                manager.ActiveModel.ExpirationDate  = manager.ActiveModel.IssueDate.AddYears(1);
                if (manager.ActiveModel.MVRReviewDate.HasValue)
                {
                    manager.ActiveModel.MVRReviewDate = manager.ActiveModel.MVRReviewDate.Value.AddYears(1);
                }

                manager.RefreshPermits();

                return(manager);
            }
        }