예제 #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            itbis itbis = db.itbis.Find(id);

            db.itbis.Remove(itbis);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
예제 #2
0
 public ActionResult Edit([Bind(Include = "id,valor")] itbis itbis)
 {
     if (ModelState.IsValid)
     {
         db.Entry(itbis).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(itbis));
 }
예제 #3
0
        // GET: itbis/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            itbis itbis = db.itbis.Find(id);

            if (itbis == null)
            {
                return(HttpNotFound());
            }
            return(View(itbis));
        }
예제 #4
0
        public ActionResult Create([Bind(Include = "id,valor")] itbis itbis)
        {
            if (ModelState.IsValid)
            {
                var usuarioid = Session["userid"].ToString();
                var empresaid = Session["empresaid"].ToString();
                itbis.usuarioid = Convert.ToInt32(usuarioid);
                itbis.empresaid = Convert.ToInt32(empresaid);
                db.itbis.Add(itbis);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(itbis));
        }
예제 #5
0
        // GET: itbis/Edit/5
        public ActionResult Edit(int?id)
        {
            if (Session["Username"] == null)
            {
                return(RedirectToAction("Login", "Logins"));
            }

            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            itbis itbis = db.itbis.Find(id);

            if (itbis == null)
            {
                return(HttpNotFound());
            }
            return(View(itbis));
        }