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: 0x0200001C RID: 28
	public class Activity
	{
		// Token: 0x0600009B RID: 155 RVA: 0x00005998 File Offset: 0x00003B98
		internal string ActivityCreate(Activity activity)
		{
			return new Client(WSProperties.UrlApi)._request("PUT", WSProperties.ActivityCreate, WSProperties.Token, null, new JavaScriptSerializer().Serialize(activity), null);
		}

		// Token: 0x0600009C RID: 156 RVA: 0x000059D8 File Offset: 0x00003BD8
		internal string UpdateActivityUrl(Activity activity)
		{
			return new Client(WSProperties.UrlApi)._request("PUT", WSProperties.UpdateActivityUrl, WSProperties.Token, null, new JavaScriptSerializer().Serialize(activity), null);
		}

		// Token: 0x0600009D RID: 157 RVA: 0x00005A18 File Offset: 0x00003C18
		internal string UpdateActivityCaseUrl(Activity activity)
		{
			return new Client(WSProperties.UrlApi)._request("PUT", WSProperties.UpdateActivityCaseUrl, WSProperties.Token, null, new JavaScriptSerializer().Serialize(activity), null);
		}

		// Token: 0x0600009E RID: 158 RVA: 0x00005A58 File Offset: 0x00003C58
		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: 0x0600009F RID: 159 RVA: 0x00005AA8 File Offset: 0x00003CA8
		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: 0x060000A0 RID: 160 RVA: 0x00005AFC File Offset: 0x00003CFC
		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: 0x060000A1 RID: 161 RVA: 0x00005B54 File Offset: 0x00003D54
		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: 0x060000A2 RID: 162 RVA: 0x00005B94 File Offset: 0x00003D94
		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: 0x060000A3 RID: 163 RVA: 0x00005BDC File Offset: 0x00003DDC
		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: 0x060000A4 RID: 164 RVA: 0x00005C34 File Offset: 0x00003E34
		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: 0x060000A5 RID: 165 RVA: 0x00005C98 File Offset: 0x00003E98
		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);
		}
	}
}
