コード例 #1
0
        public ActionResult DeleteConfirmed(int?id)
        {
            tipolinea tipolinea = _UnityOfWork.tipolinea1.Get(id);

            _UnityOfWork.tipolinea1.Delete(tipolinea);
            _UnityOfWork.SaveChanges();
            return(RedirectToAction("Index"));
        }
コード例 #2
0
 public ActionResult Edit([Bind(Include = "tipolinea_id,tipolinea_nombre")] tipolinea tipolinea)
 {
     if (ModelState.IsValid)
     {
         //_UnityOfWork.Entry(tipolinea).State = EntityState.Modified;
         _UnityOfWork.StateModified(tipolinea);
         _UnityOfWork.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(tipolinea));
 }
コード例 #3
0
        public ActionResult Create([Bind(Include = "tipolinea_id,tipolinea_nombre")] tipolinea tipolinea)
        {
            if (ModelState.IsValid)
            {
                _UnityOfWork.tipolinea1.Add(tipolinea);
                _UnityOfWork.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(tipolinea));
        }
コード例 #4
0
        // GET: tipolineas/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            tipolinea tipolinea = _UnityOfWork.tipolinea1.Get(id);

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