Esempio n. 1
0
        public ActionResult DeleteConfirmed(int id)
        {
            ConceptoGasto conceptogasto = db.ConceptoGasto.Find(id);

            db.ConceptoGasto.Remove(conceptogasto);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Esempio n. 2
0
        //
        // GET: /ConceptoGasto/Delete/5

        public ActionResult Delete(int id = 0)
        {
            ConceptoGasto conceptogasto = db.ConceptoGasto.Find(id);

            if (conceptogasto == null)
            {
                return(HttpNotFound());
            }
            return(View(conceptogasto));
        }
Esempio n. 3
0
 public ActionResult Edit([Bind(Include = "Id,Nombre,Descripcion")] ConceptoGasto conceptogasto)
 {
     if (ModelState.IsValid)
     {
         db.Entry(conceptogasto).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(conceptogasto));
 }
Esempio n. 4
0
 public ActionResult Edit(ConceptoGasto conceptogasto)
 {
     if (ModelState.IsValid)
     {
         db.Entry(conceptogasto).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(conceptogasto));
 }
Esempio n. 5
0
        public ActionResult Create([Bind(Include = "Id,Nombre,Descripcion")] ConceptoGasto conceptogasto)
        {
            if (ModelState.IsValid)
            {
                db.ConceptoGasto.Add(conceptogasto);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(conceptogasto));
        }
Esempio n. 6
0
        public ActionResult Create(ConceptoGasto conceptogasto)
        {
            if (ModelState.IsValid)
            {
                db.ConceptoGasto.Add(conceptogasto);
                db.SaveChanges();
                return(RedirectToAction("Create"));
            }

            return(View(conceptogasto));
        }
        protected void BtnGuardar_Click(object sender, EventArgs e)
        {
            ConceptoGasto cg = new ConceptoGasto();

            cg.NombreGasto = TxtNombre.Text;

            mcg.crearConceptoGasto(cg);

            TxtNombre.Text = "";
            TxtNombre.Focus();
            SqlDataSource1.DataBind();
            TablaConceptoGasto.DataBind();
        }
Esempio n. 8
0
        // GET: /ConceptoGasto/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            ConceptoGasto conceptogasto = db.ConceptoGasto.Find(id);

            if (conceptogasto == null)
            {
                return(HttpNotFound());
            }
            return(View(conceptogasto));
        }
Esempio n. 9
0
 public ActionResult DeleteConfirmed(int id)
 {
     try
     {
         ConceptoGasto conceptogasto = db.ConceptoGasto.Find(id);
         db.ConceptoGasto.Remove(conceptogasto);
         db.SaveChanges();
     }
     catch (Exception)
     {
         throw new Exception("Este registro se utiliza en una relacion y no lo puede borrar");
     }
     return(RedirectToAction("Index"));
 }
        public static IConceptoGasto GetConceptoGasto()
        {
            ConceptoGasto conceptoGasto = new ConceptoGasto();

            return((IConceptoGasto)conceptoGasto);
        }
Esempio n. 11
0
        public void crearConceptoGasto(ConceptoGasto cg)
        {
            String sql = "EXEC ingreso_conceptogasto '" + cg.NombreGasto + "'";

            ejecutar(sql);
        }