Example #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;
                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;
        }
Example #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);
 }
Example #3
0
 /// <remarks/>
 public void getByDirectEmailTypeIdAsync(DirectEmailTypeIDRequest getByDirectEmailTypeIdRequest) {
     this.getByDirectEmailTypeIdAsync(getByDirectEmailTypeIdRequest, null);
 }