Пример #1
0
        private bool UpdatePointFile(int iFileID, bool CreateFile, ref string err)
        {
            int    oFolderId = LoansManager.CheckProspectFileFolderId(iFileID);
            string oName     = LoansManager.CheckProspectFileName(iFileID);

            ServiceManager         sm       = new ServiceManager();
            UpdateLoanInfoResponse response = null;

            using (LP2ServiceClient service = sm.StartServiceClient())
            {
                #region UpdateLoanInfoRequest

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

                response = service.UpdateLoanInfo(req);
                err      = response.hdr.StatusInfo;
            }
            return(response.hdr.Successful);
        }
Пример #2
0
    private bool UpdateLoanInfo(ref string errMsg)
    {
        UpdateLoanInfoRequest  req  = new UpdateLoanInfoRequest();
        UpdateLoanInfoResponse resp = new UpdateLoanInfoResponse();

        try
        {
            ServiceManager sm = new ServiceManager();
            using (LP2ServiceClient service = sm.StartServiceClient())
            {
                req.FileId = iFileID;
                req.hdr    = new ReqHdr()
                {
                    UserId = loginUser.iUserID
                };
                req.CreateFile = true;

                resp = service.UpdateLoanInfo(req);

                if (resp == null || resp.hdr == null || !resp.hdr.Successful)
                {
                    errMsg = resp.hdr.StatusInfo;
                    return(false);
                }

                //sleep 2s  for wait wcf
                System.Threading.Thread.Sleep(2000);

                return(true);
            }
        }
        catch (System.ServiceModel.EndpointNotFoundException)
        {
            string sExMsg = string.Format("Failed to update Point file. Reason: Point Manager is not running.");
            LPLog.LogMessage(LogType.Logerror, sExMsg);
            errMsg = sExMsg;
            return(false);
        }
        catch (Exception ex)
        {
            string sExMsg = string.Format("error: {0}", ex.Message);
            LPLog.LogMessage(LogType.Logerror, sExMsg);
            errMsg = sExMsg;
            return(false);
        }
    }
    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);
    }