Пример #1
0
        private object delDevicePro(object param)
        {
            int num = 1;

            System.Collections.ArrayList arrayList = param as System.Collections.ArrayList;
            DBConn connection = DBConnPool.getConnection();

            for (int i = 0; i < arrayList.Count; i++)
            {
                string     value      = (string)arrayList[i];
                DeviceInfo deviceByID = DeviceOperation.getDeviceByID(System.Convert.ToInt32(value));
                int        num2       = DeviceOperation.DeleteDeviceByID(connection, System.Convert.ToInt32(value));
                if (num2 < 0)
                {
                    num = num2;
                }
                else
                {
                    string valuePair = ValuePairs.getValuePair("Username");
                    if (!string.IsNullOrEmpty(valuePair))
                    {
                        LogAPI.writeEventLog("0430001", new string[]
                        {
                            deviceByID.ModelNm,
                            deviceByID.Mac,
                            deviceByID.DeviceIP,
                            deviceByID.DeviceName,
                            valuePair
                        });
                    }
                    else
                    {
                        LogAPI.writeEventLog("0430001", new string[]
                        {
                            deviceByID.ModelNm,
                            deviceByID.Mac,
                            deviceByID.DeviceIP,
                            deviceByID.DeviceName
                        });
                    }
                }
            }
            connection.Close();
            DeviceOperation.RefreshDBCache(false);
            DeviceOperation.StartDBCleanupThread();
            return(num);
        }