Beispiel #1
0
 public void UpdateCategory(PCOData data, List <PCOData> included)
 {
     if (data.relationships != null)
     {
         if (data.relationships.note_category != null)
         {
             foreach (var relationship in data.relationships.note_category.data)
             {
                 var item = included
                            .Where(i =>
                                   i.type == relationship.type &&
                                   i.id == relationship.id
                                   )
                            .FirstOrDefault();
                 if (item != null)
                 {
                     note_category = new PCONoteCategory(item);
                 }
             }
         }
     }
 }
Beispiel #2
0
 public void UpdateDesignation(PCOData data, List <PCOData> included)
 {
     if (data.relationships != null)
     {
         if (data.relationships.designations != null)
         {
             foreach (var relationship in data.relationships.designations.data)
             {
                 var item = included
                            .Where(i =>
                                   i.type == relationship.type &&
                                   i.id == relationship.id
                                   )
                            .FirstOrDefault();
                 if (item != null)
                 {
                     designations.Add(new PCODesignation(item));
                 }
             }
         }
     }
 }
Beispiel #3
0
        public void UpdateTags(PCOData data, List <PCOData> included)
        {
            tags = new List <PCOTag>();

            if (data.relationships != null)
            {
                if (data.relationships.tags != null)
                {
                    foreach (var relationship in data.relationships.tags.data)
                    {
                        var item = included
                                   .Where(i =>
                                          i.type == relationship.type &&
                                          i.id == relationship.id)
                                   .FirstOrDefault();
                        if (item != null)
                        {
                            tags.Add(new PCOTag(item));
                        }
                    }
                }
            }
        }
Beispiel #4
0
 public PCOBatch(PCOData data)
 {
     id             = data.id;
     committed_at   = data.Item.committed_at;
     created_at     = data.Item.created_at;
     description    = data.Item.description;
     total_cents    = data.Item.total_cents;
     total_currency = data.Item.total_currency;
     updated_at     = data.Item.updated_at;
     if (data.relationships != null)
     {
         if (data.relationships.owner != null)
         {
             foreach (var relationship in data.relationships.owner.data)
             {
                 if (relationship != null)
                 {
                     ownerId = relationship.id;
                 }
             }
         }
     }
 }
Beispiel #5
0
 public PCOEmailTemplate(PCOData data)
 {
     id      = data.id;
     kind    = data.Item.kind;
     subject = data.Item.subject;
 }
Beispiel #6
0
 public PCOPhoneNumber(PCOData data)
 {
     id       = data.id;
     number   = data.Item.number;
     location = data.Item.location;
 }
Beispiel #7
0
 public void UpdateProperties(PCOData data, List <PCOData> included)
 {
     if (data.relationships != null)
     {
         if (data.relationships.inactive_reason != null)
         {
             foreach (var relationship in data.relationships.inactive_reason.data)
             {
                 if (relationship != null)
                 {
                     var item = included
                                .Where(i =>
                                       i.type == relationship.type &&
                                       i.id == relationship.id
                                       )
                                .FirstOrDefault();
                     if (item != null)
                     {
                         inactive_reason = item.Item.value;
                     }
                 }
             }
         }
         if (data.relationships.marital_status != null)
         {
             foreach (var relationship in data.relationships.marital_status.data)
             {
                 if (relationship != null)
                 {
                     var item = included
                                .Where(i =>
                                       i.type == relationship.type &&
                                       i.id == relationship.id
                                       )
                                .FirstOrDefault();
                     if (item != null)
                     {
                         marital_status = item.Item.value;
                     }
                 }
             }
         }
         if (data.relationships.name_prefix != null)
         {
             foreach (var relationship in data.relationships.name_prefix.data)
             {
                 if (relationship != null)
                 {
                     var item = included
                                .Where(i =>
                                       i.type == relationship.type &&
                                       i.id == relationship.id
                                       )
                                .FirstOrDefault();
                     if (item != null)
                     {
                         name_prefix = item.Item.value;
                     }
                 }
             }
         }
         if (data.relationships.school != null)
         {
             foreach (var relationship in data.relationships.school.data)
             {
                 if (relationship != null)
                 {
                     var item = included
                                .Where(i =>
                                       i.type == relationship.type &&
                                       i.id == relationship.id
                                       )
                                .FirstOrDefault();
                     if (item != null)
                     {
                         school = item.Item.value;
                     }
                 }
             }
         }
         if (data.relationships.name_suffix != null)
         {
             foreach (var relationship in data.relationships.name_suffix.data)
             {
                 if (relationship != null)
                 {
                     var item = included
                                .Where(i =>
                                       i.type == relationship.type &&
                                       i.id == relationship.id
                                       )
                                .FirstOrDefault();
                     if (item != null)
                     {
                         name_suffix = item.Item.value;
                     }
                 }
             }
         }
     }
 }
Beispiel #8
0
 public void UpdateServicesInfo(PCOData data)
 {
     services    = true;
     legacy_id   = data.Item.legacy_id;
     permissions = data.Item.permissions;
 }
Beispiel #9
0
 public PCOTag(PCOData data) : this()
 {
     id   = data.id;
     name = data.Item.name;
 }
Beispiel #10
0
 public PCOTagGroup(PCOData data) : this()
 {
     id         = data.id;
     name       = data.Item.name;
     folderName = data.Item.service_type_folder_name;
 }
Beispiel #11
0
 public PCONoteCategory(PCOData data)
 {
     id   = data.id;
     name = data.Item.name;
 }
Beispiel #12
0
 public PCOFieldOption(PCOData data)
 {
     id       = data.id;
     value    = data.Item.value;
     sequence = data.Item.sequence;
 }