//metodo guardar
 public void Guardar()
 {
     try
     {
         using (var db = new BDModeloTaex())
         {
             if (this.ID_Taller > 0)
             {
                 db.Entry(this).State = EntityState.Modified;
             }
             else
             {
                 db.Entry(this).State = EntityState.Added;
             }
             db.SaveChanges();
         }
     }
     catch (Exception ex)
     {
         throw;
     }
 }
Exemple #2
0
 public void Eliminar()
 {
     try
     {
         using (var db = new BDModeloTaex())
         {
             db.Entry(this).State = EntityState.Deleted;
             db.SaveChanges();
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }