Пример #1
0
 /// <summary>
 /// To get all tags of the modules.
 /// </summary>
 /// <returns>BulkAPIResponse&lt;ZCRMTag&gt; class instance.</returns>
 public BulkAPIResponse <ZCRMTag> GetTags()
 {
     if (string.IsNullOrEmpty(this.apiName))
     {
         throw new ZCRMException("Module Api Name MUST NOT be null/empty for GetTags operation");
     }
     return(TagAPIHandler.GetInstance(this).GetTags());
 }
Пример #2
0
 /// <summary>
 /// To delete tag specified tag Id.
 /// </summary>
 /// <returns>APIResponse class instance.</returns>
 public APIResponse Delete()
 {
     if (this.id == null || this.id == 0)
     {
         throw new ZCRMException("Tag ID MUST NOT be null/empty for Delete operation");
     }
     return(TagAPIHandler.GetInstance().Delete(this.id));
 }
Пример #3
0
 /// <summary>
 /// To merge specified ZCRMTag class instance.
 /// </summary>
 /// <returns>APIResponse class instance.</returns>
 /// <param name="mergetag">ZCRMTag class instance</param>
 public APIResponse Merge(ZCRMTag mergetag)
 {
     if (this.id == null || this.id == 0)
     {
         throw new ZCRMException("Tag ID MUST NOT be null/empty for Merge operation");
     }
     if (mergetag.id == null || mergetag.id == 0)
     {
         throw new ZCRMException("Merge Tag ID MUST NOT be null/empty for Merge operation");
     }
     return(TagAPIHandler.GetInstance().Merge(this.Id, mergetag.Id));
 }
Пример #4
0
 /// <summary>
 /// To update tags of the module based on ZCRMTag class instance.
 /// </summary>
 /// <returns>BulkAPIResponse&lt;ZCRMTag&gt; class instance.</returns>
 /// <param name="tags">List of ZCRMTag class instance</param>
 public BulkAPIResponse <ZCRMTag> UpdateTags(List <ZCRMTag> tags)
 {
     if (string.IsNullOrEmpty(this.apiName))
     {
         throw new ZCRMException("Module Api Name MUST NOT be null/empty for UpdateTags operation");
     }
     if (tags.Count <= 0)
     {
         throw new ZCRMException("Tag object list MUST NOT be null/empty for UpdateTags operation");
     }
     return(TagAPIHandler.GetInstance(this).UpdateTags(tags));
 }
Пример #5
0
 /// <summary>
 /// To returns the count of records with the given tag.
 /// </summary>
 /// <returns>APIResponse class instance.</returns>
 /// <param name="tagid">Tag Id (Long) of the module</param>
 public APIResponse GetTagCount(long?tagid)
 {
     if (string.IsNullOrEmpty(this.apiName))
     {
         throw new ZCRMException("Module Api Name MUST NOT be null/empty for GetTagCount operation");
     }
     if (tagid == null || tagid == 0)
     {
         throw new ZCRMException("Tag ID MUST NOT be null/empty for GetTagCount operation");
     }
     return(TagAPIHandler.GetInstance(this).GetTagCount(tagid));
 }
Пример #6
0
 /// <summary>
 /// To update ZCRMTag.
 /// </summary>
 /// <returns>APIResponse class instance.</returns>
 public APIResponse Update()
 {
     if (this.id == null || this.id == 0)
     {
         throw new ZCRMException("Tag ID MUST NOT be null/empty for Update operation");
     }
     if (string.IsNullOrEmpty(this.moduleApiName))
     {
         throw new ZCRMException("Module Api Name MUST NOT be null/empty for Update operation");
     }
     if (string.IsNullOrEmpty(this.name))
     {
         throw new ZCRMException("Tag Name MUST NOT be null/empty for Update operation");
     }
     return(TagAPIHandler.GetInstance().Update(this));
 }
Пример #7
0
 /// <summary>
 /// To remove the tags from record.
 /// </summary>
 /// <returns>APIResponse class instance.</returns>
 /// <param name="tagNames">List of tag names (String)</param>
 public APIResponse RemoveTags(List <string> tagNames)
 {
     if (this.entityId == null || this.entityId == 0)
     {
         throw new ZCRMException("Record ID MUST NOT be null/empty for Remove Tags from a Specific record operation");
     }
     if (string.IsNullOrEmpty(this.moduleAPIName))
     {
         throw new ZCRMException("Module Api Name MUST NOT be null/empty for Remove Tags from a Specific record operation");
     }
     if (tagNames.Count <= 0)
     {
         throw new ZCRMException("Tag Name list MUST NOT be null/empty for Remove Tags from a Specific record operation");
     }
     return(TagAPIHandler.GetInstance().RemoveTags(this, tagNames));
 }
Пример #8
0
 /// <summary>
 /// To add the tags to record.
 /// </summary>
 /// <returns>APIResponse class instance.</returns>
 /// <param name="tagNames">List of tag names (String)</param>
 public APIResponse AddTags(List <string> tagNames)
 {
     if (this.entityId == null || this.entityId == 0)
     {
         throw new ZCRMException("Record ID MUST NOT be null/empty for Add Tags to a Specific record operation");
     }
     if (this.moduleAPIName == null || this.moduleAPIName == "")
     {
         throw new ZCRMException("Module Api Name MUST NOT be null/empty for Add Tags to a Specific record operation");
     }
     if (tagNames.Count <= 0)
     {
         throw new ZCRMException("Tag Name list MUST NOT be null/empty for Add Tags to a Specific record operation");
     }
     return(TagAPIHandler.GetInstance().AddTags(this, tagNames));
 }
Пример #9
0
 /// <summary>
 /// To remove tags from records based on List of record Ids and List of tag names.
 /// </summary>
 /// <returns>BulkAPIResponse&lt;ZCRMTag&gt; class instance.</returns>
 /// <param name="recordIds">List of record Ids (Long) of the module</param>
 /// <param name="tagNames">List of tag names (String) of the module</param>
 public BulkAPIResponse <ZCRMRecord> RemoveTagsFromRecords(List <long> recordIds, List <string> tagNames)
 {
     if (string.IsNullOrEmpty(this.apiName))
     {
         throw new ZCRMException("Module Api Name MUST NOT be null/empty for Remove Tags from Multiple records operation");
     }
     if (tagNames.Count <= 0)
     {
         throw new ZCRMException("Tag Name list MUST NOT be null/empty for Remove Tags from Multiple records operation");
     }
     if (recordIds.Count <= 0)
     {
         throw new ZCRMException("Record ID list MUST NOT be null/empty for Remove Tags from Multiple records operation");
     }
     return(TagAPIHandler.GetInstance(this).RemoveTagsFromRecords(recordIds, tagNames));
 }