using System;
using System.Collections.Generic;
using System.Web.Script.Serialization;
using Newtonsoft.Json;
using ZionRobot.Models.ZFlow;
using ZionRobot.Persistence;
using ZionVault.WebService;

namespace ZionRobot.WebService
{
	// Token: 0x02000014 RID: 20
	public class Activity
	{
		// Token: 0x06000069 RID: 105 RVA: 0x00004D9C File Offset: 0x00002F9C
		internal string ActivityCreate(Activity activity)
		{
			return new Client(WSProperties.UrlApi)._request("PUT", WSProperties.ActivityCreate, WSProperties.Token, null, new JavaScriptSerializer().Serialize(activity), null);
		}

		// Token: 0x0600006A RID: 106 RVA: 0x00004DDC File Offset: 0x00002FDC
		internal string UpdateActivityUrl(Activity activity)
		{
			return new Client(WSProperties.UrlApi)._request("PUT", WSProperties.UpdateActivityUrl, WSProperties.Token, null, new JavaScriptSerializer().Serialize(activity), null);
		}

		// Token: 0x0600006B RID: 107 RVA: 0x00004E1C File Offset: 0x0000301C
		internal string UpdateActivityCaseUrl(Activity activity)
		{
			return new Client(WSProperties.UrlApi)._request("PUT", WSProperties.UpdateActivityCaseUrl, WSProperties.Token, null, new JavaScriptSerializer().Serialize(activity), null);
		}

		// Token: 0x0600006C RID: 108 RVA: 0x00004E5C File Offset: 0x0000305C
		internal string UpdateActivityFieldValue(Activity activity, string name, string value)
		{
			return new Client(WSProperties.UrlApi)._request("PUT", WSProperties.UpdateActivityFieldValue, WSProperties.Token, null, new JavaScriptSerializer().Serialize(new
			{
				EntityId = activity.EntityId,
				ActivityId = activity.Id,
				ElementName = name,
				Value = value
			}), null);
		}

		// Token: 0x0600006D RID: 109 RVA: 0x00004EAC File Offset: 0x000030AC
		internal string UpdateActivitySync(Activity activity, int syncStatus)
		{
			return new Client(WSProperties.UrlApi)._request("PUT", WSProperties.UpdateActivitySync, WSProperties.Token, null, new JavaScriptSerializer().Serialize(new
			{
				EntityId = activity.EntityId,
				ActivityId = activity.Id,
				SyncId = activity.SyncId,
				SyncStatus = syncStatus
			}), null);
		}

		// Token: 0x0600006E RID: 110 RVA: 0x00004F00 File Offset: 0x00003100
		internal string UpdateAttachmentLink(Attachment attachemnt)
		{
			return new Client(WSProperties.UrlApi)._request("PUT", WSProperties.UpdateAttachmentLink, WSProperties.Token, null, new JavaScriptSerializer().Serialize(new
			{
				EntityId = attachemnt.EntityId,
				ActivityId = attachemnt.ActivityId,
				Link = attachemnt.Link.AbsoluteUri
			}), null);
		}

		// Token: 0x0600006F RID: 111 RVA: 0x00004F58 File Offset: 0x00003158
		internal List<Activity> ActivityToSync()
		{
			string result = new Client(WSProperties.UrlApi)._request("GET", WSProperties.ActivitiesToSync, WSProperties.Token, null, string.Empty, null);
			return JsonConvert.DeserializeObject<List<Activity>>(result);
		}

		// Token: 0x06000070 RID: 112 RVA: 0x00004F98 File Offset: 0x00003198
		internal List<Activity> ActivitiesToCreateDataJuri()
		{
			string result = new Client(WSProperties.UrlApi)._request("GET", WSProperties.ActivitiesToCreateDataJuri, WSProperties.Token, null, string.Empty, null);
			JavaScriptSerializer jsonSerialiser = new JavaScriptSerializer();
			return jsonSerialiser.Deserialize<List<Activity>>(result);
		}

		// Token: 0x06000071 RID: 113 RVA: 0x00004FE0 File Offset: 0x000031E0
		internal List<Activity> ActivityToCanceling()
		{
			string result = new Client(WSProperties.UrlApi)._request("GET", WSProperties.ActivitiesToCanceling, WSProperties.Token, null, new JavaScriptSerializer().Serialize(new
			{
				name = "Wu shang hao"
			}), null);
			JavaScriptSerializer jsonSerialiser = new JavaScriptSerializer();
			return jsonSerialiser.Deserialize<List<Activity>>(result);
		}

		// Token: 0x06000072 RID: 114 RVA: 0x00005038 File Offset: 0x00003238
		internal List<Activity> ActivityCanceled(Activity activity)
		{
			string result = new Client(WSProperties.UrlApi)._request("PUT", WSProperties.ActivityCanceled, WSProperties.Token, null, new JavaScriptSerializer().Serialize(new
			{
				entity_id = activity.EntityId,
				id = activity.Id,
				activity_type_id = activity.TypeId
			}), null);
			JavaScriptSerializer jsonSerialiser = new JavaScriptSerializer();
			return jsonSerialiser.Deserialize<List<Activity>>(result);
		}

		// Token: 0x06000073 RID: 115 RVA: 0x0000509C File Offset: 0x0000329C
		internal string ActivityDone(Activity activity)
		{
			return new Client(WSProperties.UrlApi)._request("PUT", WSProperties.ActivityDone, WSProperties.Token, null, new JavaScriptSerializer().Serialize(new
			{
				entity_id = activity.EntityId,
				id = activity.Id,
				activity_type_id = activity.TypeId
			}), null);
		}
	}
}
