Exemple #1
0
        public bool editRecorder(Recorder recorder)
        {
            try
            {
                RecorderPara rp = new RecorderPara();

                rp.id = recorder.Id;
                rp.channelNum = recorder.ChannelNum;
                rp.remark = recorder.Remark;
                rp.name = recorder.Name;
                rp.capacity = recorder.Capacity;
                rp.productor = recorder.Productor;
                rp.type = recorder.Type;
                rp.user = recorder.User;
                rp.password = recorder.Password;
                rp.ip = recorder.Ip;
                rp.port = recorder.Port;

                // string testStr = "{\"id\":4,\"channelNum\":6,\"remark\":\"aa\",\"name\":\"aaaa\",\"capacity\":8,\"productor\":\"海
                //康威视a\",\"type\":\"dvr\",\"user\":\"admin10d\",\"password\":\"111111d\",\"ip\":\"192.168.1.15\"}";

                string jsonStr = JsonConvert.SerializeObject(rp);
                string retStr = sVR.update(jsonStr);

                System.Diagnostics.Debug.WriteLine(retStr);
            }
            catch (System.Exception ex)
            {
                System.Windows.MessageBox.Show(ex.Message);
                return false;
            }

            return true;
        }
Exemple #2
0
        public bool addRecorder(Recorder recorder)
        {
            try
            {
                RecorderPara rp = new RecorderPara();

                rp.id = recorder.Id;
                rp.channelNum = recorder.ChannelNum;
                rp.remark = recorder.Remark;
                rp.name = recorder.Name;
                rp.capacity = recorder.Capacity;
                rp.productor = recorder.Productor;
                rp.type = recorder.Type;
                rp.user = recorder.User;
                rp.password = recorder.Password;
                rp.ip = recorder.Ip;
                // rp.Port = recorder.Port;

                //"{\"id\":0,\"channelNum\":16,\"remark\":\"\",\"name\":\"网络硬盘录像机4盘位NVR DS-7916N-E4\",\"capacity\":8,
                //\"productor\":\"海康威视\",\"type\":\"nvr\",\"user\":\"admin10\",\"password\":\"111111\",\"ip\":\"192.168.1.10\"}"
                string jsonStr = JsonConvert.SerializeObject(rp);
                string retStr = sVR.add(jsonStr);
                System.Diagnostics.Debug.WriteLine(retStr);
            }
            catch (System.Exception ex)
            {
                System.Windows.MessageBox.Show(ex.Message);
                return false;
            }

            return true;
        }