Beispiel #1
0
        public ResponseResult <Route> GetAllRoute(string loginName, string page, string limit)
        {
            var result = ResponseResult <Route> .Default();

            RouteService routeservice = new RouteService();
            List <Route> routes       = new List <Route>();
            int          newcount     = 0;

            try
            {
                if (string.IsNullOrEmpty(loginName))
                {
                    return(ResponseResult <Route> .Error("登录名称不能为空"));
                }
                else
                {
                    routes   = routeservice.GetAllRoute(loginName, Convert.ToInt32(page), Convert.ToInt32(limit));
                    newcount = routeservice.GetAllRouteCount(loginName);
                    result   = ResponseResult <Route> .DataSuccess(routes, newcount, "获取路径成功");
                }
            }
            catch (System.Exception ex)
            {
                result = ResponseResult <Route> .Error(ex.Message);
            }
            return(result);
        }