public ActionResult DeleteConfirmed(int id)
        {
            TestsHosted testsHosted = db.TestsHosteds.Find(id);

            db.TestsHosteds.Remove(testsHosted);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
        public ActionResult Create([Bind(Include = "RecruitmentId,TestName,LocationId,TestKey,CutoffPercentage,CodingWeightageOnSelection1,TechnicalWeightageOnSelection,HRWeightageOnSelection")] TestsHosted testsHosted)
        {
            if (ModelState.IsValid)
            {
                db.TestsHosteds.Add(testsHosted);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(testsHosted));
        }
        // GET: TestsHosted/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            TestsHosted testsHosted = db.TestsHosteds.Find(id);

            if (testsHosted == null)
            {
                return(HttpNotFound());
            }
            return(View(testsHosted));
        }
 public ActionResult Edit([Bind(Include = "TestId,RecruitmentId,TestName,StartDate,EndDate,TotalScore,Duration,LocationId,TestKey,CutoffPercentage,WeightageOnSelection,CodingWeightageOnSelection1,TechnicalWeightageOnSelection,HRWeightageOnSelection")] TestsHosted testsHosted)
 {
     if (testsHosted.LocationId == 0)
     {
         ModelState.AddModelError("LocationId", "Please choose location");
     }
     if (testsHosted.RecruitmentId == 0)
     {
         ModelState.AddModelError("RecruitmentId", "Please choose Recruitment");
     }
     if (ModelState.IsValid)
     {
         db.Entry(testsHosted).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(testsHosted));
 }