Esempio n. 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);
        }
Esempio n. 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);
        }
    }