public APIMasterResponseDetails SendInvitation(UserRequestDetails objUserRequestDetails) { try { objDecisionPointEngine = new DecisionPointEngine(); objAPIMasterResponse = new APIMasterResponse(); objAPIMasterResponse = objDecisionPointEngine.ValidateAPIUser(objUserRequestDetails.ApiUserName, objUserRequestDetails.ApiPassword); if (objAPIMasterResponse.ResultCode != 216 && objAPIMasterResponse.ResultCode != 217) { objAPILogRequest = new APILogRequest() { APIUserName = objUserRequestDetails.ApiUserName, APIPassword = objUserRequestDetails.ApiPassword, RefrenceId = objUserRequestDetails.ReferenceId, RequestData = WebOperationContext.Current.IncomingRequest.UriTemplateMatch.RequestUri.OriginalString, }; objAPIMasterResponse = objDecisionPointEngine.InsertAPILog(objAPILogRequest); if (objAPIMasterResponse.ResultCode != 218) { DSTInviteRequest objDSTInviteRequest = new DSTInviteRequest() { FirstName = objUserRequestDetails.FirstName, LastName = objUserRequestDetails.LastName, EmailId = objUserRequestDetails.EmailId, RoleTypeId = objUserRequestDetails.RoleTypeId, ClientId = objUserRequestDetails.ClientId, SubClientId = objUserRequestDetails.SubClientId, PackageId = objUserRequestDetails.PackageId, ProductId = objUserRequestDetails.ProductId, PaymentTypeId = objUserRequestDetails.PaymentTypeId, ICTypeId = objUserRequestDetails.ICTypeId, BusinessName = objUserRequestDetails.BusinessName, RoleType = objUserRequestDetails.RoleType, }; objAPIMasterResponse = objDecisionPointEngine.SendInvitationByDST(objDSTInviteRequest); } } if (!object.Equals(objAPIMasterResponse, null)) { objAPIMasterResponseDetails = new APIMasterResponseDetails() { ResultId = objAPIMasterResponse.ResultId, ResultCode = objAPIMasterResponse.ResultCode }; } return(objAPIMasterResponseDetails); } catch (Exception ex) { throw ex; } }
public IList <APIMasterResponseDetails> SendBulkInvitation(List <UserRequestDetails> objUserRequestDetails) { try { IList <APIMasterResponseDetails> objresult = new List <APIMasterResponseDetails>(); //apply loop on User collection foreach (var item in objUserRequestDetails) { objAPIMasterResponse = new APIMasterResponse(); objAPIMasterResponseDetails = new APIMasterResponseDetails(); DSTInviteRequest objDSTInviteRequest = new DSTInviteRequest() { FirstName = item.FirstName, LastName = item.LastName, EmailId = item.EmailId, RoleType = item.RoleType, ClientId = item.ClientId, SubClientId = item.SubClientId, PackageId = item.PackageId, ProductId = item.ProductId, PaymentTypeId = item.PaymentTypeId, ICTypeId = item.ICTypeId, BusinessName = item.BusinessName, RoleTypeId = item.RoleTypeId, }; objDecisionPointEngine = new DecisionPointEngine(); //call method for send invitation objAPIMasterResponse = objDecisionPointEngine.SendInvitationByDST(objDSTInviteRequest); if (!object.Equals(objAPIMasterResponse, null)) { objAPIMasterResponseDetails = new APIMasterResponseDetails() { ResultId = objAPIMasterResponse.ResultId, ResultCode = objAPIMasterResponse.ResultCode }; } //added result in result of user collection objresult.Add(objAPIMasterResponseDetails); } return(objresult); } catch (Exception ex) { throw ex; } }