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 button1_Click(object sender, EventArgs e) { ClsTxtFileIO objFile = new ClsTxtFileIO();//Instantiate custom class with Text File IO functions objFile.AppendRecords(textBox7.Text, textBox8.Text, textBox9.Text, textBox10.Text, textBox11.Text, "0"); textBox7.Text = ""; textBox8.Text = ""; textBox9.Text = ""; textBox10.Text = ""; textBox7.Focus(); }
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); } }