Пример #1
0
        public ActionResult EditStops(int StopId)
        {
            DSRCManagementSystem.Models.StopList obs = new DSRCManagementSystem.Models.StopList();
            var val = objdb.Stops.Where(x => x.StopId == StopId).Select(o => o).FirstOrDefault();

            obs.StopId    = val.StopId;
            obs.Stop_Name = val.Stop_Name;
            return(View(obs));
        }
Пример #2
0
        public ActionResult Delete(int StopId)
        {
            DSRCManagementSystem.Models.StopList obs = new DSRCManagementSystem.Models.StopList();
            var val = objdb.Stops.Where(x => x.StopId == StopId).Select(o => o).FirstOrDefault();

            val.IsActive = false;
            objdb.SaveChanges();
            return(Json(new { Result = "Success", URL = @Url.Action("AlertPopUp", "Popup") }, JsonRequestBehavior.AllowGet));
        }
Пример #3
0
        public ActionResult EditStops(DSRCManagementSystem.Models.StopList objmodel)
        {
            DSRCManagementSystem.Stop            objs  = new DSRCManagementSystem.Stop();
            DSRCManagementSystem.Models.StopList objsl = new DSRCManagementSystem.Models.StopList();
            var val = objdb.Stops.Where(x => x.StopId == objmodel.StopId).Select(o => o).FirstOrDefault();
            var res = objdb.Stops.Where(x => x.Stop_Name == objmodel.Stop_Name).Select(o => o).FirstOrDefault();

            if (res == null)
            {
                val.Stop_Name = objmodel.Stop_Name;
                objdb.SaveChanges();
            }
            else
            {
                return(Json("Warning", JsonRequestBehavior.AllowGet));
            }
            return(Json("Success", JsonRequestBehavior.AllowGet));
        }
Пример #4
0
        public ActionResult AddStops(DSRCManagementSystem.Models.StopList objmodel)
        {
            DSRCManagementSystem.Stop            obj = new DSRCManagementSystem.Stop();
            DSRCManagementSystem.Models.StopList obs = new DSRCManagementSystem.Models.StopList();
            var val = objdb.Stops.Where(x => x.Stop_Name == objmodel.Stop_Name).Select(o => o).FirstOrDefault();

            if (val == null)
            {
                obj.Stop_Name = objmodel.Stop_Name;
                obj.IsActive  = true;
                objdb.AddToStops(obj);
                objdb.SaveChanges();
            }
            else
            {
                return(Json("Warning", JsonRequestBehavior.AllowGet));
            }
            return(Json("Success", JsonRequestBehavior.AllowGet));
        }