Example #1
0
        public void JudgeAreaOrDevice(string id)
        {
            BLL.BLLManDevice device = new BLL.BLLManDevice();
            int deviceCount = device.GetDeviceCount(id);
            BLLManArea area = new BLLManArea();
            int areaCount = area.GetAreaCount(id);
            string info = "";
            if (areaCount > 0)
            {
                info = "area";
            }
            else if (deviceCount > 0)
            {
                info = "device";
            }
            else if (deviceCount == 0 && areaCount == 0)
            {
                info = "area";
            }
            object obj = new
            {
                info = info
            };

            string result = JsonConvert.SerializeObject(obj);
            Response.Write(result);
            Response.End();
        }
Example #2
0
        /// <summary>
        /// 初始化区域信息
        /// </summary>
        /// <param name="id">父类ID</param>
        /// <param name="page">第几页数</param>
        /// <param name="rows">每页数据量</param>
        private void GetLoadArea(string id, int page, int rows)
        {
            BLLManArea area = new BLLManArea();
            count = area.GetAreaCount(id);
            dt = area.GetAreaDt(id, (page - 1) * rows + 1, page * rows);

            IList<Hashtable> list = new List<Hashtable>();
            object obj = null;
            if (count != 0)
            {
                foreach (DataRow row in dt.Rows)
                {
                    Hashtable ht = new Hashtable();
                    ht.Add("ID", row["ID"].ToString());
                    ht.Add("AreaID", row["AreaID"].ToString());
                    ht.Add("AreaName", row["AreaName"].ToString());
                    ht.Add("AreaCD", row["AreaCD"].ToString());
                    list.Add(ht);
                }
                obj = new
                {
                    total = count,
                    rows = list
                };
            }
            else
            {
                obj = new
                {
                    total = 0,
                    rows = list
                };
            }

            string result = JsonConvert.SerializeObject(obj);
            Response.Write(result);
            Response.End();
        }
Example #3
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();
        }