コード例 #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);
        }
コード例 #2
0
 public bool Save(DetalleServiceSupplier entity)
 {
     try
     {
         context.Add(entity);
         context.SaveChanges();
     }
     catch (System.Exception)
     {
         return(false);
     }
     return(true);
 }
コード例 #3
0
        public DetalleServiceSupplier Get(int id)
        {
            var result = new DetalleServiceSupplier();

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

            catch (System.Exception)
            {
                throw;
            }
            return(result);
        }
コード例 #4
0
 public bool Update(DetalleServiceSupplier entity)
 {
     throw new System.NotImplementedException();
     //FALTA
 }
コード例 #5
0
 public bool Update(DetalleServiceSupplier entity)
 {
     return(detalleServiceSupplierRepository.Update(entity));
 }