public ActionResult Create(AllocatedRoom allocatedroom)
        {
            if (ModelState.IsValid)
            {
                db.AllocatedRoomDbSet.Add(allocatedroom);
                db.SaveChanges();

                return RedirectToAction("Index");
            }

            ViewBag.DepartmentID = new SelectList(db.DepartmentDbSet, "DepartmentID", "DeptCode");
            ViewBag.CourseID = new SelectList(db.CourseDbSet, "CourseID", "CourseCode", allocatedroom.CourseID);
            ViewBag.RoomID = new SelectList(db.RoomDbSet, "RoomID", "RoomNo", allocatedroom.RoomID);
            ViewBag.WeekDayID = new SelectList(db.WeekDayDbSet, "WeekDayID", "DayName", allocatedroom.WeekDayID);
            return View(allocatedroom);
        }
 public ActionResult Edit(AllocatedRoom allocatedroom)
 {
     if (ModelState.IsValid)
     {
         db.Entry(allocatedroom).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     ViewBag.CourseID = new SelectList(db.CourseDbSet, "CourseID", "CourseCode", allocatedroom.CourseID);
     ViewBag.RoomID = new SelectList(db.RoomDbSet, "RoomID", "RoomNo", allocatedroom.RoomID);
     ViewBag.WeekDayID = new SelectList(db.WeekDayDbSet, "WeekDayID", "DayName", allocatedroom.WeekDayID);
     return View(allocatedroom);
 }