Пример #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            SurveyHeader surveyheader = db.SurveyHeader.Find(id);

            db.SurveyHeader.Remove(surveyheader);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Пример #2
0
        //
        // GET: /SurveyHeader/Details/5

        public ActionResult Details(int id = 0)
        {
            SurveyHeader surveyheader = db.SurveyHeader.Find(id);

            if (surveyheader == null)
            {
                return(HttpNotFound());
            }
            return(View(surveyheader));
        }
Пример #3
0
 public ActionResult Edit(SurveyHeader surveyheader)
 {
     if (ModelState.IsValid)
     {
         db.Entry(surveyheader).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.OrganizationID = new SelectList(db.Organization, "ID", "Name", surveyheader.OrganizationID);
     return(View(surveyheader));
 }
Пример #4
0
        //
        // GET: /SurveyHeader/Edit/5

        public ActionResult Edit(int id = 0)
        {
            SurveyHeader surveyheader = db.SurveyHeader.Find(id);

            if (surveyheader == null)
            {
                return(HttpNotFound());
            }
            ViewBag.OrganizationID = new SelectList(db.Organization, "ID", "Name", surveyheader.OrganizationID);
            return(View(surveyheader));
        }
Пример #5
0
        public ActionResult Create(SurveyHeader surveyheader)
        {
            if (ModelState.IsValid)
            {
                db.SurveyHeader.Add(surveyheader);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.OrganizationID = new SelectList(db.Organization, "ID", "Name", surveyheader.OrganizationID);
            return(View(surveyheader));
        }