private void getData() { Projekt2Entities p2e = new Projekt2Entities(); var queryResults = from f in p2e.Fahrt //where f.Endzeit == "London" orderby f.Kunde_ID ascending select f; }
public void calcTankstationsInSpace() { Projekt2Entities p2e = new Projekt2Entities(); var queryResults = from f in p2e.Fahrt //where f.Endzeit == "London" orderby f.Kunde_ID ascending select f; foreach (Fahrt f in queryResults) { System.Console.WriteLine(f.Tanksaeule.Tankstelle.Stasse + " : " + upperLeft.GetDistanceTo(new GeoCoordinate((double)f.Tanksaeule.Tankstelle.breitengrad, (double)f.Tanksaeule.Tankstelle.laengengrad))); } }
public void getdata() { int lastKundenId = 0; string lastKundenMail = null; string fileName = null; Document doc = null; Projekt2Entities p2e = new Projekt2Entities(); // query all contacts var queryResults = from f in p2e.Fahrt //where f.Endzeit == "London" orderby f.Kunde_ID ascending select f; foreach (Fahrt f in queryResults) { if (lastKundenId == f.Kunde_ID) { //write into next row of the current table fillContent(f); } else { if (doc != null) { fileName = lastKundenId + "_" + DateTime.Now.ToShortDateString() + ".pdf"; saveDocument(fileName); sendMail(fileName, lastKundenMail); } doc = createDocument(f); fillContent(f); //Start new PDF and send the old one via mail } lastKundenId = (int)f.Kunde_ID; lastKundenMail = f.Kunde.Email; } //Save the last PDF and Send the last mail fileName = lastKundenId + "_" + DateTime.Now.ToShortDateString() + ".pdf"; saveDocument(fileName); sendMail(fileName, lastKundenMail); }