public IHttpActionResult PutPersonInformation(int id, PersonInformation personInformation) { if (!ModelState.IsValid) { return BadRequest(ModelState); } if (id != personInformation.PersonId) { return BadRequest(); } db.Entry(personInformation).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!PersonInformationExists(id)) { return NotFound(); } else { throw; } } return StatusCode(HttpStatusCode.NoContent); }
public ActionResult Edit([Bind(Include = "ClassID,ClassName")] tblClass tblClass) { if (ModelState.IsValid) { db.Entry(tblClass).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(tblClass)); }
public ActionResult Edit([Bind(Include = "FAQID,Question,Answer,Active")] tblFAQ tblFAQ) { if (ModelState.IsValid) { db.Entry(tblFAQ).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(tblFAQ)); }
public ActionResult Edit([Bind(Include = "SectionID,SectionName,ClassID")] tblSection tblSection) { if (ModelState.IsValid) { db.Entry(tblSection).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.ClassID = new SelectList(db.tblClasses, "ClassID", "ClassName", tblSection.ClassID); return(View(tblSection)); }
public ActionResult Edit([Bind(Include = "SupportID,SupportNumber,SupportEmail,SupportAddress,SupportPerson,ReportingDateTime,SupportActive")] tblSupport tblSupport) { if (ModelState.IsValid) { db.Entry(tblSupport).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(tblSupport)); }
public ActionResult Edit([Bind(Include = "FacultyID,FacultyEmail,FacultySpecification,FacultyName,FacultyGender,FacultyJoiningDate")] tblFaculty tblFaculty) { if (ModelState.IsValid) { tblFaculty.FacultyActive = true; db.Entry(tblFaculty).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.FacultyID = new SelectList(db.tblUsers, "UserID", "UserName", tblFaculty.FacultyID); return(View(tblFaculty)); }
public ActionResult Edit([Bind(Include = "SurveyID,SurveyTitle,SurveyDescription," + "UserTypeID,SurveyConducts,SurveyReportingDateTime")] tblSurvey tblSurvey, string surveyDueDate) { if (ModelState.IsValid) { tblSurvey.SurveyActive = true; tblSurvey.SurveyDueDate = surveyDueDate; db.Entry(tblSurvey).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.UserTypeID = new SelectList(db.tblUserTypes, "UserTypeID", "UserTypeName"); return(View(tblSurvey)); }
public ActionResult Edit([Bind(Include = "StudentID,StudentName,StudentEmail,SectionID,StudentGender,StudentAdmissionDate")] tblStudent tblStudent) { if (ModelState.IsValid) { // Setting active property true just to be on the safe side. tblStudent.StudentActive = true; db.Entry(tblStudent).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.SectionID = new SelectList(db.tblSections, "SectionID", "SectionName", tblStudent.SectionID); ViewBag.StudentID = new SelectList(db.tblUsers, "UserID", "UserName", tblStudent.StudentID); return(View(tblStudent)); }
public ActionResult Edit([Bind(Include = "UserID,StudentNo,UserRegStatus,UserRequestDate,UserReqRejectReason")] tblUser user) { if (ModelState.IsValid) { // Setting active property true. user.UserActive = true; // Setting typeID to 2 (Student) user.UserTypeID = 2; db.Entry(user).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(user)); }
public ActionResult Edit([Bind(Include = "CompID,CompName,CompDescription,UserTypeID")] tblCompetition competition, string CompetitionDate) { if (ModelState.IsValid) { // Setting active property true just to be on the safe side. competition.CompActive = true; // Setting the date on which competition is held. competition.CompDate = CompetitionDate; db.Entry(competition).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.UserTypeID = new SelectList(db.tblUserTypes, "UserTypeID", "UserTypeName"); return(View(competition)); }