|
|
@@ -359,5 +359,43 @@ namespace DeviceCenter
|
|
|
}
|
|
|
return;
|
|
|
}
|
|
|
+
|
|
|
+ public void getDepartments()
|
|
|
+ {
|
|
|
+ int m_userId = -1;
|
|
|
+ AcsDevice device = null;
|
|
|
+ try
|
|
|
+ {
|
|
|
+ device = (AcsDevice)devices.First(i => i.type == DeviceType.ACS && i.status == DeviceStatus.CONNECTED);
|
|
|
+ }
|
|
|
+ catch { }
|
|
|
+ if (device == null)
|
|
|
+ {
|
|
|
+ log.Info("no connected device");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ IntPtr lpRequestUrl = IntPtr.Zero;
|
|
|
+ try
|
|
|
+ {
|
|
|
+ CHCNetSDK.NET_DVR_XML_CONFIG_INPUT input = new CHCNetSDK.NET_DVR_XML_CONFIG_INPUT();
|
|
|
+ CHCNetSDK.NET_DVR_XML_CONFIG_INPUT output = new CHCNetSDK.NET_DVR_XML_CONFIG_INPUT();
|
|
|
+ string url = "/ISAPI/AccessControl/DepartmentParam/capabilities";
|
|
|
+ lpRequestUrl = Marshal.StringToHGlobalAnsi(url);
|
|
|
+ input.lpRequestUrl = lpRequestUrl;
|
|
|
+ IntPtr inputPtr = new IntPtr();
|
|
|
+ IntPtr outputPtr = new IntPtr();
|
|
|
+ Marshal.StructureToPtr(input, inputPtr, true);
|
|
|
+ CHCNetSDK.NET_DVR_STDXMLConfig(m_userId, inputPtr, outputPtr);
|
|
|
+ }
|
|
|
+ catch (Exception e) { }
|
|
|
+ finally
|
|
|
+ {
|
|
|
+ if (lpRequestUrl != IntPtr.Zero)
|
|
|
+ {
|
|
|
+ Marshal.FreeHGlobal(lpRequestUrl);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|