Esempio n. 1
0
        /********** CONSTRUCTOR **********/

        public TaskModel(DictModel dict, IReadOnlyList <UserModel> memberList)
        {
            Id          = dict.i("id");
            Title       = dict.s("title");
            Description = dict.s("description");
            ProjectId   = dict.i("project_id");

            foreach (var i in dict.l("members"))
            {
                DictModel d      = i.ToString();
                UserModel member = null;
                foreach (var m in memberList)
                {
                    if (m.Id == d.i("id"))
                    {
                        member = m;
                        break;
                    }
                }
                if (member != null)
                {
                    AddMember(member);
                }
            }
        }
Esempio n. 2
0
 public void UpdatePotentialProjects(DictModel dict)
 {
     _PotentialProjects.Clear();
     foreach (var p in dict.l("potential_projects"))
     {
         AddPotentialProject(p.ToString());
     }
 }
Esempio n. 3
0
        /********** CONSTRUCTOR **********/

        public ProjectModel(DictModel dict)
        {
            Id   = dict.i("id");
            Name = dict.s("name");

            foreach (var m in dict.l("members"))
            {
                AddMember(m.ToString());
            }
            foreach (var t in dict.l("tasks_todo"))
            {
                AddTask(t.ToString(), "todo");
            }
            foreach (var t in dict.l("tasks_doing"))
            {
                AddTask(t.ToString(), "doing");
            }
            foreach (var t in dict.l("tasks_done"))
            {
                AddTask(t.ToString(), "done");
            }
        }
Esempio n. 4
0
        public void UpdateWithJson(string json)
        {
            DictModel dict = json;

            Id    = dict.i("id");
            Email = dict.s("email");

            foreach (var p in dict.l("projects"))
            {
                AddProject(p.ToString());
            }
            UpdatePotentialProjects(dict);
        }