public ActionResult Create(TimeTable timetable)
        {
            if (ModelState.IsValid)
            {
                db.TimeTables.Add(timetable);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            return View(timetable);
        }
        // POST api/TimeTable
        public HttpResponseMessage PostTimeTable(TimeTable timetable)
        {
            if (ModelState.IsValid)
            {
                db.TimeTables.Add(timetable);
                db.SaveChanges();

                HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.Created, timetable);
                response.Headers.Location = new Uri(Url.Link("DefaultApi", new { id = timetable.Id }));
                return response;
            }
            else
            {
                return Request.CreateResponse(HttpStatusCode.BadRequest);
            }
        }
        // PUT api/TimeTable/5
        public HttpResponseMessage PutTimeTable(int id, TimeTable timetable)
        {
            if (ModelState.IsValid && id == timetable.Id)
            {
                db.Entry(timetable).State = EntityState.Modified;

                try
                {
                    db.SaveChanges();
                }
                catch (DbUpdateConcurrencyException)
                {
                    return Request.CreateResponse(HttpStatusCode.NotFound);
                }

                return Request.CreateResponse(HttpStatusCode.OK);
            }
            else
            {
                return Request.CreateResponse(HttpStatusCode.BadRequest);
            }
        }
 public ActionResult Edit(TimeTable timetable)
 {
     if (ModelState.IsValid)
     {
         db.Entry(timetable).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     return View(timetable);
 }