示例#1
0
        /// <summary>
        /// 查询子岗信息
        /// </summary>
        /// <param name="id">父类ID</param>
        /// <param name="page">第几页数</param>
        /// <param name="rows">每页数据量</param>
        private void GetLoadRoute(string id, int page, int rows)
        {
            BLLManRoute route = new BLLManRoute();
            dt = route.GetRouteDt(id, (page - 1) * rows + 1, page * rows);
            count = route.GetRountCount(id);
            IList<Hashtable> list = new List<Hashtable>();
            foreach (DataRow row in dt.Rows)
            {
                Hashtable ht = new Hashtable();
                ht.Add("ID", row["ID"].ToString());
                ht.Add("RouteID", row["RouteID"].ToString());
                ht.Add("RouteName", row["RouteName"].ToString());
                ht.Add("Rtype", row["Rtype"].ToString());
                list.Add(ht);
            }
            object obj = new
            {
                total = count,
                rows = list
            };

            string result = JsonConvert.SerializeObject(obj);
            Response.Write(result);
            Response.End();
        }
示例#2
0
        public void JudgeRouteOrArea(string id)
        {
            BLLManRoute route = new BLLManRoute();
            int routeCount = route.GetRountCount(id);
            BLLManArea area = new BLLManArea();
            int areaCount = area.GetAreaCount(id);
            string info = "";
            if (routeCount > 0)
            {
                info = "route";
            }
            else if (areaCount > 0)
            {
                info = "area";
            }
            else if (routeCount == 0 && areaCount == 0)
            {
                info = "route";
            }
            object obj = new
            {
                info = info
            };

            string result = JsonConvert.SerializeObject(obj);
            Response.Write(result);
            Response.End();
        }