Example #1
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));
        }