protected bool UploadLoanInfo(int iFileID, bool bCreateFile, int iUserID, out string sError)
    {
        #region API UploadLoanInfo

        sError = string.Empty;

        LPWeb.LP_Service.UpdateLoanInfoResponse response = null;
        try
        {
            ServiceManager sm = new ServiceManager();
            using (LPWeb.LP_Service.LP2ServiceClient client = sm.StartServiceClient())
            {
                #region UpdateLoanInfoRequest

                UpdateLoanInfoRequest req = new UpdateLoanInfoRequest();
                req.hdr = new ReqHdr();
                req.hdr.SecurityToken = "SecurityToken"; //todo:check dummy data
                req.hdr.UserId        = iUserID;
                req.FileId            = iFileID;
                req.CreateFile        = bCreateFile;
                #endregion

                response = client.UpdateLoanInfo(req);
            }
        }
        catch (System.ServiceModel.EndpointNotFoundException)
        {
            sError = "Failed to invoke API UploadLoanInfo: Workflow Manager is not running.";
            return(false);
        }
        catch (Exception ex)
        {
            sError = "Exception happened when invoke API UploadLoanInfo: " + ex.Message;
            return(false);
        }

        if (response.hdr.Successful == false)
        {
            sError = response.hdr.StatusInfo.Replace("\"", "'");
            return(false);
        }

        #endregion

        return(true);
    }
Beispiel #2
0
    protected bool MailChimp_Subscribe(int iContactId, string sLID, out string sError)
    {
        #region API MailChimp_Subscribe

        sError = string.Empty;

        LPWeb.LP_Service.MailChimp_Response response = null;
        try
        {
            ServiceManager sm = new ServiceManager();
            using (LPWeb.LP_Service.LP2ServiceClient client = sm.StartServiceClient())
            {
                int[] ContactIds = new int[1];
                ContactIds.SetValue(iContactId, 0);

                response = client.MailChimp_SubscribeBatch(ContactIds, sLID);
            }
        }
        catch (System.ServiceModel.EndpointNotFoundException)
        {
            sError = "Failed to invoke API MailChimp_SubscribeBatch: Workflow Manager is not running.";
            return(false);
        }
        catch (Exception ex)
        {
            sError = "Exception happened when invoke API MailChimp_SubscribeBatch: " + ex.Message;
            return(false);
        }

        if (response.hdr.Successful == false)
        {
            sError = response.hdr.StatusInfo.Replace("\"", "'");
            return(false);
        }

        #endregion

        return(true);
    }