Example #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);
            }
        }
        public static IDriverLicenseManager CreateNew(uint driverID = 0)
        {
            var manager = new DriverLicenseManager();
            manager.ActiveModel.DriverID = driverID;
            manager.ActiveModel.IssueDate = DateTime.Now.Date;
            manager.ActiveModel.ExpirationDate = DateTime.Now.Date.AddYears(1);
            manager.ActiveModel.MVRReviewDate = DateTime.Now.Date.AddYears(1);
            manager.RefreshPermits();

            return manager;
        }
        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;
            }
        }
Example #4
0
        public static IDriverLicenseManager CreateNew(uint driverID = 0)
        {
            var manager = new DriverLicenseManager();

            manager.ActiveModel.DriverID       = driverID;
            manager.ActiveModel.IssueDate      = DateTime.Now.Date;
            manager.ActiveModel.ExpirationDate = DateTime.Now.Date.AddYears(1);
            manager.ActiveModel.MVRReviewDate  = DateTime.Now.Date.AddYears(1);
            manager.RefreshPermits();

            return(manager);
        }
        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;
            }
        }
Example #6
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);
            }
        }