static void Main() { DMV myDMV = new DMV(); Vehicle myVehicle = new Vehicle(); myVehicle.LicensePlate = "1ABC23"; myVehicle.VehicleType = "2017 Chevrolet Volt"; myDMV.AddVehicle(myVehicle); Vehicle myVehicle2 = new Vehicle(); myVehicle2.LicensePlate = "2DEF34"; myVehicle2.VehicleType = "2015 Hyundai Elantra"; myDMV.AddVehicle(myVehicle2); Vehicle myVehicle3 = new Vehicle(); myVehicle3.LicensePlate = "3GHI45"; myVehicle3.VehicleType = "1995 Ford Ranger"; myDMV.AddVehicle(myVehicle3); }
static void Main() { HashSet <DMV> set = new HashSet <DMV>(); bool DidItAddTheItem = false; DMV myDMV = new DMV(); TagInfo myTag = new TagInfo(); myTag.TagNumber = "4503"; myTag.TagState = "South Carolina"; myDMV.AddTag(myTag); DidItAddTheItem = set.Add(myDMV); Console.WriteLine(DidItAddTheItem); TagInfo myTag2 = new TagInfo(); myTag2.TagNumber = "4504"; myTag2.TagState = "North Carolina"; myDMV.AddTag(myTag); DidItAddTheItem = set.Add(myDMV); Console.WriteLine(DidItAddTheItem); myDMV.ShowTags(); foreach (var item in set) { Console.WriteLine(item.); } }
private void SendDMVNotification(int accountId, DMV dmv) { Account account = _repositoryFactory.AccountRepository.GetAccountById(accountId); account.DecryptModel(); _mailService.SendDMVNotification(account.firstName + " " + account.lastName, account.drivingLicense, dmv.type, dmv.offenseDate.ToString(), dmv.id, dmv.drivingLicense); }
public void GetLicensePlate() { var plate = DMV.GetPlate(); Assert.AreEqual(6, plate.Length); Assert.AreEqual(1, DMV.Plates.Count); Assert.AreEqual(plate, DMV.Plates[0]); }
public ActionResult Edit([Bind(Include = "ID, Permit, FullName,DOB,ResidenceAddress,City,StateAbbreviated,ZipCode,County")] DMV dmv) { ViewBag.Title = "Edit a resident"; if (ModelState.IsValid) { db.Entry(dmv).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(dmv)); }
public ActionResult Create([Bind(Include = "ID, Permit, FullName,DOB,ResidenceAddress,City,StateAbbreviated,ZipCode,County")] DMV dmv) { ViewBag.Title = "Add a new resident"; if (ModelState.IsValid) { db.DMVs.Add(dmv); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(dmv)); }
/// <summary> /// Returns the data row associated with the ID passed. /// If not ID was passed returns HttpBadRequest, if ID isn't part /// of the table returns HttpNotFound, else allows you to edit that row /// </summary> /// <param name="id">ID of row to edit</param> /// <returns>The Edit page with the rows data filled in the form</returns> public ActionResult Edit(int?id) { ViewBag.Title = "Edit a resident"; if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } DMV dmv = db.DMVs.Find(id); if (dmv == null) { return(HttpNotFound()); } return(View(dmv)); }
static void Main(string[] args) { DMV dmv = new DMV(); LincensePlateInfo firstLicensePlate = new LincensePlateInfo(); firstLicensePlate.LincensePlate = "YHG567"; firstLicensePlate.State = "TX"; firstLicensePlate.LincensePlate = "IUE098"; firstLicensePlate.State = "TX"; LincensePlateInfo secondLicensePlate = new LincensePlateInfo(); dmv.AddLincesPlate(firstLicensePlate); dmv.AddLincesPlate(secondLicensePlate); }
static void Main() { DMV myDMV = new DMV(); TagInfo myTag = new TagInfo(); myTag.TagNumber = "4503"; myTag.TagState = "South Carolina"; myDMV.AddTag(myTag); TagInfo myTag2 = new TagInfo(); myTag2.TagNumber = "4504"; myTag2.TagState = "North Carolina"; myDMV.AddTag(myTag); myDMV.ShowTags(); }