private void bindAccessorProcessor(GridViewRowEventArgs e, DropDownList selectDropDown, GridView selectGV) { //get processor and check name string[] splitter = new string[] { PageConstants.GREATER_GREATER_THAN }; string[] VacancyInfoTosplit = (selectDropDown.SelectedValue).Split(splitter, StringSplitOptions.RemoveEmptyEntries); currentVacancyNo = VacancyInfoTosplit[0].Trim(); currentVacancyDate = VacancyInfoTosplit[1].Trim(); resposibleHROfficer = VacancyInfoTosplit[3].Trim(); Vacancy vacancy = new Vacancy(); vacancy.VacancyNo = currentVacancyNo; vacancy.PostedDate = currentVacancyDate; VacancyRegistrationAndEvaluationManager vacancyRegEvaluationManager = new VacancyRegistrationAndEvaluationManager(vacancy); TransactionResponse response = new TransactionResponse(); response = vacancyRegEvaluationManager.getVacancyDetail(vacancy); DataTable employeeData = (DataTable)response.Data; Employee employee = new Employee(); //get list of Employee using Employee manager. if (employeeData != null && employeeData.Rows.Count > 0) { // Display processor and checker in the gridview footer if (e.Row.RowType == DataControlRowType.Footer) { //get processor First name & Middle Name employee.EmpID = employeeData.Rows[0]["responsible_processor_EID"].ToString(); EmployeeManager employeeManager = new EmployeeManager(employee); List<Employee> listOfEmployee = employeeManager.getEmployeeDetial(); string fullName = null; foreach (Employee emply in listOfEmployee) { fullName = emply.FName + " " + emply.MName; } e.Row.Cells[2].Text = "Processed by :"; e.Row.Cells[2].Font.Bold = true; e.Row.Cells[3].Text = fullName; e.Row.Cells[3].Font.Bold = true; //get checkor First name & Middle Name employee.EmpID = employeeData.Rows[0]["reponsible_accessor_EID"].ToString(); employeeManager = new EmployeeManager(employee); listOfEmployee = employeeManager.getEmployeeDetial(); fullName = null; foreach (Employee emply in listOfEmployee) { fullName = emply.FName + " " + emply.MName; } e.Row.Cells[7].Text = "Assessed by :"; e.Row.Cells[7].Font.Bold = true; e.Row.Cells[8].Text = fullName; e.Row.Cells[8].Font.Bold = true; } } else { selectGV.ShowFooter = false; } }
private bool validateInputField() { bool trackAll = true; string remarkRefNo = null; string dateOfRemark = null; string remarkType = null; string penlityType = null; string penlityPer = null; string managerID = null; string remarkReason = null; string branch = null; if (txtRemarkRefNo.Text.Trim() != "") { lblRefNo.Visible = false; remarkRefNo = txtRemarkRefNo.Text.Trim(); } else { lblRefNo.Visible = true; trackAll &= false; } if (txtDateOFRemark.Text.Trim() != "") { lblDateOfRemark.Visible = false; try { dateOfRemark = Convert.ToDateTime(txtDateOFRemark.Text.Trim()).ToShortDateString(); } catch (FormatException) { msgPanel.Visible = true; ErroroDIV.Visible = true; lblErrorMsg.Text = "Please enter the date format in 'MM/dd/YYYY' and then try again."; trackAll &= false; } } else { lblDateOfRemark.Visible = true; trackAll &= false; } if (DropDRemarkType.SelectedValue != "-1") { lblremarkType.Visible = false; remarkType = DropDRemarkType.SelectedValue.Trim(); } else { lblremarkType.Visible = true; trackAll &= false; } if (DropDRemarkType.SelectedValue != "-1") { lblPenality.Visible = false; penlityType = DropDRemarkType.SelectedValue.Trim(); } else { lblPenality.Visible = true; trackAll &= false; } if (DropDRemarkType.SelectedValue == "Bad Remark") { if (RBPenality.SelectedValue != "") { lblPenality.Visible = false; penlityPer = RBPenality.SelectedValue.Trim(); } else { lblPenality.Visible = true; trackAll &= false; } } else if (DropDRemarkType.SelectedValue == "Good Remark") { penlityPer = ""; } if (DropDManagPosition.SelectedValue != "-1") { lblMangID.Visible = false; managerID = DropDManagPosition.SelectedValue; Employee getEmp = new Employee(); getEmp.EmpID = managerID; EmployeeManager employeeManager = new EmployeeManager(getEmp); List<Employee> listOfEmployee = employeeManager.getEmployeeDetial(); if (listOfEmployee != null && listOfEmployee.Count > 0) { foreach (Employee emply in listOfEmployee) { string emp = emply.EmpID; string profession = emply.MajorCategory.Trim(); currentMgtJTitle = emply.JobTitle.Trim(); currentEmpBranch = emply.Branch; } } } else { lblMangID.Visible = true; trackAll &= false; } if (txtRemarkReason.Text.Trim() != "") { lblRemarkReason.Visible = false; remarkReason = txtRemarkReason.Text.Trim(); } else { lblRemarkReason.Visible = true; trackAll &= false; } employeeRemark = new EmployeeRemark(); if (trackAll) { employeeRemark.EmployeeID = txtEmployeeID.Text.Trim(); employeeRemark.RemarkReferanceNo = remarkRefNo; employeeRemark.DateOfRemark = dateOfRemark; employeeRemark.RemarkType = remarkType; employeeRemark.PenaltyPerc = penlityPer; employeeRemark.ManagerID = managerID; employeeRemark.ManagerPosition = currentMgtJTitle; employeeRemark.RemarkReason = remarkReason; employeeRemark.Branch = currentEmpBranch; } return trackAll; }