private void FillEmployeeList() { Attendance.dsAttendance ds = new Attendance.dsAttendance(); Attendance.dsAttendanceTableAdapters.vEmployeeComboTableAdapter taAttendance = new Attendance.dsAttendanceTableAdapters.vEmployeeComboTableAdapter(); taAttendance.Fill(ds.vEmployeeCombo); cmbEmployee.ValueMember = "EmployeeId"; cmbEmployee.DisplayMember = "EmployeeName"; cmbEmployee.DataSource = ds.vEmployeeCombo.DefaultView; }
private void cmbEmployee_SelectedIndexChanged(object sender, EventArgs e) { Int32 RecordId = 0; if (Convert.ToInt32(cmbEmployee.SelectedValue) > 0) { RecordId = Convert.ToInt32(cmbEmployee.SelectedValue); } Attendance.dsAttendance ds = new Attendance.dsAttendance(); Attendance.dsAttendanceTableAdapters.vEmployeeFormTableAdapter taAttendance = new Attendance.dsAttendanceTableAdapters.vEmployeeFormTableAdapter(); taAttendance.FillByEmpId(ds.vEmployeeForm, RecordId); var employee = ds.vEmployeeForm.NewvEmployeeFormRow(); if (ds.vEmployeeForm.Rows.Count > 0) { employee = ds.vEmployeeForm[0]; tbxCode.Text = String.Format(" {0:0000}", employee.Code); ImageId = employee.EmployeeId; } }