Пример #1
0
        /// <summary>
        /// 实时刷新单灯
        /// </summary>
        /// <returns></returns>
        public JsonResult curHostAllLights()
        {
            if (Request.QueryString["hostGUID"] != null)
            {
                //List<Model.tLightInfoes> list = new List<Model.tLightInfoes>();


                LumluxSSYDB.BLL.tLightInfoes light_bll = new LumluxSSYDB.BLL.tLightInfoes();
                //list = light_bll.GetModelList("sHostInfoGUID='" + Request.QueryString["hostGUID"] + "'");
                LightsViewModel lightVM = new LightsViewModel();
                DataTable       dt      = light_bll.GetLightByWhereInfo(" li.iEnable=1 and sHostInfoGUID='" + Request.QueryString["hostGUID"].ToString() + "'");
                if (dt != null)
                {
                    LightInfoVM hvm;
                    foreach (DataRow dr in dt.Rows)
                    {
                        hvm = addlightInfo(dr);
                        lightVM.LightInfos.Add(hvm);
                    }
                }
                return(this.Json(lightVM.LightInfos));
            }
            else
            {
                return(this.Json(""));
            }
        }
Пример #2
0
        /// <summary>
        /// 点击左菜单获取单灯信息
        /// </summary>
        /// <returns></returns>
        public JsonResult AllMarkerLights()
        {
            if (Request.QueryString["sGUID"] != null)
            {
                LumluxSSYDB.BLL.tLightInfoes light_bll = new LumluxSSYDB.BLL.tLightInfoes();

                LightsViewModel lightVM = new LightsViewModel();
                DataTable       dt      = light_bll.GetLightByWhereInfo(" li.iEnable=1 and sHostInfoGUID='" + Request.QueryString["sGUID"].ToString() + "'");


                if (dt != null)
                {
                    //lightVM.maxLat = GetMaxLat(Request.QueryString["sGUID"].ToString());
                    //lightVM.maxlng = GetMaxLng(Request.QueryString["sGUID"].ToString());
                    LightInfoVM hvm;
                    foreach (DataRow dr in dt.Rows)
                    {
                        hvm = addlightInfo(dr);
                        lightVM.LightInfos.Add(hvm);
                    }
                }
                return(this.Json(lightVM.LightInfos));
            }
            else
            {
                return(this.Json(""));
            }
        }