public ActionResult deleteSchoolStation(int stationID, string callback)
        {
            ajaxReturnData data = new ajaxReturnData();

            using (ApplicationDbContext DB = new ApplicationDbContext())
            {
                try
                {
                    SchoolStation doomedStation = new SchoolStation();
                    doomedStation.id = stationID;
                    DB.Stations.Attach(doomedStation);
                    DB.Stations.Remove(doomedStation);

                    DB.SaveChanges();

                    

                    if (string.IsNullOrEmpty(callback))
                    {
                        data.statusCode = (int)statusCodes.success;
                    }
                    else
                    {
                        data.statusCode = (int)statusCodes.successRun;
                        data.callback = callback;
                    }

                    data.message = "station removed";
                    return Json(data);
                }
                catch (Exception ex)
                {
                    data.statusCode = (int)statusCodes.fail;
                    data.message = "Error: " + ex.Message;
                    return Json(data);
                }

            }
        }
        public ActionResult editSchoolStation(int stationID, int schoolID, SchoolStation station, string callback, HttpPostedFileWrapper image)
        {
            ajaxReturnData data = new ajaxReturnData();

            try
            {
                using (ApplicationDbContext DB = new ApplicationDbContext())
                {
                    station.id = stationID;
                    DB.Stations.Attach(station);
                    DB.Entry(station).State = EntityState.Unchanged;
                    DB.Entry(station).Property(s => s.line).IsModified = true;
                    DB.Entry(station).Property(s => s.name).IsModified = true;
                    DB.Entry(station).Property(s => s.distance).IsModified = true;

                    if (image != null && image.ContentLength > 0)
                    {

                        string path = "/content/images/uploads/schools/" + schoolID;
                        bool exists = Directory.Exists(Server.MapPath(path));
                        if (!exists)
                        {
                            Directory.CreateDirectory(Server.MapPath(path));
                        }

                        path = path + "/station" + station.id + Path.GetExtension(image.FileName);
                        image.SaveAs(Server.MapPath(path));
                        station.image = path;
                        DB.Entry(station).Property(s => s.image).IsModified = true;
                    }

                    DB.SaveChanges();
                }


                if (string.IsNullOrEmpty(callback))
                {
                    data.statusCode = (int)statusCodes.success;
                }
                else
                {
                    data.statusCode = (int)statusCodes.successRun;
                    data.callback = callback;
                }

                data.message = "station updated";
                return Json(data);
            }
            catch (Exception ex)
            {
                data.statusCode = (int)statusCodes.fail;
                data.message = "Failed to update station; " + ex.Message;
                return Json(data);
            }
        }