public DriversLicense IssueNewLicense(NorthAmerican amer, DateTime? issuedDate = null) { if(format == null || !format.Any() || IssuingState == null) throw new ItsDeadJim("Cannot issue a DL with having a DL Format and IssuingState"); if (amer == null) return new DriversLicense(format, IssuingState); var dl = new DriversLicense(format, IssuingState) { Dob = amer.BirthCert.DateOfBirth, FullLegalName = string.Join(" ", amer.FirstName.ToUpper(), amer.MiddleName.ToUpper(), amer.LastName.ToUpper()), Gender = amer.MyGender, PrincipalResidence = amer.Address.ToString(), IssuedDate = issuedDate ?? Etx.Date(-5, DateTime.Today) }; return dl; }
/// <summary> /// Resolves the <see cref="Gov.DriversLicense"/> which was /// current at <see cref="dt"/> /// </summary> /// <param name="dt">Null for the current time</param> /// <returns></returns> public virtual DriversLicense GetDriversLicenseAt(DateTime? dt) { if (GetAgeAt(dt) < UsState.MIN_AGE_FOR_DL) return null; if (_dl != null) return _dl; var csz = GetAddressAt(dt)?.HomeCityArea; var amerCsz = csz as UsCityStateZip; var dlFormats = amerCsz?.State.DriversLicenseFormats; if (dlFormats == null || !dlFormats.Any()) return null; _dl = dlFormats[0].IssueNewLicense(this, dt); return _dl; }
public Connecticut() : base("CT") { var dl = new Rchar[9]; dl[0] = new LimitedRchar(0,'0'); dl[1] = new LimitedRchar(1, '1', '2', '3', '4', '5', '6', '7', '8', '9'); Array.Copy(Numerics(7, 2), 0, dl, 2, 7); var dlf00 = new DriversLicense(dl, this); dl = new Rchar[9]; dl[0] = new LimitedRchar(0, '1'); Array.Copy(Numerics(8, 1), 0, dl, 1, 8); var dlf01 = new DriversLicense(dl, this); dl = new Rchar[9]; dl[0] = new LimitedRchar(0, '2'); dl[1] = new LimitedRchar(1, '0', '1', '2', '3', '4'); Array.Copy(Numerics(7, 2), 0, dl, 2, 7); var dlf02 = new DriversLicense(dl, this); dlFormats = new[] {dlf00, dlf01, dlf02}; }