Beispiel #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            SurveyOccation surveyOccation = db.SurveyOccations.Find(id);

            db.SurveyOccations.Remove(surveyOccation);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Beispiel #2
0
 public ActionResult Edit([Bind(Include = "Id,StartDate,EndDate,SurveyId")] SurveyOccation surveyOccation)
 {
     if (ModelState.IsValid)
     {
         db.Entry(surveyOccation).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.SurveyId = new SelectList(db.Surveys, "Id", "Name", surveyOccation.SurveyId);
     return(View(surveyOccation));
 }
Beispiel #3
0
        // GET: SurveyOccations/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            SurveyOccation surveyOccation = db.SurveyOccations.Find(id);

            if (surveyOccation == null)
            {
                return(HttpNotFound());
            }
            return(View(surveyOccation));
        }
Beispiel #4
0
        // GET: SurveyOccations/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            SurveyOccation surveyOccation = db.SurveyOccations.Find(id);

            if (surveyOccation == null)
            {
                return(HttpNotFound());
            }
            ViewBag.SurveyId = new SelectList(db.Surveys, "Id", "Name", surveyOccation.SurveyId);
            return(View(surveyOccation));
        }
Beispiel #5
0
        // GET: SurveyOccations/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            SurveyOccation surveyOccation = db.SurveyOccations.Find(id);
            var            questions      = db.Questions.Where(sq => sq.SurveyOccation.Id == id);

            if (surveyOccation != null)
            {
                surveyOccation.Questionses = questions;
            }

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