Exemple #1
0
        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);
            }
        }
Exemple #2
0
 public Update()
 {
     InitializeComponent();
     for (int i = 0; i < Data.Length; i++)
     {
         Data[i] = new ClsEmployee();
     }
 }
Exemple #3
0
        public Form3()
        {
            InitializeComponent();


            //Initialize all elements to instances of the ClsEmployee Class:
            for (int i = 0; i < empArray2.Length; i++)
            {
                empArray2[i] = new ClsEmployee();
            }
        }
Exemple #4
0
        private void button2_Click(object sender, EventArgs e)
        {
            SubClsTxtFileIO objSubClsTxtFileIO = new SubClsTxtFileIO();

            ClsEmployee[] empArray = new ClsEmployee[200];

            //Initialize all elements to instances of the ClsEmployee Class:
            for (int i = 0; i < empArray.Length; i++)
            {
                empArray[i] = new ClsEmployee();
            }

            listBox1.Items.Clear();



            objSubClsTxtFileIO.PopulateEmployees(empArray);

            //MessageBox.Show("Made It");
            for (int i = 0; i < objSubClsTxtFileIO.RecordsRead; i++)
            {
                listBox1.Items.Add(empArray[i].EmployeeFName + " " + empArray[i].PhoneNumber);
            }
        }