public DataTable EmployeeGetWorkedDays(double employeeIDS, DateTime DateFrom, DateTime DateTo) { try { AttendanceLog_Controller WorkedDays = new AttendanceLog_Controller(); return(WorkedDays.EmployeeGetWorkedDays(employeeIDS, DateFrom, DateTo)); } catch (Exception ex) { MessageBox.Show(ex.Message.ToString()); return(null); } }
private void axCZKEM1_OnAttTransactionEx(string sEnrollNumber, int iIsInValid, int iAttState, int iVerifyMethod, int iYear, int iMonth, int iDay, int iHour, int iMinute, int iSecond, int iWorkCode) { AttendanceLog_Controller Attendance = new AttendanceLog_Controller(); DateTime cDate = Convert.ToDateTime(iYear.ToString() + "-" + iMonth.ToString() + "-" + iDay.ToString() + " " + iHour.ToString() + ":" + iMinute.ToString() + ":" + iSecond.ToString()); Attendance.AttendanceInsertUpdate(0, Convert.ToDouble(sEnrollNumber), Convert.ToString(iMachineNumber), cDate, iAttState); AttendanceLogShow(Convert.ToDouble(sEnrollNumber), dtpFromAtt.Value, dtpToAtt.Value); EmployeeGetPic(Convert.ToDouble(sEnrollNumber)); MyAttendanceRuleShow(Convert.ToDouble(sEnrollNumber)); MyAttendanceRuleChange(Convert.ToDouble(sEnrollNumber), dtpFromAtt.Value, dtpToAtt.Value); foreach (DataRow row in Attendance.EmployeeGetWorkedDays(Convert.ToDouble(sEnrollNumber), dtpFromAtt.Value, dtpToAtt.Value).Rows) { lblCredit.Text = "Credit(Days): " + row["Credit"].ToString(); lblLate.Text = "Late|Early Out: " + row["LateEO"].ToString(); } }
public void AttendanceLogShow(double EmployeeIDS, DateTime DateFrom, DateTime DateTo) { try { AttendanceLog_Controller AttendanceGet = new AttendanceLog_Controller(); dgvAttendance.DataSource = AttendanceGet.AttendanceSelect(EmployeeIDS, DateFrom, DateTo); foreach (DataRow row in AttendanceGet.EmployeeGetWorkedDays(Convert.ToDouble(EmployeeIDS), DateFrom, DateTo).Rows) { lblCredit.Text = "Credit(Days): " + row["Credit"].ToString(); lblLate.Text = "Late|Early Out: " + row["LateEO"].ToString(); } //this.dgvAttendance.Columns[0].Visible = false; this.dgvAttendance.Columns[1].Visible = false; this.dgvAttendance.Columns[2].Visible = false; this.dgvAttendance.Columns[3].Width = 300; this.dgvAttendance.Columns[0].Width = 40; this.dgvAttendance.Columns[4].Width = 180; } catch { } }