public IHttpActionResult PutArea_Table(int id, Area_Table area_Table)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != area_Table.Area_ID)
            {
                return(BadRequest());
            }

            db.Entry(area_Table).State = EntityState.Modified;

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!Area_TableExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }
        public ActionResult DeleteConfirmed(int id)
        {
            Area_Table area_Table = db.Area_Table.Find(id);

            db.Area_Table.Remove(area_Table);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
        public IHttpActionResult GetArea_Table(int id)
        {
            Area_Table area_Table = db.Area_Table.Find(id);

            if (area_Table == null)
            {
                return(NotFound());
            }

            return(Ok(area_Table));
        }
        public IHttpActionResult PostArea_Table(Area_Table area_Table)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.Area_Table.Add(area_Table);
            db.SaveChanges();

            return(CreatedAtRoute("DefaultApi", new { id = area_Table.Area_ID }, area_Table));
        }
 public ActionResult Edit([Bind(Include = "Area_ID,States_ID,Area_Name,Area_Desc,Area_X_Point,Area_Y_Point,Area_Manger,Area_Hour_Rate,Area_Start_Time,Area_End_Time")] Area_Table area_Table)
 {
     if (ModelState.IsValid)
     {
         db.Entry(area_Table).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.Area_Manger       = new SelectList(db.AspNetUsers, "Id", "Email");
     ViewBag.Governorate_Table = db.Governorate_Table.ToList();
     ViewBag.State             = db.States_Table.ToList();
     return(View(area_Table));
 }
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Area_Table area_Table = db.Area_Table.Find(id);

            if (area_Table == null)
            {
                return(HttpNotFound());
            }
            return(View(area_Table));
        }
        public IHttpActionResult DeleteArea_Table(int id)
        {
            Area_Table area_Table = db.Area_Table.Find(id);

            if (area_Table == null)
            {
                return(NotFound());
            }

            db.Area_Table.Remove(area_Table);
            db.SaveChanges();

            return(Ok(area_Table));
        }
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Area_Table area_Table = db.Area_Table.Find(id);

            if (area_Table == null)
            {
                return(HttpNotFound());
            }
            ViewBag.Area_Manger       = new SelectList(db.AspNetUsers, "Id", "Email");
            ViewBag.Governorate_Table = db.Governorate_Table.ToList();
            ViewBag.State             = db.States_Table.ToList();
            return(View(area_Table));
        }