コード例 #1
0
        //刷新左侧菜单报警状态
        public JsonResult ReloadState()
        {
            if (!string.IsNullOrEmpty(PrjGUID))
            {
                BLL.tHostInfo   bllhost = new BLL.tHostInfo();
                Model.tHostInfo modhost = new Model.tHostInfo();

                MainViewModel mainVM = new MainViewModel();
                DataTable     dt     = bllhost.GetHostInfo("dbo.tHostInfo.sProjectInfoGUID='" + PrjGUID + "'");

                if (dt != null)
                {
                    dt.Columns.Add("hostByLightCount");
                    dt.Columns.Add("hostByAlarmLightCount");
                    HostInfoVM hvm;


                    foreach (DataRow dr in dt.Rows)
                    {
                        hvm = addInfo(dr);
                        mainVM.HostInfos.Add(hvm);
                    }
                    ;
                }
                return(this.Json(mainVM.HostInfos));
            }
            else
            {
                return(this.Json(""));
            }
        }
コード例 #2
0
        public JsonResult MapInitLeftMenu()
        {
            List <HostInfoVM> list     = new List <HostInfoVM>();
            string            imageurl = "logoMain.png";

            ViewBag.PrjectGUID = PrjGUID;
            BLL.tHostInfo bllhost = new BLL.tHostInfo();
            MainViewModel mainVM  = new MainViewModel();


            //ViewBag.MapCenterLat = GetLat("Prject_CenterPoint_Lat");
            //ViewBag.MapCenterLng = GetLng("Prject_CenterPoint_Lng");
            DataTable allhostdt = bllhost.GetHostInfo(" dbo.tHostInfo.sProjectInfoGUID='" + PrjGUID + "' ");

            if (allhostdt != null)
            {
                allhostdt.Columns.Add("hostByLightCount");
                allhostdt.Columns.Add("hostByAlarmLightCount");
                HostInfoVM hvm;
                foreach (DataRow dr in allhostdt.Rows)
                {
                    hvm = addInfo(dr);

                    mainVM.HostInfos.Add(hvm);
                }
                return(this.Json(mainVM));
            }
            return(this.Json(""));
        }
コード例 #3
0
        //
        // GET: /Lamp/Main/
        public ActionResult Index()
        {
            #region 加载左侧所有主机信息

            LumluxSSYDB.Model.tUserInfoes ui    = new LumluxSSYDB.Model.tUserInfoes();
            LumluxSSYDB.BLL.tUserInfoes   uiBll = new LumluxSSYDB.BLL.tUserInfoes();

            ui = uiBll.GetModel(UserID);

            ViewBag.ConfigMap = ui.sRemark;

            ViewBag.PrjectGUID = PrjGUID;
            BLL.tHostInfo bllhost = new BLL.tHostInfo();
            MainViewModel mainVM  = new MainViewModel();

            BLL.tPrjectInfo   tp     = new BLL.tPrjectInfo();
            Model.tPrjectInfo tp_mod = tp.GetModel(PrjGUID);
            if (tp_mod != null)
            {
                mainVM.MapCenterLat = tp_mod.fLat.ToString();
                mainVM.MapCenterLng = tp_mod.fLng.ToString();
            }
            //mainVM.MapCenterLat = GetLat("Prject_CenterPoint_Lat");
            //mainVM.MapCenterLng = GetLng("Prject_CenterPoint_Lng");
            DataTable allhostdt = bllhost.GetHostInfo("dbo.tHostInfo.sProjectInfoGUID='" + PrjGUID + "'");
            if (allhostdt != null)
            {
                allhostdt.Columns.Add("hostByLightCount");
                allhostdt.Columns.Add("hostByAlarmLightCount");
                HostInfoVM hvm;
                foreach (DataRow dr in allhostdt.Rows)
                {
                    hvm = addInfo(dr);

                    mainVM.HostInfos.Add(hvm);
                }
            }
            #endregion


            #region 获取当前项目的标题
            ViewBag.Title = ToString(GetSetValue("MainTitle", "sValue")) == "" ? "无标题,请联系管理员..." : ToString(GetSetValue("MainTitle", "sValue"));
            #endregion

            ViewData["Message"] = "WW";
            return(View(mainVM));
        }
コード例 #4
0
        public JsonResult AllMarker()
        {
            BLL.tHostInfo   bllhost = new BLL.tHostInfo();
            Model.tHostInfo modhost = new Model.tHostInfo();
            MainViewModel   mainVM  = new MainViewModel();

            if (Request.QueryString["sGUID"] != null)
            {
                DataTable dt = bllhost.GetHostInfo("dbo.tHostInfo.sGUID='" + Request.QueryString["sGUID"] + "'");
                //mainVM.maxLat = GetMaxLat(Request.QueryString["sGUID"].ToString());
                //mainVM.maxlng = GetMaxLng(Request.QueryString["sGUID"].ToString());
                if (dt != null)
                {
                    dt.Columns.Add("hostByLightCount");
                    dt.Columns.Add("hostByAlarmLightCount");
                    HostInfoVM hvm;
                    foreach (DataRow dr in dt.Rows)
                    {
                        hvm = addInfo(dr);
                        //hvm = new HostInfoVM();
                        //hvm.GUID = dr["sGUID"].ToString();
                        //hvm.ID = ToString(dr["sID_Addr"]);
                        //hvm.Lat = ToString(dr["fLat"]);
                        //hvm.Lng = ToString(dr["fLng"]);
                        //hvm.Name = ToString(dr["sName"].ToString());
                        //hvm.UpdateTime = Convert.ToDateTime(ToString(dr["dUpdateTime"]) == "" ? "1999-01-01 00:00:00" : ToString(dr["dUpdateTime"]));
                        //hvm.GroupName = dr["GroupName"].ToString();
                        //hvm.Online = Convert.ToInt32(ToString(dr["iState_Online"]) == "" ? "0" : ToString(dr["iState_Online"]));
                        //hvm.Alarm = Convert.ToInt32(ToString(dr["iState_Alarm"]) == "" ? "0" : ToString(dr["iState_Alarm"]));
                        mainVM.HostInfos.Add(hvm);
                    }
                    // ViewBag.hostlist = mainVM.HostInfos;
                }
                return(this.Json(mainVM));
            }
            else
            {
                return(this.Json(""));
            }
        }
コード例 #5
0
        //模糊搜索
        public JsonResult SeachData()
        {
            if (Request.QueryString["sWhere"] != null)
            {
                BLL.tHostInfo   bllhost = new BLL.tHostInfo();
                Model.tHostInfo modhost = new Model.tHostInfo();

                MainViewModel mainVM = new MainViewModel();
                DataTable     dt     = bllhost.GetHostInfo(" dbo.tHostInfo.sProjectInfoGUID='" + PrjGUID + "' and dbo.tHostInfo.sName like'%" + Request.QueryString["sWhere"].ToString() + "%'");

                if (dt != null)
                {
                    dt.Columns.Add("hostByLightCount");
                    dt.Columns.Add("hostByAlarmLightCount");
                    HostInfoVM hvm;
                    foreach (DataRow dr in dt.Rows)
                    {
                        hvm = addInfo(dr);
                        //hvm = new HostInfoVM();
                        //hvm.GUID = dr["sGUID"].ToString();
                        //hvm.ID = ToString(dr["sID_Addr"]);
                        //hvm.Lat = ToString(dr["fLat"]);
                        //hvm.Lng = ToString(dr["fLng"]);
                        //hvm.Name = ToString(dr["sName"].ToString());
                        //hvm.sUpdateTime = ToString(dr["dUpdateTime"]) == "" ? "1999-01-01 00:00:00" : ToString(dr["dUpdateTime"]);
                        //hvm.GroupName = dr["GroupName"].ToString();
                        //hvm.Online = Convert.ToInt32(ToString(dr["iState_Online"]) == "" ? "0" : ToString(dr["iState_Online"]));
                        //hvm.Alarm = Convert.ToInt32(ToString(dr["iState_Alarm"]) == "" ? "0" : ToString(dr["iState_Alarm"]));
                        mainVM.HostInfos.Add(hvm);
                    }
                    ;
                }
                return(this.Json(mainVM.HostInfos));
            }
            else
            {
                return(this.Json(""));
            }
        }