示例#1
0
        public void Create(Project project)
        {
            var request = new ProjectCreateRequest();

            ModelCopier.CopyModel(project, request);
            var createdProject = Create(request);

            project.Api = Api;
            ModelCopier.CopyModel(createdProject, project);
        }
示例#2
0
        public bool Update(ProjectStub project)
        {
            object a = "/projects/{0}.json".FormatWith(project.Id);
            var    updatedProject = Api.Put <Project>(a, project);

            if (updatedProject != null)
            {
                ModelCopier.CopyModel(updatedProject, project);
                return(true);
            }

            return(false);
        }
示例#3
0
        public bool Update(ToDoListStub list)
        {
            var action  = "/projects/{0}/todolists/{1}.json".FormatWith(list.ProjectId, list.Id);
            var content = Api.Put <ToDoList>(action, list);

            if (content != null)
            {
                content.ProjectId = list.ProjectId;
                ModelCopier.CopyModel(content, list);
                return(true);
            }

            return(false);
        }