// display method displays current data saved in WorkLogs.txt public string display(string[] _date, double[] _hours, int _num) { WorkLogMethods wl = new WorkLogMethods(); try { StreamReader text = new StreamReader("WorkLogs.txt"); string readmetext = text.ReadToEnd(); text.Close(); return readmetext; } catch (FileNotFoundException) { string notExistsText = "There are no Work Logs created yet!"; return notExistsText; } }
private void btnDisplay_MouseClick(object sender, MouseEventArgs e) { WorkLogMethods w1 = new WorkLogMethods(); string text = w1.display(date, hours, numEntries); txtDisplayArea.Text = text; }
private void btnAdd_MouseClick(object sender, MouseEventArgs e) { WorkLogMethods w1 = new WorkLogMethods(); numEntries = w1.add(date, hours, numEntries); }