コード例 #1
0
ファイル: EventBookings.cs プロジェクト: software-kd/Staging
 public EventBookings(SuperPNR item, string bookStatus, bool isDeduct)
 {
     try
     {
         HotelServiceController.UpdateEventBooking(item, bookStatus);
     }
     catch (Exception ex)
     {
         InformationCaution.Add(ex.GetBaseException().Message);
     }
 }
コード例 #2
0
ファイル: CallAPI.cs プロジェクト: software-kd/Staging
        public SendPDFRespond SendPDF(SuperPNR item, bool withExceptionMsg = false)
        {
            List <string> logMsg = new List <string>();
            var           _resp  = new SendPDFRespond();

            #region Email PDF Section
            SemaphoreSlim semaphoreSlimInternal = new SemaphoreSlim(1, 1);
            bool          sendStatus            = false;
            try
            {
                //api/internal_func/pdf/send
                semaphoreSlimInternal.Wait();
                var pushObj = new ExpandoObject() as IDictionary <string, Object>;

                pushObj.Add("eid", Alphareds.Module.Cryptography.Cryptography.AES.Encrypt(item.SuperPNRID.ToString()));
                pushObj.Add("privateKey", Helper.GetAppSettingValueEnhanced("InternalAppKey"));

                var resp = GetPOSTRespond <SendPDFRespond, object>("api/internal_func/pdf/send", pushObj);
                resp.Wait();

                if (resp.IsCompleted)
                {
                    semaphoreSlimInternal.Release();
                    sendStatus = resp.Result?.SendStatus ?? false;
                }

                if (resp.Result?.ErrMsg != null)
                {
                    throw new Exception(resp.Result.ErrMsg);
                }

                logMsg.Add($"SuperPNR {item.SuperPNRID} - {item.SuperPNRNo} pdf send status : {sendStatus} ");

                return(resp.Result);
            }
            catch (AggregateException ae)
            {
                logMsg.Add($"SuperPNR {item.SuperPNRID} - {item.SuperPNRNo} pdf send status : {sendStatus} "
                           + (withExceptionMsg ? Environment.NewLine + Environment.NewLine + " with Exception:" + Environment.NewLine
                              + ae.ToString() + Environment.NewLine : null));
            }
            catch (Exception ex)
            {
                logMsg.Add($"SuperPNR {item.SuperPNRID} - {item.SuperPNRNo} pdf send status : {sendStatus} "
                           + (withExceptionMsg ? Environment.NewLine + Environment.NewLine + " with Exception:" + Environment.NewLine
                              + ex.ToString() + Environment.NewLine : null));
            }
            #endregion

            return(default(SendPDFRespond));
        }
コード例 #3
0
ファイル: CallAPI.cs プロジェクト: software-kd/Staging
        public SendPDFRespond SendPDFAfterSuccess(SuperPNR item, bool withExceptionMsg = false)
        {
            List <string> logMsg = new List <string>();
            var           _resp  = new SendPDFRespond();

            #region Email PDF Section
            SemaphoreSlim semaphoreSlimInternal = new SemaphoreSlim(1, 1);
            bool          sendStatus            = false;
            try
            {
                //api/internal_func/pdf/send
                semaphoreSlimInternal.Wait();
                var resp = GetPOSTRespond <SendPDFRespond, int>("api/internal_func/pdf/sendpdf", item.SuperPNRID);
                resp.Wait();

                if (resp.IsCompleted)
                {
                    semaphoreSlimInternal.Release();
                    sendStatus = resp.Result.SendStatus;
                }

                if (resp.Result.ErrMsg != null)
                {
                    throw new Exception(resp.Result.ErrMsg);
                }

                logMsg.Add($"SuperPNR {item.SuperPNRID} - {item.SuperPNRNo} SendPDFAfterSuccess pdf send status : {sendStatus} ");

                return(resp.Result);
            }
            catch (AggregateException ae)
            {
                logMsg.Add($"SuperPNR {item.SuperPNRID} - {item.SuperPNRNo} SendPDFAfterSuccess pdf send status : {sendStatus} "
                           + (withExceptionMsg ? Environment.NewLine + Environment.NewLine + " with Exception:" + Environment.NewLine
                              + ae.ToString() + Environment.NewLine : null));
            }
            catch (Exception ex)
            {
                logMsg.Add($"SuperPNR {item.SuperPNRID} - {item.SuperPNRNo} SendPDFAfterSuccess pdf send status : {sendStatus} "
                           + (withExceptionMsg ? Environment.NewLine + Environment.NewLine + " with Exception:" + Environment.NewLine
                              + ex.ToString() + Environment.NewLine : null));
            }
            #endregion

            return(default(SendPDFRespond));
        }