public bool ExisteClienteEnPresupuesto(ClienteBE Cli) { PresupuestoBLL bllPres = new PresupuestoBLL(); List <PresupuestoBE> ListaPresup = new List <PresupuestoBE>(bllPres.ListarPresupuestos()); bool Existe = false; foreach (PresupuestoBE Presup in ListaPresup) { if (Presup.Cliente.Id == Cli.Id) { Existe = true; break; } } return(Existe); }
public BE.PedidoBE PresupuestoToPedido(PresupuestoBE Pres) // Crear el Pedido en Base a un Presupesto { PresupuestoBLL presBLL = new PresupuestoBLL(); Pres = presBLL.SeleccionarPresupuestoPorId(Pres.Id); // Traer los items del presupuesto de la DB PedidoBE nPedido = new PedidoBE(Pres.Cliente, Pres); nPedido.Descuento = Pres.Descuento; nPedido.Impuestos = Pres.Iva; nPedido.Total = Pres.Total; foreach (PresupuestoItemBE item in Pres.Items) { nPedido.AgregarItem(item.Producto, item.Cantidad, item.PrecioUnitario, item.IvaItem, item.TotalItem); } return(nPedido); }
public bool ExisteProductoEnPresupuesto(ProductoBE Prod) { PresupuestoBLL bllPres = new PresupuestoBLL(); List <PresupuestoBE> ListaPresup = new List <PresupuestoBE>(bllPres.ListarPresupuestos()); bool Existe = false; foreach (PresupuestoBE Presup in ListaPresup) { PresupuestoBE checkPres; checkPres = bllPres.SeleccionarPresupuestoPorId(Presup.Id); if (checkPres.Items.Exists(x => x.Producto.Id == Prod.Id)) { Existe = true; break; } } return(Existe); }