using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ZionRobot.Models.ZFlow
{
    public class Activity
    {
        public string Action { get; set; }
        public int EntityId { get; set; }
        public int Id { get; set; }
        public int TypeId { get; set; }
        public string TypeDescription { get; set; }
        public string Client { get; set; }
        public string ClientCode { get; set; }
        public string Sponsor { get; set; }
        public string SponsorEmail { get; set; }
        public string Subject { get; set; }
        public string Date { get; set; }
        public string DateFinal { get; set; }
        public string Status { get; set; }
        public string Group { get; set; }
        public string DataJuri { get; set; }
        public int? ParentId { get; set; }
        public string ParentDataJuri { get; set; }
        public string ProcessNumber { get; set; }
        public string ProcessURL { get; set; }
        public string CaseURL { get; set; }
        public string Sharepoint { get; set; }
        public string Parecer { get; set; }
        public string Hour { get; set; }
        public string Content { get; set; }
        public string CreatedAt { get; set; }
        public string Priority { get; set; }
        public string EmailTo { get; set; }
        public string EmailSubject { get; set; }
        public string EmailContent { get; set; }
        public string EmailReplyContent { get; set; }
        public string EmailReplaySubject { get; set; }
        //public Dictionary<string, string> Attachments { get; set; }
        public List<Attachment> Attachments { get; set; }
        public Dictionary<string, string> Fields { get; set; }
        public string Comment { get; set; }
        public string CommentCreateBy { get; set; }
        public List<Comment> Comments { get; set; }
        public List<Deadline> Deadlines { get; set; }
        public int SyncId { get; set; }
        public string SyncCreateAt { get; set; }
        //public List<Activity> SubActivities { get; set; }


        public Activity()
        {
            Fields = new Dictionary<string, string>();
            //Attachments = new Dictionary<string, string>();
            Attachments = new List<Attachment>();
            Comments = new List<Comment>();
            Deadlines = new List<Deadline>();
            //SubActivities = new List<Activity>();
        }

        public void createActivity()
        {
            try
            {
                var result = new WebService.Activity().ActivityCreate(this);
            }
            catch (Exception ex)
            {
                throw;
            }
        }

        public void UpdateActivityUrl()
        {
            var result = new WebService.Activity().UpdateActivityUrl(this);
        }
        public void UpdateActivityFieldValue(string name, string value)
        {
            var result = new WebService.Activity().UpdateActivityFieldValue(this, name, value);
        }
        /*public void UpdateActivityCaseUrl()
        {
            var result = new WebService.Activity().UpdateActivityCaseUrl(this);
        }*/
        public void UpdateActivitySycn(int syncStatus)
        {
            var result = new WebService.Activity().UpdateActivitySync(this, syncStatus);
        }
      
        public void CanceledActivity()
        {
            var result = new WebService.Activity().ActivityCanceled(this);
        }

        public void DoneActivity()
        {
            var result = new WebService.Activity().ActivityDone(this);
        }

    }
}
