Exemple #1
0
        public bool Update(Servicio entity)
        {
            Servicio servicioC = new Servicio {
                IdServicio  = entity.IdServicio,
                Name        = entity.Name,
                Description = entity.Description,
                Cost        = entity.Cost,
            };

            try {
                context.servicio.Add(servicioC);
                context.SaveChanges();
                var servicioId = servicioC.IdServicio;
                foreach (var item in entity.DetalleSupplier)
                {
                    DetalleServiceSupplier detalle = new DetalleServiceSupplier {
                        // SupplierId =item.SupplierId ,
                        //ServiceId = servicioId,
                    };
                    context.detalleServiceSupplier.Add(detalle);
                }
                context.SaveChanges();
            } catch (Exception) {
                return(false);
            }
            return(true);
        }
 public bool Save(DetalleServiceSupplier entity)
 {
     try
     {
         context.Add(entity);
         context.SaveChanges();
     }
     catch (System.Exception)
     {
         return(false);
     }
     return(true);
 }
        public DetalleServiceSupplier Get(int id)
        {
            var result = new DetalleServiceSupplier();

            try
            {
                result = context.detalleServiceSupplier.Single(x => x.IdDetalleServiceSupplier == id);
            }

            catch (System.Exception)
            {
                throw;
            }
            return(result);
        }
 public bool Update(DetalleServiceSupplier entity)
 {
     throw new System.NotImplementedException();
     //FALTA
 }
 public bool Update(DetalleServiceSupplier entity)
 {
     return(detalleServiceSupplierRepository.Update(entity));
 }