コード例 #1
0
ファイル: LoanTaskCommon.cs プロジェクト: PulseCRM/Pulse
        /// <summary>
        /// update stage of point file
        /// neo 2011-01-17
        /// </summary>
        /// <param name="bComplete">true or false</param>
        /// <param name="sCompletedDate">if bComplete=true, sCompletedDate=DateTime.ToString() else string.Empty</param>
        /// <param name="iLoanID"></param>
        /// <param name="iLoginUserID"></param>
        /// <param name="sLoanStage"></param>
        /// <returns>error, if success, error=string.Empty</returns>
        private static string UpdatePointFileStage(bool bComplete, string sCompletedDate, int iLoanID, int iLoginUserID, string sLoanStage, int iLoanStageId)
        {
            string sError = string.Empty;

            try
            {
                ServiceManager sm = new ServiceManager();
                using (LP2ServiceClient service = sm.StartServiceClient())
                {
                    UpdateStageRequest req = new UpdateStageRequest();
                    req.hdr        = new ReqHdr();
                    req.FileId     = iLoanID;
                    req.hdr.UserId = iLoginUserID;
                    StageInfo StageInfo1 = new StageInfo();
                    StageInfo1.StageName   = sLoanStage;
                    StageInfo1.LoanStageId = iLoanStageId;
                    DateTime completionDate = DateTime.MinValue;
                    if (bComplete == true)
                    {
                        DateTime.TryParse(sCompletedDate, out completionDate);
                    }
                    StageInfo1.Completed = completionDate;

                    req.StageList = new StageInfo[1] {
                        StageInfo1
                    };
                    UpdateStageResponse resp = service.UpdateStage(req);
                    bool bIsSuccess          = resp.hdr.Successful;
                    if (bIsSuccess == false)
                    {
                        sError = resp.hdr.StatusInfo;
                    }
                }
            }
            catch (System.ServiceModel.EndpointNotFoundException ee)
            {
                sError = " failed to update stage date in Point, reason: Point Manager is not running.";
            }
            catch (Exception ex)
            {
                sError = " failed to update stage date in Point, reason:" + ex.Message;
            }

            return(sError);
        }