private void button2_Click(object sender, EventArgs e) { Data[location] = new ClsEmployee(); if (location != 2) { for (int i = location; i <= totalNum - 1; i++) { Data[i] = Data[i + 1]; } } else { location = -1; } totalNum--; ClsTxtFileIO objFile = new ClsTxtFileIO(); objFile.CreateFile(); for (int i = 0; i <= totalNum - 1; i++) { objFile.AppendRecords(Data[i].EmployeeFName, Data[i].EmployeeLName, Data[i].Department, Data[i].PhoneNumber, Data[i].AnnualSalary, Data[i].VacationDaysEarned); } }
private void button2_Click(object sender, EventArgs e) { try { Data[location].VacationDaysEarned = textBox1.Text; } catch { Console.WriteLine("ERR"); textBox1.Text = ""; textBox1.Focus(); } ClsTxtFileIO objFile = new ClsTxtFileIO(); objFile.CreateFile(); for (int i = 0; i <= totalNum - 1; i++) { objFile.AppendRecords(Data[i].EmployeeFName, Data[i].EmployeeLName, Data[i].Department, Data[i].PhoneNumber, Data[i].AnnualSalary, Data[i].VacationDaysEarned); } }
private void button4_Click(object sender, EventArgs e) { ClsTxtFileIO objFile = new ClsTxtFileIO(); objFile.CreateFile(); }