private void AddBtn_Click(object sender, EventArgs e) { Employee emp = new Employee(NameTB.Text, dateHiredPicker.Value,dateFiredPicker.Text); emp.addToTable(ResultGV); //MessageBox.Show(emp.showName() + " worked " + emp.showExp()); }
public void readData(DataGridView data,string period) { try { string[] lines = File.ReadAllLines("database"); foreach (string line in lines) { String[] cells = line.Split(new Char[] { '|' }); Employee emp = new Employee(cells[0], DateTime.Parse(cells[1]),cells[2]); Employee temp = new Employee(cells[0], DateTime.Parse(cells[1]),period); if (emp.getAdd() < temp.getAdd()) { emp.addToTable(data); } } } catch (IOException e) { MessageBox.Show(e.ToString() + "\n read error@!"); } }