public static OperationResult<bool> GKWriteConfiguration(XDevice device, string userName)
		{
			AddGKMessage(EventName.Запись_конфигурации_в_прибор, "", device, userName, true);
			Stop();
			var gkDescriptorsWriter = new GkDescriptorsWriter();
			gkDescriptorsWriter.WriteConfig(device);
			Start();
			if (gkDescriptorsWriter.Error != null)
				return new OperationResult<bool>(gkDescriptorsWriter.Error) { Result = false };
			return new OperationResult<bool>() { Result = true };
		}
Beispiel #2
0
		public static OperationResult<bool> GKWriteConfiguration(GKDevice device, string userName, GKProgressCallback progressCallback, Guid clientUID)
		{
			AddGKMessage(JournalEventNameType.Запись_конфигурации_в_прибор, JournalEventDescriptionType.NULL, "", device, userName);

			Stop();
			GKSyncronyseTime(device, userName);
			var gkDescriptorsWriter = new GkDescriptorsWriter();
			gkDescriptorsWriter.WriteConfig(device, progressCallback, clientUID);
			Start();

			if (gkDescriptorsWriter.Errors.Count > 0)
			{
				var errors = new List<string>();
				foreach (var error in gkDescriptorsWriter.Errors)
				{
					errors.Add(error);
				}
				return OperationResult<bool>.FromError(errors, false);
			}
			return new OperationResult<bool>(true);
		}