コード例 #1
0
        public ActionResult CWDelete(int id)
        {
            CadastralWork cw = db.CadastralWorks.Find(id);

            if (cw == null)
            {
                return(HttpNotFound());
            }

            return(View(cw));
        }
コード例 #2
0
        public ActionResult CWComplete(int id)
        {
            CadastralWork cw = db.CadastralWorks.Find(id);

            ViewBag.CW   = cw;
            ViewBag.Date = DateTime.Now;
            // Формируем список статусов для передачи в представление
            SelectList status = new SelectList(db.LegalStatus, "Id", "lsName");

            ViewBag.LegalStatus = status;
            return(View());
        }
コード例 #3
0
        public ActionResult CWDeleteConfirmed(int id)
        {
            CadastralWork cw = db.CadastralWorks.Find(id);

            if (cw == null)
            {
                return(HttpNotFound());
            }
            db.CadastralWorks.Remove(cw);
            db.SaveChanges();
            return(RedirectToAction("ListCW"));
        }
コード例 #4
0
        public ActionResult CWCreate(CadastralWork cw, int id)
        {
            Application app = db.Applications.Find(id);

            if (app == null)
            {
                return(HttpNotFound());
            }
            app.fk_status       = 4;
            db.Entry(app).State = EntityState.Modified;
            db.SaveChanges();
            db.CadastralWorks.Add(cw);
            db.SaveChanges();
            return(RedirectToAction("ListCW"));
        }
コード例 #5
0
        public ActionResult CWComplete(CadastralObject co, int id)
        {
            CadastralWork cw = db.CadastralWorks.Find(id);

            if (cw == null)
            {
                return(HttpNotFound());
            }
            cw.app.fk_status   = 6;
            db.Entry(cw).State = EntityState.Modified;
            db.SaveChanges();
            db.CadastralObjects.Add(co);
            db.SaveChanges();
            return(RedirectToAction("ListCO", "CO"));
        }
コード例 #6
0
        public ActionResult CWEdit(int?id)
        {
            if (id == null)
            {
                return(HttpNotFound());
            }
            // Находим в бд выбранную КР
            CadastralWork cw = db.CadastralWorks.Find(id);

            if (cw != null)
            {
                return(View(cw));
            }

            return(RedirectToAction("ListCW"));
        }
コード例 #7
0
 public ActionResult CWEdit(CadastralWork cw)
 {
     db.Entry(cw).State = EntityState.Modified;
     db.SaveChanges();
     return(RedirectToAction("ListCW"));
 }