Exemplo n.º 1
0
        /// <summary>
        /// Get email id by email type id and email name.
        /// </summary>
        /// <param name="emailTypeId">email type id</param>
        /// <param name="emailName">email name</param>
        /// <returns>email id</returns>
        public String getDirectEmailId(String emailTypeId, String emailName)
        {
            if (logger.IsDebugEnabled)
            {
                logger.Debug("getEmailId:emailTypeId=" + emailTypeId + ",emailName=" + emailName);
            }

            String result = "";

            DirectEmailTypeIDRequest request = new DirectEmailTypeIDRequest();
            try
            {
                request.directEmailTypeId = emailTypeId;
                request.sorting = new Sorting();
                request.sorting.sortBy = "label";
                request.sorting.sortOrder = "desc";
                request.paging = new PagingIn();
                request.paging.pageNr = 1;
                request.paging.pageSize = 300;
                DirectEmailListResponse response = directEmailService.getByDirectEmailTypeId(request);

                foreach (DirectEmailForListing item in response.directEmails)
                {
                    if (item.name.Equals(emailName))
                    {
                        return item.id;
                    }
                }

            }
            catch (System.Web.Services.Protocols.SoapException ex)
            {
                if (logger.IsDebugEnabled)
                {
                    logger.Debug("error happens in getting email type id, error is" + result);
                }
                throw new Exception(ex.Detail.InnerXml);
            }
            return result;
        }
Exemplo n.º 2
0
 /// <remarks/>
 public void getByDirectEmailTypeIdAsync(DirectEmailTypeIDRequest getByDirectEmailTypeIdRequest, object userState) {
     if ((this.getByDirectEmailTypeIdOperationCompleted == null)) {
         this.getByDirectEmailTypeIdOperationCompleted = new System.Threading.SendOrPostCallback(this.OngetByDirectEmailTypeIdOperationCompleted);
     }
     this.InvokeAsync("getByDirectEmailTypeId", new object[] {
                 getByDirectEmailTypeIdRequest}, this.getByDirectEmailTypeIdOperationCompleted, userState);
 }
Exemplo n.º 3
0
 /// <remarks/>
 public void getByDirectEmailTypeIdAsync(DirectEmailTypeIDRequest getByDirectEmailTypeIdRequest) {
     this.getByDirectEmailTypeIdAsync(getByDirectEmailTypeIdRequest, null);
 }