Ejemplo n.º 1
0
        public override void ExecuteCommand(AppSession session, StringRequestInfo requestInfo)
        {
            List <CameraList>       cameraList;
            List <StreamMediaList>  streamMediaList;
            List <StreamServerList> streamServerList;
            List <StationList>      stationList;
            //获取数据库的所有设备信息,登录设备
            CameraListRepository camera = new CameraListRepository();

            cameraList = camera.GetList();
            StreamMediaListRepository streamMedia = new StreamMediaListRepository();

            streamMediaList = streamMedia.GetList();
            StreamServerListRepository streamServer = new StreamServerListRepository();

            streamServerList = streamServer.GetList();
            StationListRepository station = new StationListRepository();

            stationList = station.GetList();
            //组装数据
            DeviceData data = new DeviceData();

            data.cameraList       = cameraList;
            data.streamMediaList  = streamMediaList;
            data.streamServerList = streamServerList;
            data.stationList      = stationList;
            //转json
            string str = JsonConvert.SerializeObject(data);

            session.Send(str);
        }
Ejemplo n.º 2
0
        private void RefreshVideo()
        {
            StationListRepository repo = new StationListRepository();

            stationList = repo.GetList();
            dataGridView_StationInfo.DataSource = stationList.Select(_ =>
            {
                return(new { _.StationID, _.Name, Lon = _.Lon ?? 0, Lat = _.Lat ?? 0, _.Description, _.Mark });
            }).ToList();
        }