コード例 #1
0
 public Boolean guardar(clsTarjetaCredito TarjetaCredito)
 {
     try
     {
         using (CuentasPorCobrarEntities ent = new CuentasPorCobrarEntities())
         {
             //ojo mon se lo crea pa tener referencia
             //monetariodet es el nombre de la tabla
             int            x    = this.getIdSiguiente();
             TarjetaCredito TCre = new TarjetaCredito()
             {
                 idEmpresa   = TarjetaCredito.idEmpresa,
                 idTarjeta   = x,
                 descripcion = TarjetaCredito.Descripcion,
                 idBanco     = TarjetaCredito.idBanco,
                 Estado      = TarjetaCredito.Estado,
             };
             ent.AddToTarjetaCredito(TCre);
             ent.SaveChanges();
         }
         return(true);
     }
     catch (Exception)
     {
         return(false);
     }
 }