using System;
using System.Collections.Generic;
using System.Web.Script.Serialization;
namespace Retailcrm.Versions.V5
{
public partial class Client
{
///
/// Combine orders
///
///
///
///
///
public Response OrdersCombine(Dictionary order, Dictionary resultOrder, string technique = "ours")
{
if (order.Count <= 0)
{
throw new ArgumentException("Parameter `order` must contains a data");
}
if (!order.ContainsKey("id"))
{
throw new ArgumentException("Parameter `order` must contains `id` key");
}
if (resultOrder.Count <= 0)
{
throw new ArgumentException("Parameter `resultOrder` must contains a data");
}
if (!resultOrder.ContainsKey("id"))
{
throw new ArgumentException("Parameter `resultOrder` must contains `id` key");
}
return Request.MakeRequest(
"/orders/combine",
Request.MethodPost,
new Dictionary
{
{ "technique", technique },
{ "order", new JavaScriptSerializer().Serialize(order) },
{ "resultOrder", new JavaScriptSerializer().Serialize(resultOrder) }
}
);
}
}
}