private static void bucle1(DetallesHabitacion tur, Tarifa tarAct, DateTime now, Tarifa tar, DataGridViewRow dr) { decimal precioTotal = tools.redondeo(contPernocte[tur.nroHab] + tarAct.PrecioExtension()); if (precioTotal >= tarAct.precioTN) // Si { decimal montoAsumar = tools.redondeo(tarAct.precioTN - contPernocte[tur.nroHab]); tur.impHabitacion += montoAsumar; if (now.TimeOfDay > tarAct.hasta.TimeOfDay) tur.hasta = new DateTime(now.AddDays(1).Year, now.AddDays(1).Month, now.AddDays(1).Day, tarAct.hasta.Hour, tarAct.hasta.Minute,0); else tur.hasta = new DateTime(now.Year, now.Month, now.Day, tarAct.hasta.Hour, tarAct.hasta.Minute, 0); updateDetallesTurno(tur.nroHab, montoAsumar, tur.hasta, tarAct.precioTN, dr); contPernocte[tur.nroHab] = tarAct.precioTN; } else // No { bucle4(true, tur, tur.nroHab, now, tar, dr); } }
static void bucle4(bool sumCont, DetallesHabitacion tur, int nroHab, DateTime hora, Tarifa tar, DataGridViewRow dr) { decimal monto; Tarifa tarSig = obtenerTarSiguiente(tur.catId, Calendario.nroDia(DateTime.Now), Calendario.nroDiaSig(DateTime.Now), hora); if (tur.hasta.AddMinutes(tar.extension) > tarSig.desde) { monto = calcularPrecioExtDesdeHasta(tar, tur.hasta, tarSig.desde); tur.hasta = new DateTime(tur.hasta.Year, tur.hasta.Month, tur.hasta.Day, tarSig.desde.Hour, tarSig.desde.Minute, 0); } else { monto = tar.PrecioExtension(); tur.hasta = tur.hasta.AddMinutes(tar.extension); } monto = tools.redondeo(monto); tur.impHabitacion += monto; if (sumCont) contPernocte[nroHab] += monto; updateDetallesTurno(nroHab, monto, tur.hasta, contPernocte[nroHab], dr); }
private static void bucle1(DetallesHabitacion tur, Tarifa tarAct, DateTime now, Tarifa tar, DataGridViewRow dr) { decimal precioTotal = tools.redondeo(contPernocte[tur.nroHab] + tarAct.PrecioExtension()); if (precioTotal >= tarAct.precioTN) // Si supero el precio turno noche { decimal montoAsumar = tools.redondeo(tarAct.precioTN - contPernocte[tur.nroHab]); tur.impHabitacion += montoAsumar; tur.hasta = tarAct.hasta; updateDetallesTurno(tur.nroHab, montoAsumar, tur.hasta, tarAct.precioTN, dr); contPernocte[tur.nroHab] = tarAct.precioTN; } else // No { bucle4(true, tur, tur.nroHab, now, tarAct, dr); } }