public void GuardarHorarioExtra(int idPlanilla, PlanillaModel planillaModel) { if (planillaModel.HorasExtra > 0) { horarioextra HorasExtra = new horarioextra() { idEmpleado = planillaModel.IdEmpleado, idPlanilla = idPlanilla }; HorasExtra.tipohora = sb.tipohora.Where(x => x.tipo == "extra normal").FirstOrDefault(); HorasExtra.horas = (double)planillaModel.HorasExtra; sb.horarioextra.Add(HorasExtra); } if (planillaModel.HorasNocturnasExtra > 0) { horarioextra HorasExtra = new horarioextra() { idEmpleado = planillaModel.IdEmpleado, idPlanilla = idPlanilla }; HorasExtra.tipohora = sb.tipohora.Where(x => x.tipo == "extra nocturna").FirstOrDefault(); HorasExtra.horas = (double)planillaModel.HorasNocturnasExtra; sb.horarioextra.Add(HorasExtra); } if (planillaModel.HorasAsueto > 0) { horarioextra HorasExtra = new horarioextra() { idEmpleado = planillaModel.IdEmpleado, idPlanilla = idPlanilla }; HorasExtra.tipohora = sb.tipohora.Where(x => x.tipo == "extra nocturna").FirstOrDefault(); HorasExtra.horas = (double)planillaModel.HorasAsueto; sb.horarioextra.Add(HorasExtra); } if (planillaModel.HorasDescanso > 0) { horarioextra HorasExtra = new horarioextra() { idEmpleado = planillaModel.IdEmpleado, idPlanilla = idPlanilla }; HorasExtra.tipohora = sb.tipohora.Where(x => x.tipo == "extra nocturna").FirstOrDefault(); HorasExtra.horas = (double)planillaModel.HorasDescanso; sb.horarioextra.Add(HorasExtra); } }
public HorarioExtra(int planilla, horarioextra he) { }