public void gewinnVerlustRechnung(string _url, Aktie _aktie) { string aktienID = _aktie.id.ToString(); showAktien(_url, 0); foreach (string s in availableAktienList) { if (s.Contains(aktienID)) { string[] splittedString = s.Split(';'); string name = splittedString[0].Split(':')[1]; string id = splittedString[1].Split(':')[1]; string course = splittedString[2].Split(':')[1]; string amount = splittedString[3].Split(':')[1]; Console.WriteLine("------------------------------------------"); Console.WriteLine("Status der gekauften Aktie:"); Console.WriteLine("Name: " + _aktie.name + ", Course: " + _aktie.course + ", Amount: " + _aktie.amount + ", ID: " + _aktie.id); Console.WriteLine("------------------------------------------"); Console.WriteLine("Status der Aktie der URL:"); Console.WriteLine("Name: " + name + ", Course: " + course + ", Amount: " + amount + ", ID: " + id); } } }
static void Main(string[] args) { string externURL1 = "https://boerse.pwnhofer.at"; string internURL = "http://ec2-35-165-217-150.us-west-2.compute.amazonaws.com:4000"; // USER externe Aktionen Customer cust1 = new Customer("Stephanie", "Kaschnitz", "05.07.1992", "Testaddresse 1", "Salzburg", "06641234567"); Customer cust2 = new Customer("Christopher", "Wieland", "10.10.1993", "Testaddresse 2", "Salzburg", "06641278567"); // USER interne Aktionen // Verkauf Customer cust3 = new Customer("Martin", "Wieser", "07.12.1991", "Testaddresse 3", "Salzburg", "06641279567"); Customer cust4 = new Customer("John", "Doe", "21.11.1994", "Testaddresse 4", "Salzburg", "06641273453"); Customer cust5 = new Customer("Max", "Mustermann", "13.07.1990", "Testaddresse 5", "Salzburg", "06641662567"); // Kauf Customer cust6 = new Customer("Julia", "Musterfrau", "30.05.1992", "Testaddresse 6", "Salzburg", "06641789567"); Customer cust7 = new Customer("Julian", "Lipp", "22.01.1993", "Testaddresse 7", "Salzburg", "06641212347"); Customer cust8 = new Customer("Herbert", "Trinkdas", "01.02.1993", "Testaddresse 8", "Salzburg", "06641276666"); // Initialisieren init(cust1, cust3, cust4, cust5, externURL1, internURL); List <Aktie> aktienList1 = cust1.depot.getUserAktienList(); // Gewinn Verlust Aktie aktie = aktienList1[0]; cust1.depot.gewinnVerlustRechnung(externURL1, aktie); // User verkauft extern verkauf(cust1, externURL1); // User kauft extern kauf(cust2, externURL1); // 3 User verkaufen intern verkauf(cust3, internURL); verkauf(cust4, internURL); verkauf(cust5, internURL); // 3 User kaufen intern kauf(cust6, internURL); kauf(cust7, internURL); kauf(cust8, internURL); Console.ReadKey(); }