private void ProcessDailyTimeRecordRegularUI_Load(object sender, EventArgs e) { cboEmploymentType.ValueMember = "Id"; cboEmploymentType.DisplayMember = "Description"; cboEmploymentType.DataSource = loEmploymentType.getAllData("ViewAll", "", ""); cboEmploymentType.SelectedIndex = 1; cboDepartment.ValueMember = "Id"; cboDepartment.DisplayMember = "Description"; cboDepartment.DataSource = loDepartment.getAllData("ViewAll", "", ""); cboDepartment.SelectedIndex = 4; dtpFrom.Value = DateTime.Parse("2018-2-1"); dtpTo.Value = DateTime.Parse("2018-2-28"); }
private void EmployeeDetailUI_Load(object sender, EventArgs e) { try { this.BackColor = Color.FromArgb(int.Parse(GlobalVariables.FormBackColor)); try { cboEmploymentType.DataSource = loEmploymentType.getAllData("ViewAll", "", ""); cboEmploymentType.DisplayMember = "Description"; cboEmploymentType.ValueMember = "Id"; cboEmploymentType.SelectedIndex = -1; } catch { } try { cboDesignation.DataSource = loDesignation.getAllData("ViewAll", "", ""); cboDesignation.DisplayMember = "Description"; cboDesignation.ValueMember = "Id"; cboDesignation.SelectedIndex = -1; } catch { } try { cboDepartment.DataSource = loDepartment.getAllData("ViewAll", "", ""); cboDepartment.DisplayMember = "Description"; cboDepartment.ValueMember = "Id"; cboDepartment.SelectedIndex = -1; } catch { } try { cboImmediateSupervisor.DataSource = loEmployee.getEmployeeNames(); cboImmediateSupervisor.DisplayMember = "Employee Name"; cboImmediateSupervisor.ValueMember = "Id"; cboImmediateSupervisor.SelectedIndex = -1; } catch { } if (lOperation == GlobalVariables.Operation.Edit) { foreach (DataRow _dr in loEmployee.getAllData("", lRecords[0].ToString(), "").Rows) { lId = _dr["Id"].ToString(); txtEmployeeNo.Text = _dr["Employee No."].ToString(); txtLastname.Text = _dr["Lastname"].ToString(); txtFirstname.Text = _dr["Firstname"].ToString(); txtMiddlename.Text = _dr["Middlename"].ToString(); chkActive.Checked = _dr["Active"].ToString() == "Y" ? true : false; txtBiometricsIdNo.Text = _dr["Biometrics Id No."].ToString(); cboEmploymentType.Text = _dr["Employment Type"].ToString(); cboDesignation.Text = _dr["Designation"].ToString(); cboDepartment.Text = _dr["Department"].ToString(); chkNoWorkSchedule.Checked = _dr["No Work Schedule"].ToString() == "Y" ? true : false; cboWorkSchedule.Text = _dr["Work Schedule"].ToString(); dtpBirthday.Value = DateTime.Parse(_dr["Birthday"].ToString()); txtEmailAddress.Text = _dr["Email Address"].ToString(); txtTIN.Text = _dr["TIN"].ToString(); chkTINDeducted.Checked = _dr["TIN Deducted"].ToString() == "Y" ? true : false; txtPhilHealthId.Text = _dr["PhilHealth Id"].ToString(); chkPhilHealthDeducted.Checked = _dr["PhilHealth Deducted"].ToString() == "Y" ? true : false; txtSSSId.Text = _dr["SSS Id"].ToString(); chkSSSDeducted.Checked = _dr["SSS Deducted"].ToString() == "Y" ? true : false; txtPagibigId.Text = _dr["Pagibig Id"].ToString(); chkPagibigDeducted.Checked = _dr["Pagibig Deducted"].ToString() == "Y" ? true : false; txtPagibigEmployeeShare.Text = string.Format("{0:n}", decimal.Parse(_dr["Pagibig(Employee Share)"].ToString())); txtPagibigEmployerShare.Text = string.Format("{0:n}", decimal.Parse(_dr["Pagibig(Employer Share)"].ToString())); txtNoOfDependent.Text = _dr["No. of Dependent"].ToString(); cboRateType.Text = _dr["Rate Type"].ToString(); txtBasicPay.Text = string.Format("{0:n}", decimal.Parse(_dr["Basic Pay"].ToString())); cboImmediateSupervisor.Text = _dr["Immediate Supervisor"].ToString(); txtRemarks.Text = _dr["Remarks"].ToString(); } } } catch (Exception ex) { ErrorMessageUI em = new ErrorMessageUI(ex.Message, this.Name, "EmployeeDetailUI_Load"); em.ShowDialog(); return; } }