Пример #1
0
        public IEnumerable <Presupuesto> GetAll(Guid id)
        {
            IEnumerable <Presupuesto> presupuestos = PresupuestosDAL.GetChildren(id);

            foreach (Presupuesto presupuesto in presupuestos)
            {
                IEnumerable <PresupuestoItem> items = PresupuestoItemDAL.GetChildren(presupuesto.Id);
                presupuesto.Items = items.ToList();
            }
            return(presupuestos);
        }
Пример #2
0
        public Guid Delete(Guid cotizacionId)
        {
            IEnumerable <Presupuesto> presupuestos = PresupuestosDAL.GetChildren(cotizacionId);

            foreach (var presupuesto in presupuestos)
            {
                PresupuestoItemsDAL.DeleteChildren(presupuesto.Id);
            }
            PresupuestosDAL.DeleteChildren(cotizacionId);
            CotizacionesDAL.Delete(cotizacionId);
            return(cotizacionId);
        }
Пример #3
0
 public void Delete(Guid id)
 {
     PresupuestoItemDAL.DeleteChildren(id);
     PresupuestosDAL.Delete(id);
 }
Пример #4
0
 public Presupuesto Update(Guid id, Presupuesto model)
 {
     this.SaveChildren(model.Items);
     BO.Presupuesto modelUpdated = PresupuestosDAL.Update(id, model);
     return(modelUpdated);
 }
Пример #5
0
        public Guid Save(Presupuesto model)
        {
            Guid saveId = PresupuestosDAL.Save(model);

            return(saveId);
        }