public Task <Result> SendVoucher(Booking booking, string email, string languageCode, SlimAgentContext agent)
        {
            return(_documentsService.GenerateVoucher(booking, languageCode)
                   .Bind(async voucher =>
            {
                var voucherData = new VoucherData
                {
                    Accommodation = voucher.Accommodation,
                    AgentName = voucher.AgentName,
                    BookingId = voucher.BookingId,
                    DeadlineDate = DateTimeFormatters.ToDateString(voucher.DeadlineDate),
                    NightCount = voucher.NightCount,
                    ReferenceCode = voucher.ReferenceCode,
                    SupplierReferenceCode = voucher.SupplierReferenceCode,
                    PropertyOwnerConfirmationCode = voucher.PropertyOwnerConfirmationCode,
                    RoomConfirmationCodes = string.Join("; ", voucher.RoomDetails.Select(r => r.SupplierRoomReferenceCode)),
                    RoomDetails = voucher.RoomDetails,
                    CheckInDate = DateTimeFormatters.ToDateString(voucher.CheckInDate),
                    CheckOutDate = DateTimeFormatters.ToDateString(voucher.CheckOutDate),
                    MainPassengerName = voucher.MainPassengerName,
                    BannerUrl = voucher.BannerUrl,
                    LogoUrl = voucher.LogoUrl
                };

                return await _notificationsService.Send(agent: agent,
                                                        messageData: voucherData,
                                                        notificationType: NotificationTypes.BookingVoucher,
                                                        email: email);
            }));
        }
示例#2
0
        public static ApplicationResultModel GetReceiptVList(ReceiptPostModel receiptPostModel)
        {
            var result = VoucherData.GetReceiptVList(receiptPostModel);

            return(new ApplicationResultModel()
            {
                Success = true, Result = result.Result
            });
        }
示例#3
0
        protected override void OnInitialize()
        {
            base.OnLoad();

            if (!this.IsEmptyInstance)
            {
                _entries = new Lazy <FixedList <VoucherEntry> >(() => VoucherData.GetVoucherEntries(this));
            }
            else
            {
                _entries = new Lazy <FixedList <VoucherEntry> >(() => new FixedList <VoucherEntry>());
            }
        }
示例#4
0
        private void SendFiles(DataServiceClient client, bool querySiteIds)
        {
            //******************************************************************
            //  SEND FILES TO THE SERVER
            //******************************************************************
            Trace.WriteLine("TransferringService: ClientDataAccess.SelectFilesForExport");
            int filesCount = (Settings != null && Settings.MaximumFilesForExport > 0) ?
                             Settings.MaximumFilesForExport :
                             Program.MAXIMUM_FILES_FOR_EXPORT;

            List <DbClientFileInfo> files = ClientDataAccess.SelectFilesForExport(filesCount);

            if (files != null && files.Count > 0)
            {
                foreach (var file in files)
                {
                    Stopwatch w = Stopwatch.StartNew();
                    Trace.WriteLine("TransferringService: client.SaveDataXmlText");
                    var voucher = new VoucherData()
                    {
                        CountryID    = file.CountryID,
                        RetailerID   = file.RetailerID,
                        VoucherID    = file.VoucherID,
                        SiteCode     = file.SiteCode,
                        BarCodeImage = file.BarCodeImage,
                        VoucherImage = file.VoucherImage,
                        DateCreated  = DateTime.Now,
                    };

                    client.SaveVoucher(voucher, Auth.ClientID);

                    Trace.WriteLine("TransferringService: ClientDataAccess.SetFileExportedAsync");
                    ClientDataAccess.SetFileExportedAsync(file.SiteCode, null, null);

                    if (querySiteIds)
                    {
                        QuerySiteCodes(client);
                    }

                    Thread.Sleep(0);
                }
            }
            else
            {
                Trace.WriteLine("TransferringService: FILES to Send (OK)");
            }
        }
        public Task <Result> SendVoucher(int bookingId, string email, AgentContext agent, string languageCode)
        {
            return(_bookingDocumentsService.GenerateVoucher(bookingId, agent, languageCode)
                   .Bind(voucher =>
            {
                var voucherData = new VoucherData
                {
                    Accommodation = voucher.Accommodation,
                    AgentName = voucher.AgentName,
                    BookingId = voucher.BookingId,
                    DeadlineDate = DateTimeFormatters.ToDateString(voucher.DeadlineDate),
                    NightCount = voucher.NightCount,
                    ReferenceCode = voucher.ReferenceCode,
                    RoomDetails = voucher.RoomDetails,
                    CheckInDate = DateTimeFormatters.ToDateString(voucher.CheckInDate),
                    CheckOutDate = DateTimeFormatters.ToDateString(voucher.CheckOutDate),
                    MainPassengerName = voucher.MainPassengerName,
                    BannerUrl = voucher.BannerUrl,
                    LogoUrl = voucher.LogoUrl
                };

                return SendEmail(email, _options.VoucherTemplateId, voucherData);
            }));
        }
 public VoucherBusiness(String connString)
 {
     this.voucherData = new VoucherData(connString);
 }//Fin del constructor.
示例#7
0
 static public FixedList <Voucher> GetList(string filter, string sort, int pageSize)
 {
     return(VoucherData.GetVouchers(filter, sort, pageSize));
 }
示例#8
0
 protected override void OnSave()
 {
     VoucherData.WriteVoucher(this);
 }
示例#9
0
 internal void Delete()
 {
     VoucherData.DeleteVoucher(this);
 }