Beispiel #1
0
 public ActionResult DeleteConfirmed(int id)
 {
     try {
         Accione accione = db.Acciones.Find(id);
         db.Acciones.Remove(accione);
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     catch (Exception ex)
     {
         return(View("ErrorDeleteRef", new HandleErrorInfo(ex, "Acciones", "Delete")));
     }
 }
Beispiel #2
0
        // GET: Acciones/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Accione accione = db.Acciones.Find(id);

            if (accione == null)
            {
                return(HttpNotFound());
            }
            return(View(accione));
        }
Beispiel #3
0
 public ActionResult Edit([Bind(Include = "Id,nombre,descripcion,isSelected")] Accione accione)
 {
     if (ModelState.IsValid)
     {
         try {
             db.Entry(accione).State = EntityState.Modified;
             db.SaveChanges();
             return(RedirectToAction("Index"));
         }
         catch (Exception ex)
         {
             return(View("ErrorCreateDup", new HandleErrorInfo(ex, "Acciones", "Edit")));
         }
     }
     return(View(accione));
 }
Beispiel #4
0
        ///////////////ACCIONES//////////////////////////

        //Agrega una accion en la base de datos
        public void registrarAccion(String accion)
        {
            Accione a = new Accione();

            a.Fecha       = DateTime.Today;
            a.Descripcion = accion;
            Database.Acciones.InsertOnSubmit(a);
            try
            {
                Database.SubmitChanges();
            }
            catch (Exception)
            {
                MessageBox.Show("Error al registrar la accion");
            }
        }