public List <EventosPendiente> ObtenerTodos()
 {
     using (var db = new DBContextADO())
     {
         //retorna la tista que creamos en BlogContexModel
         //debemos incluir en este query que queremos obtenerer los comentarios tambien
         return(db.EventosPendientesSet.ToList());
     }
 }
 internal void Crear(EventosPendiente model)
 {
     using (var db = new DBContextADO())
     {
         //anadimos el modelo a nuestra lista de blogPost
         db.EventosPendientesSet.Add(model);
         //guardar cambios en la db
         db.SaveChanges();
     }
 }
 internal void Eliminar(Contactos model)
 {
     using (var db = new DBContextADO())
     {
         //anadimos el modelo a nuestra lista de blogPost
         db.ContactosSet.Remove(model);
         //guardar cambios en la db
         db.SaveChanges();
     }
 }
Exemple #4
0
        public ActionResult Delete(int id, Contactos model)
        {
            using (var db = new DBContextADO())
            {
                model = (from p in db.ContactosSet
                         where p.Id_contactos == id
                         select p).FirstOrDefault();

                db.ContactosSet.Remove(model);
                db.SaveChanges();


                return(RedirectToAction("Index", "Contacto"));
            }
        }
        public ActionResult Delete(int id, EventosPendiente model)
        {
            using (var db = new DBContextADO())
            {
                model = (from p in db.EventosPendientesSet
                         where p.Id_eventoPendiente == id
                         select p).FirstOrDefault();

                db.EventosPendientesSet.Remove(model);
                db.SaveChanges();


                return(RedirectToAction("Index", "EventosPendiente"));
            }
        }
Exemple #6
0
 //constructor
 public ContactoController()
 {
     db    = new DBContextADO();
     _repo = new ContactoService();
 }
 public EventosPendienteController()
 {
     db    = new DBContextADO();
     _repo = new EventoPendienteService();
 }