Пример #1
0
		public static JournalRecord Convert(journalType innerJournalRecord)
		{
			NormalizeJournalType(innerJournalRecord);
			var journalRecord = new JournalRecord()
			{
				OldId = int.Parse(innerJournalRecord.IDEvents),
				DeviceTime = ConvertTime(innerJournalRecord.Dt),
				SystemTime = ConvertTime(innerJournalRecord.SysDt),
				ZoneName = innerJournalRecord.ZoneName,
				Description = innerJournalRecord.EventDesc,
				DeviceName = NormalizeDottedAddress(innerJournalRecord.CLC_Device),
				PanelName = innerJournalRecord.CLC_DeviceSource,
				DeviceDatabaseId = innerJournalRecord.IDDevices,
				PanelDatabaseId = innerJournalRecord.IDDevicesSource,
				User = innerJournalRecord.UserInfo,
				Detalization = innerJournalRecord.CLC_Detalization,
				SubsystemType = EnumsConverter.StringToSubsystemType(innerJournalRecord.IDSubSystem),
				StateType = (StateType)int.Parse(innerJournalRecord.IDTypeEvents),
			};

			return journalRecord;
		}
Пример #2
0
		static void NormalizeJournalType(journalType innerJournalRecord)
		{
			try
			{
				innerJournalRecord.IDEvents = NormalizeString(innerJournalRecord.IDEvents);
				innerJournalRecord.Dt = NormalizeString(innerJournalRecord.Dt);
				innerJournalRecord.SysDt = NormalizeString(innerJournalRecord.SysDt);
				innerJournalRecord.ZoneName = NormalizeString(innerJournalRecord.ZoneName);
				innerJournalRecord.EventDesc = NormalizeString(innerJournalRecord.EventDesc);
				innerJournalRecord.CLC_Device = NormalizeString(innerJournalRecord.CLC_Device);
				innerJournalRecord.CLC_DeviceSource = NormalizeString(innerJournalRecord.CLC_DeviceSource);
				innerJournalRecord.IDDevices = NormalizeString(innerJournalRecord.IDDevices);
				innerJournalRecord.IDDevicesSource = NormalizeString(innerJournalRecord.IDDevicesSource);
				innerJournalRecord.UserInfo = NormalizeString(innerJournalRecord.UserInfo);
				innerJournalRecord.CLC_Detalization = NormalizeString(innerJournalRecord.CLC_Detalization);
				innerJournalRecord.IDSubSystem = NormalizeString(innerJournalRecord.IDSubSystem);
				innerJournalRecord.IDTypeEvents = NormalizeString(innerJournalRecord.IDTypeEvents);
			}
			catch (Exception e)
			{
				Logger.Error(e, "JournalConverter.NormalizeJournalType");
			}
		}