private void SaveData_Time() { timeMaster = new Master_EmployeeManagement(); for (int i = 0; i < dgvEmployee.RowCount; i++) { string a = dgvEmployee.Rows[i].Cells[(int)employee.employeeID].Value == null ? string.Empty : dgvEmployee.Rows[i].Cells[(int)employee.employeeID].Value.ToString(); string b = dgvEmployee.Rows[i].Cells[(int)employee.timeIN].Value == null ? string.Empty : dgvEmployee.Rows[i].Cells[(int)employee.timeIN].Value.ToString().Replace(".", ":"); string c = dgvEmployee.Rows[i].Cells[(int)employee.timeOUT].Value == null ? string.Empty : dgvEmployee.Rows[i].Cells[(int)employee.timeOUT].Value.ToString().Replace(".", ":"); string d = dgvEmployee.Rows[i].Cells[(int)employee.note].Value == null ? string.Empty : dgvEmployee.Rows[i].Cells[(int)employee.note].Value.ToString(); timeMaster.Add_TimeWork(dtpDate.Value , a , b.ToString().Replace(".", ":") , c.ToString().Replace(".", ":") , d , AppCrash.Login); } }
private void getData_Time() { timeMaster = new Master_EmployeeManagement(); for (int i = 0; i < dgvEmployee.RowCount; i++) { Employee_GetTimeWork_Result result = timeMaster.Get_TimeWork( dtpDate.Value, Convert.ToInt32(dgvEmployee.Rows[i].Cells[(int)employee.employeeID].Value.ToString())); if (result != null) { dgvEmployee.Rows[i].Cells[(int)employee.timeIN].Value = result.timeIN; dgvEmployee.Rows[i].Cells[(int)employee.timeOUT].Value = result.timeOUT; dgvEmployee.Rows[i].Cells[(int)employee.note].Value = result.note; } else { dgvEmployee.Rows[i].Cells[(int)employee.timeIN].Value = "-"; dgvEmployee.Rows[i].Cells[(int)employee.timeOUT].Value = "-"; dgvEmployee.Rows[i].Cells[(int)employee.note].Value = "-"; } } }