public Notification GetResponse(Response response)
		{
			OnBeforeValidationRequest(response);
			var ackResult = response.Check();
			var notification = CreateNotification(response, ackResult);
			return ReturnNotification(response.Header, notification);
		}
Пример #2
0
		public void TestCreate()
		{
			var doc = new Response();
			Assert.IsNull(doc.Header);
			Assert.IsNull(doc.Document);
			Assert.IsNull(doc.AddDocuments);
			Assert.IsNull(doc.Expansion);
			Assert.IsNull(doc.DocTransfer);
		}
Пример #3
0
		public void TestMissingAreas_Format2()
		{
			var type = new Response();

			var ackResult = type.Check();
			Assert.IsNotNull(ackResult);
			Assert.That(ackResult.Count, Is.GreaterThanOrEqualTo(1));
			var ex = ErrorReceiptCode.MissingAreas_Format;
			var arg0 = "Document";
			var obj = ackResult.FirstOrDefault(p => ((p.errorcode == ex.errorcode) && (p.Value.Contains(arg0))));
			EqualTo(obj, ex, arg0);
		}
Пример #4
0
		private List<AckResult> LoadFromDb(Response data, out List<MainSupplement> source)
		{
			source = new List<MainSupplement>();
			return new List<AckResult>();
		}
Пример #5
0
		private List<AckResult> LoadFromDb(Response data, out Main source)
		{
			source = new Main();
			return new List<AckResult>();
		}
Пример #6
0
		private List<AckResult> SaveToDb(Response data)
		{
			return new List<AckResult>();
		}
Пример #7
0
		private Notification CreateNotification(Response response, List<AckResult> ackResult)
		{
			// TODO: Добавьте код выполняемый после проверки полей полученного запроса

			// TODO: Возможно, потребуется сохранить запрос в базу данных
			if ( ackResult.Count == 0 )
			{
				ackResult.AddRange(SaveToDb(response));
			}

			Main main = null;
			var result = LoadFromDb(response, out main);
			if ( result.Count == 0)
			{
				// TODO: Обрабатываем документ main
			}
			ackResult.AddRange(result);

			List<MainSupplement> supplements = null;
			result = LoadFromDb(response, out supplements);
			if ( result.Count == 0 )
			{
				// TODO: Обрабатываем документы supplements
			}
			ackResult.AddRange(result);

			var notification = Notification.Init();

			// TODO: Необходимо сформировать ответ

			// Добавляем сообщения об ошибках (при необходимости часть можно поправить)
			notification.Acknowledgement.AckResult = ackResult;


			return notification;
		}
Пример #8
0
		partial void OnBeforeValidationRequest(Response request)
		{
			// TODO: Этот метод может быть удален
			// TODO: Добавьте код выполняемый перед проверкой полей полученного запроса
		}
Пример #9
0
		public static bool LoadFromFile(string fileName, out Response obj)
		{
			System.Exception exception = null;
			return LoadFromFile(fileName, out obj, out exception);
		}
Пример #10
0
		public static bool LoadFromFile(string fileName, out Response obj, out System.Exception exception)
		{
			return LoadFromFile(fileName, Encoding.UTF8, out obj, out exception);
		}
Пример #11
0
		/// <summary>
		/// Deserializes xml markup from file into an Header object
		/// </summary>
		/// <param name="fileName">string xml file to load and deserialize</param>
		/// <param name="obj">Output Header object</param>
		/// <param name="exception">output Exception value if deserialize failed</param>
		/// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
		public static bool LoadFromFile(string fileName, System.Text.Encoding encoding, out Response obj, out System.Exception exception)
		{
			exception = null;
			obj = default(Response);
			try
			{
				obj = LoadFromFile(fileName, encoding);
				return true;
			}
			catch ( System.Exception ex )
			{
				exception = ex;
				return false;
			}
		}
Пример #12
0
		public static bool Deserialize(string xml, out Response obj)
		{
			System.Exception exception = null;
			return Deserialize(xml, out obj, out exception);
		}
Пример #13
0
		/// <summary>
		/// Deserializes workflow markup into an Header object
		/// </summary>
		/// <param name="xml">string workflow markup to deserialize</param>
		/// <param name="obj">Output Header object</param>
		/// <param name="exception">output Exception value if deserialize failed</param>
		/// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
		public static bool Deserialize(string xml, out Response obj, out System.Exception exception)
		{
			exception = null;
			obj = default(Response);
			try
			{
				obj = Deserialize(xml);
				return true;
			}
			catch ( System.Exception ex )
			{
				exception = ex;
				return false;
			}
		}
		partial void OnBeforeValidationRequest(Response response);