/// <summary> /// fazla mesai saati * fazla mesai saat ücreti hesaplar /// </summary> /// <param name="employee"></param> /// <returns></returns> public decimal GetOvertimeWage(EmployeeOvertime employeeOvertime) { if (employeeOvertime == null || employeeOvertime.EmployeeOvertimeWorkings == null) { return(0); } return(employeeOvertime.PerHour * employeeOvertime.EmployeeOvertimeWorkings.Sum(s => s.WorkingHours)); }
private void saveShift() { //Reset original list to new list shift.emplshift_list = new List <EmployeeOvertime>(); for (int i = 0; i < selected_employees.Count; i++) { EmployeeOvertime eo = new EmployeeOvertime(); eo.employee_id = selected_employees[i]; eo.overtime = 0; shift.emplshift_list.Add(eo); } db_manager.update(shift); }
public bool Insert(EmployeeOvertimeVM employeeovertimeVM) { var push = new EmployeeOvertime(employeeovertimeVM); var getEmployee = applicationContext.Employees.SingleOrDefault(x => x.IsDelete == false && x.Id == employeeovertimeVM.EmployeeId); push.Employee = getEmployee; var getOvertime = applicationContext.OvertimeRequests.SingleOrDefault(x => x.IsDelete == false && x.Id == employeeovertimeVM.OvertimeRequestId); push.OvertimeRequest = getOvertime; applicationContext.EmployeeOvertimes.Add(push); var result = applicationContext.SaveChanges(); return(result > 0); }