示例#1
0
 public int InsertarAgreements(Dtos.agreementsDTO dto)
 {
     try
     {
         using (var modelo = new PersistenciaDatos.SignalDBEntities())
         {
             var entity = dto.ToEntity();
             modelo.agreements.Add(entity);
             modelo.SaveChanges();
             return(entity.id_act);
         }
     }
     catch (Exception)
     {
         throw new NotImplementedException();
     }
 }
示例#2
0
 public bool ActualizarAgreements(Dtos.agreementsDTO dto)
 {
     try
     {
         using (var modelo = new PersistenciaDatos.SignalDBEntities())
         {
             var w = modelo.agreements.Where(q => q.id_act == dto.id_act).Select(q => q).FirstOrDefault();
             if (w == null)
             {
                 return(false);
             }
             Dominio.Convertidores.agreementsCONVERTIDOR.Actualizar(dto, w);
             modelo.SaveChanges();
             return(true);
         }
     }
     catch (Exception)
     {
         throw new NotImplementedException();
     }
 }