Example #1
0
 public ActionResult Edit(FacultySchool facultyschool)
 {
     if (ModelState.IsValid)
     {
         db.Entry(facultyschool).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(facultyschool));
 }
 public ActionResult Edit(ElectionType electiontype)
 {
     if (ModelState.IsValid)
     {
         db.Entry(electiontype).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(electiontype));
 }
 public ActionResult Edit(Election election)
 {
     if (ModelState.IsValid)
     {
         db.Entry(election).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.ElectionTypeId = new SelectList(db.ElectionTypes, "Id", "Name", election.ElectionTypeId);
     return(View(election));
 }
Example #4
0
 public ActionResult Edit(Committee committee)
 {
     if (ModelState.IsValid)
     {
         db.Entry(committee).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.CommitteeTypeId = new SelectList(db.CommitteeTypes, "Id", "Name", committee.CommitteeTypeId);
     return(View(committee));
 }
Example #5
0
 public ActionResult Edit(FacultyDiscipline facultydiscipline)
 {
     if (ModelState.IsValid)
     {
         db.Entry(facultydiscipline).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.FacultySchoolId = new SelectList(db.FacultySchools, "Id", "Name", facultydiscipline.FacultySchoolId);
     return(View(facultydiscipline));
 }
 public ActionResult Edit(CommitteeSeat committeeseat)
 {
     if (ModelState.IsValid)
     {
         db.Entry(committeeseat).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.CommitteeId     = new SelectList(db.Committees.OrderBy(c => c.Name), "Id", "Name", committeeseat.CommitteeId);
     ViewBag.FacultySchoolId = new SelectList(db.FacultySchools, "Id", "Abbreviation", committeeseat.FacultySchoolId);
     return(View(committeeseat));
 }
Example #7
0
 public ActionResult Edit(ElectionSpecialSeat electionspecialseat)
 {
     if (ModelState.IsValid)
     {
         db.Entry(electionspecialseat).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.CommitteeSeatId = new SelectList(db.CommitteeSeats, "Id", "Id", electionspecialseat.CommitteeSeatId);
     ViewBag.ElectionId      = new SelectList(db.Elections, "Id", "Id", electionspecialseat.ElectionId);
     return(View(electionspecialseat));
 }
 public ActionResult Edit(Faculty faculty)
 {
     if (ModelState.IsValid)
     {
         db.Entry(faculty).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     //ViewBag.FacultyDisciplineId = new SelectList(db.FacultyDisciplines, "Id", "Name", faculty.FacultyDisciplineId);
     ViewBag.FacultyDisciplineId = new SelectList(db.FacultyDisciplines.OrderBy(d => d.FacultySchool.Abbreviation).ThenBy(d => d.Name).Select(d => new { Id = d.Id, Description = d.FacultySchool.Abbreviation + " - " + d.Name }), "Id", "Description", faculty.FacultyDisciplineId);
     ViewBag.FacultyRankId       = new SelectList(db.FacultyRanks, "Id", "Name", faculty.FacultyRankId);
     return(View(faculty));
 }
Example #9
0
        public ActionResult Edit(ElectionNomination electionnomination)
        {
            if (ModelState.IsValid)
            {
                db.Entry(electionnomination).State = EntityState.Modified;
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }
            ViewBag.CommitteeSeatId = new SelectList(db.CommitteeSeats, "Id", "Id", electionnomination.CommitteeSeatId);
            ViewBag.ElectionId      = new SelectList(db.Elections, "Id", "Id", electionnomination.ElectionId);
            //ViewBag.FacultyId = new SelectList(db.Faculties, "Id", "First", electionnomination.FacultyId);
            ViewBag.FacultyId = new SelectList(db.Faculties.OrderBy(f => f.Last).ThenBy(f => f.First).Select(f => new { Id = f.Id, FullName = f.Last + ", " + f.First }), "Id", "FullName", electionnomination.FacultyId);

            return(View(electionnomination));
        }
        public ActionResult Edit(CommitteeMember committeemember)
        {
            if (ModelState.IsValid)
            {
                db.Entry(committeemember).State = EntityState.Modified;
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }
            //ViewBag.CommitteeSeatId = new SelectList(db.CommitteeSeats, "Id", "Id", committeemember.CommitteeSeatId);
            ViewBag.CommitteeSeatId = new SelectList(db.CommitteeSeats.OrderBy(s => s.Committee.Name).ThenBy(s => s.FacultySchoolId ?? Int16.MaxValue).ThenBy(s => s.Id).Select(s => new { Id = s.Id, CommSeat = s.Committee.Name + "  -  " + (s.FacultySchool.Abbreviation ?? "At-Large") + "  -  " + SqlFunctions.StringConvert((double)(s.StaggerYear ?? 0)).Trim() }), "Id", "CommSeat", committeemember.CommitteeSeatId);
            //ViewBag.FacultyId = new SelectList(db.Faculties, "Id", "First", committeemember.FacultyId);
            ViewBag.FacultyId = new SelectList(db.Faculties.OrderBy(f => f.Last).ThenBy(f => f.First).Select(f => new { Id = f.Id, FullName = f.Last + ", " + f.First }), "Id", "FullName", committeemember.FacultyId);

            return(View(committeemember));
        }
Example #11
0
        public ActionResult Edit(ElectionVote electionvote)
        {
            if (ModelState.IsValid)
            {
                db.Entry(electionvote).State = EntityState.Modified;
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }
            ViewBag.CommitteeId = new SelectList(db.Committees.OrderBy(c => c.Name), "Id", "Name", electionvote.CommitteeId);
            ViewBag.ElectionId  = new SelectList(db.Elections, "Id", "Id", electionvote.ElectionId);
            //ViewBag.FacultyId_Nominee = new SelectList(db.Faculties, "Id", "First", electionvote.FacultyId_Nominee);
            ViewBag.FacultyId_Nominee = new SelectList(db.Faculties.OrderBy(f => f.Last).ThenBy(f => f.First).Select(f => new { Id = f.Id, FullName = f.Last + ", " + f.First }), "Id", "FullName", electionvote.FacultyId_Nominee);
            // ViewBag.FacultyId_Voter = new SelectList(db.Faculties, "Id", "First", electionvote.FacultyId_Voter);
            ViewBag.FacultyId_Voter = new SelectList(db.Faculties.OrderBy(f => f.Last).ThenBy(f => f.First).Select(f => new { Id = f.Id, FullName = f.Last + ", " + f.First }), "Id", "FullName", electionvote.FacultyId_Voter);

            return(View(electionvote));
        }