private ProjectProfiles ConvertLocalToServer(Projects local)
 {
     ProjectProfiles profile = new ProjectProfiles();
     profile.Id = local.SId;
     //profile.Color=Utils.ConvertColorToRGB(local.Color));      // TODO 颜色暂时不考虑
     profile.InAll = local.IsShowInAll();
     profile.ModifiedTime = local.ModifiedTime;
     profile.Name = local.Name;
     profile.SortOrder = local.SortOrder;
     profile.SortType = local.SortType;
     profile.Closed = local.IsClosed();
     return profile;
 }
 public Projects ConvertServerToLocal(ProjectProfiles profile, Projects project)
 {
     project.Status = ModelStatusEnum.SYNC_DONE;
     project.SId = profile.Id;
     project.Name = profile.Name;
     project.Color = profile.Color ?? null;
     project.SortOrder = profile.SortOrder;
     project.UserCount = profile.UserCount;
     project.ShowInAll = profile.InAll;
     project.Etag = profile.Etag;
     project.SortType = profile.SortType;
     project.ModifiedTime = profile.ModifiedTime;
     if (profile.Closed != null)
     {
         project.Closed = profile.Closed ?? false ? ModelStatusEnum.CLOSED_YES : ModelStatusEnum.CLOSED_NO;
     }
     else
     {
         project.Closed = ModelStatusEnum.CLOSED_NO;
     }
     //试着记录日志
     return project;
 }
 public Projects ConvertServerToLocal(ProjectProfiles serverProfile, string userId)
 {
     Projects project = new Projects();
     project.UserId = userId;
     return ConvertServerToLocal(serverProfile, project);
 }