private void Button_Generate_Click(object sender, RoutedEventArgs e) { Date d = new Date(); d.Increment(datecount); datecount++; Entry ent = new Entry(d); dataGrid.DataContext = ent; dataGrid.Items.Add(ent); dataGridp2.Items.Add(1); }
static void Main(string[] args) { int datecount = 0; bool exit = false; string[] lines = { "==============================", "= VicRoads LogBook Generator =", "= v 0.1 =", "==============================\n" }; foreach (string l in lines) { Console.ForegroundColor = ConsoleColor.Green; Console.WriteLine(l); Console.ResetColor(); } int baseHours; int baseMins; int basenighthours; int basenightmins; int odometer; Console.WriteLine("What are your Current Total Drive time (hours)?"); baseHours = Convert.ToInt32(Console.ReadLine()); Console.WriteLine("What are your Current Total Drive time (mins)?"); baseMins = Convert.ToInt32(Console.ReadLine()); Console.WriteLine("What are your Current Total NIGHT Drive time (hours)?"); basenighthours = Convert.ToInt32(Console.ReadLine()); Console.WriteLine("What are your Current Total NIGHT Drive time (mins)?"); basenightmins = Convert.ToInt32(Console.ReadLine()); Console.WriteLine("What are your Current Odometer Reading?"); odometer = Convert.ToInt32(Console.ReadLine()); while (!exit) { Console.WriteLine("Press Enter To Generate an Entry."); Console.ReadLine(); Date d = new Date(); d.Increment(datecount); datecount++; Entry e = new Entry(d); e.nighthrs = basenighthours; e.nightmins = basenightmins; e.thrs = baseHours; e.tmins = baseMins; e.Odometer = odometer; e.PrintEntry(); } }