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);
        }
示例#2
0
 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));
 }
示例#3
0
 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));
 }
示例#4
0
 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));
 }
示例#5
0
        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));
        }
示例#6
0
        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));
        }
示例#7
0
        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));
        }
示例#8
0
        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));
        }
示例#10
0
        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));
        }