Ejemplo n.º 1
0
        public ActionResult DeleteConfirmed(int id)
        {
            QuestionareAnswer questionareAnswer = db.QuestionareAnswers.Find(id);

            db.QuestionareAnswers.Remove(questionareAnswer);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Ejemplo n.º 2
0
 public ActionResult Edit([Bind(Include = "QuestionareAnswers_id,Aplication_id,RepositoryOfAnswers_id,RepositoryOfQuestions_id")] QuestionareAnswer questionareAnswer)
 {
     if (ModelState.IsValid)
     {
         db.Entry(questionareAnswer).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.Aplication_id            = new SelectList(db.Aplications, "Aplication_id", "FirstName", questionareAnswer.Aplication_id);
     ViewBag.RepositoryOfAnswers_id   = new SelectList(db.RepositoryOfAnswers, "RepositoryOfAnswers_id", "Description", questionareAnswer.RepositoryOfAnswers_id);
     ViewBag.RepositoryOfQuestions_id = new SelectList(db.RepositoryOfQuestions, "RepositoryOfQuestions_id", "Description", questionareAnswer.RepositoryOfQuestions_id);
     return(View(questionareAnswer));
 }
Ejemplo n.º 3
0
        // GET: QuestionareAnswers/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            QuestionareAnswer questionareAnswer = db.QuestionareAnswers.Find(id);

            if (questionareAnswer == null)
            {
                return(HttpNotFound());
            }
            return(View(questionareAnswer));
        }
Ejemplo n.º 4
0
        // GET: QuestionareAnswers/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            QuestionareAnswer questionareAnswer = db.QuestionareAnswers.Find(id);

            if (questionareAnswer == null)
            {
                return(HttpNotFound());
            }
            ViewBag.Aplication_id            = new SelectList(db.Aplications, "Aplication_id", "FirstName", questionareAnswer.Aplication_id);
            ViewBag.RepositoryOfAnswers_id   = new SelectList(db.RepositoryOfAnswers, "RepositoryOfAnswers_id", "Description", questionareAnswer.RepositoryOfAnswers_id);
            ViewBag.RepositoryOfQuestions_id = new SelectList(db.RepositoryOfQuestions, "RepositoryOfQuestions_id", "Description", questionareAnswer.RepositoryOfQuestions_id);
            return(View(questionareAnswer));
        }
Ejemplo n.º 5
0
        public ActionResult Create([Bind(Include = "Aplication_id,FirstName,LastName,Address,City,DateOfBirth,Phone,Email,CV,Accepted,OpenJobs_id,WorkPosition_id")] Aplication aplication, FormCollection formCollection)
        {
            if (ModelState.IsValid)
            {
                db.Aplications.Add(aplication);
                db.SaveChanges();
                string [] prasanja = formCollection["Prasanja"].Split(',');
                string [] odgovori = formCollection["Odgovori"].Split(',');
                for (int i = 0; i < prasanja.Length; i++)
                {
                    QuestionareAnswer questionareAnswer = new QuestionareAnswer();
                    questionareAnswer.RepositoryOfAnswers_id   = Convert.ToInt32(odgovori [i]);
                    questionareAnswer.RepositoryOfQuestions_id = Convert.ToInt32(prasanja [i]);
                    questionareAnswer.Aplication_id            = aplication.Aplication_id;
                    db.QuestionareAnswers.Add(questionareAnswer);
                    db.SaveChanges();
                }
                return(RedirectToAction("Index"));
            }

            ViewBag.OpenJobs_id     = new SelectList(db.OpenJobs, "OpenJobs_id", "Conditions", aplication.OpenJobs_id);
            ViewBag.WorkPosition_id = new SelectList(db.WorkPositions, "WorkPosition_id", "ShortDescription", aplication.WorkPosition_id);
            return(View(aplication));
        }