/// <summary> /// get email type id by email type name /// </summary> /// <param name="workspaceId">workspace id</param> /// <param name="emailTypeName">email type name</param> /// <returns>email type id</returns> public String getDirectEmailTypeId(String workspaceId, String emailTypeName) { if (logger.IsDebugEnabled) { logger.Debug("getEmailTypeId:workspaceId=" + workspaceId + ",emailTypeName=" + emailTypeName); } String result = ""; WorkspaceIDRequest request = new cn.tripolis.dialogue.directEmailType.WorkspaceIDRequest(); try { request.workspaceId = workspaceId; cn.tripolis.dialogue.directEmailType.DirectEmailTypeListResponse response = directEmailTypeService.getByWorkspaceId(request); foreach (DirectEmailType item in response.directEmailTypes) { if (item.name.Equals(emailTypeName, StringComparison.OrdinalIgnoreCase)) { return item.id; } } } catch (System.Web.Services.Protocols.SoapException ex) { if (logger.IsDebugEnabled) { logger.Debug("error happens in get email type id, error is" + result); } throw new Exception(ex.Detail.InnerXml); } return result; }
/// <remarks/> public void getByWorkspaceIdAsync(WorkspaceIDRequest getByWorkspaceIdRequest, object userState) { if ((this.getByWorkspaceIdOperationCompleted == null)) { this.getByWorkspaceIdOperationCompleted = new System.Threading.SendOrPostCallback(this.OngetByWorkspaceIdOperationCompleted); } this.InvokeAsync("getByWorkspaceId", new object[] { getByWorkspaceIdRequest}, this.getByWorkspaceIdOperationCompleted, userState); }
/// <remarks/> public void getByWorkspaceIdAsync(WorkspaceIDRequest getByWorkspaceIdRequest) { this.getByWorkspaceIdAsync(getByWorkspaceIdRequest, null); }