示例#1
0
        public ActionResult OnAddTruck(int trackId, bool hasTowStrap, int lift)
        {
            if (hasTowStrap && lift < 5)
            {
                trackService.AddTruck(new Truck
                {
                    HasTowStrap = hasTowStrap,
                    Lift        = lift,
                    TrackId     = trackId
                });

                return(Json(true, JsonRequestBehavior.AllowGet));
            }
            return(Json(new { ReturnStatus = "error", ReturnData = "Truck did not pass the inspection!" },
                        JsonRequestBehavior.AllowGet));
        }