/*************************************** * * This is where the UTILITY METHODS are. * ***************************************/ /// <summary> /// This clears the form after an entry is added. /// </summary> private void ClearForm() { TxtEmpID.Clear(); TxtFirstName.Clear(); TxtLastName.Clear(); TxtMiddleName.Clear(); TxtXtraProp1.Clear(); TxtXtraProp2.Clear(); CkbActiveEmployee.Checked = true; CkbBenefits.Checked = true; CkbApproved.Checked = true; LVxCourses.Items.Clear(); TxtCourseID.Clear(); TxtGrade.Clear(); TxtDescription.Clear(); TxtDateApproved.Clear(); TxtCredits.Clear(); TxtMaritalStatus.Clear(); TxtDepartment.Clear(); TxtTitle.Clear(); TxtStartDate.Clear(); }
/// <summary> /// Purpose: To set and display the GUI Interface to the proper Employee Type /// </summary> /// <param name="type">ETYPE - Sal, SLS, HRLY, CNCT, NONE, BAD</param> public void SetGUIState(ETYPE type) { switch (type) { case ETYPE.SAL: RBtnSalary.Checked = true; LblValue0.Text = SALY; TxtValue0.Text = string.Format(FMTC, _eList[_count].MonthlySalary); RTxtDisplay.AppendText(TxtValue0.Text + CRLF); LblValue1.Hide(); TxtValue1.Hide(); LblValue2.Hide(); TxtValue2.Hide(); _count++; break; case ETYPE.HRLY: RBtnHourly.Checked = true; LblValue0.Text = HRLYRATE; TxtValue0.Text = string.Format(FMTC, _eList[_count].HourlyRate); RTxtDisplay.AppendText(TxtValue0.Text + CRLF); LblValue1.Text = HRSWORK; LblValue1.Show(); TxtValue1.Text = string.Format(FMTF, _eList[_count].HoursWorked); RTxtDisplay.AppendText(TxtValue1.Text + CRLF); TxtValue1.Show(); LblValue2.Hide(); TxtValue2.Hide(); _count++; break; case ETYPE.SLS: RBtnSales.Checked = true; LblValue0.Text = SALEMP; TxtValue0.Text = string.Format(FMTC, _eList[_count].MonthlySalary); LblValue1.Text = COMMSALES; LblValue1.Show(); TxtValue1.Text = string.Format(FMTP, _eList[_count].ComSales); RTxtDisplay.AppendText(TxtValue1.Text + CRLF); TxtValue1.Show(); LblValue2.Text = GROSSALES; TxtValue2.Text = string.Format(FMTC, _eList[_count].GrossSales); LblValue2.Show(); RTxtDisplay.AppendText(TxtValue2.Text + CRLF); TxtValue2.Show(); _count++; break; case ETYPE.CNCT: RBtnContract.Checked = true; LblValue0.Text = "Salary:"; TxtValue0.Text = string.Format(FMTC, _eList[_count].ContractSalary); RTxtDisplay.AppendText(TxtValue0.Text + CRLF); LblValue1.Hide(); TxtValue1.Hide(); LblValue2.Hide(); TxtValue2.Hide(); _count++; break; case ETYPE.NONE: RBtnSalary.Checked = false; RBtnHourly.Checked = false; RBtnSales.Checked = false; RBtnContract.Checked = false; TxtEmpID.Text = "" + _eList[_count].EmpID; TxtName.Text = _eList[_count].EmpName; TxtValue0.Text = string.Format(FMTC, _eList[_count].MonthlySalary); LblValue1.Hide(); TxtValue1.Hide(); LblValue2.Hide(); TxtValue2.Hide(); _count++; //goto case ETYPE.SAL; break; default: RBtnSalary.Checked = false; RBtnHourly.Checked = false; RBtnSales.Checked = false; RBtnContract.Checked = false; MessageBox.Show(MSG_IVT, MSG_IT, MessageBoxButtons.OKCancel, MessageBoxIcon.Error); TxtEmpID.Clear(); TxtName.Clear(); TxtEmpType.Text = "" + _eList[_count].EmpType; LblValue0.Text = LABELN; TxtValue0.Clear(); LblValue1.Hide(); TxtValue1.Hide(); LblValue2.Hide(); TxtValue2.Hide(); _count++; //goto case ETYPE.SAL; break; } }