Example #1
0
        private void AddBookingInquiry(string bookingProcessId, BookingProcessItem bpi, QTouristik.Interface.Booking.BookingInquiry bi)
        {
            QTouristik.Interface.BackOffice.Booking.BookingInquiry newBi = new BookingInquiry();
            var bdm = new QTouristik.PlugIn.BackOffice.Booking.BookingDataManager();

            newBi.BookingInquiryNummer = Guid.NewGuid().ToString();
            newBi.BookingProcessId     = bookingProcessId;
            newBi.id                     = Guid.NewGuid().ToString();
            bpi.DocumentId               = newBi.BookingInquiryNummer;
            newBi.BookingInquiryNummer   = bi.InquiryCode;
            newBi.OfferInfo.SiteCode     = bi.BookingData.SiteCode;
            newBi.OfferInfo.UnitCode     = bi.BookingData.UnitCode;
            newBi.OfferInfo.PlaceName    = bi.BookingData.PlaceName;
            newBi.OfferInfo.Adults       = bi.BookingData.Adults;
            newBi.OfferInfo.CheckIn      = bi.BookingData.CheckIn;
            newBi.OfferInfo.CheckOut     = bi.BookingData.CheckOut;
            newBi.OfferInfo.Children     = bi.BookingData.Children;
            newBi.OfferInfo.Country      = bi.BookingData.Country;
            newBi.OfferInfo.OfferCode    = bi.BookingData.OfferCode;
            newBi.OfferInfo.OfferName    = bi.BookingData.OfferName;
            newBi.OfferInfo.SiteName     = bi.BookingData.SiteName;
            newBi.OfferInfo.TourOperator = bi.BookingData.TourOperator;
            newBi.OfferInfo.YoungAdults  = bi.BookingData.YoungAdults;

            bdm.AddMasterData(newBi);
        }
Example #2
0
        public void AddMasterData(BookingProcessItem document)
        {
            if (String.IsNullOrEmpty(document.DocumentId))
            {
                document.DocumentId = Guid.NewGuid().ToString();
            }

            collectionBookingProcessItem.InsertOne(document);
        }
Example #3
0
        private void SetModel()
        {
            EmailProcessViewModel   emailmodel   = controller.GetEmailProcessViewModelByBookingIdLast(id);
            BookingProcessViewModel bookingmodel = new BookingProcessViewModel();
            ApplicationKeyViewModel keymodel     = keycontroller.GetApplicationKeyByName("BookingNumber");
            int number = keymodel.Value;
            int n      = int.Parse(parameter);

            bookingmodel = bookingcontroller.GetBookingProcess(id);
            var status = bookingmodel.Status;
            BookingProcessItem item = new BookingProcessItem();

            if (status == DocumentProcessStatus.WaitingProviderConfirmation && n == 1)
            {
                var annoucement = announcementcontroller.GetProviderAnnouncementByBookingId(id);
                item.DocumentId        = annoucement.Id;
                item.DocumentNr        = "Id" + number.ToString();
                item.CreateDate        = DateTime.Now;
                item.LastChange        = DateTime.Now;
                item.Author            = "Ivan Budisa";
                item.DocumentTitel     = "Provider announcement" + annoucement.SiteName;
                item.DocumentStatus    = DocumentStatus.Active;
                item.BookingProcessTyp = BookingProcessItemTyp.ProviderAnnouncement;
            }
            else if (status == DocumentProcessStatus.CustomerConfirmationSent)
            {
                var bookingconfirmation = confirmationcontroller.GetBookingConfirmationByBookingId(id);
                item.DocumentId        = bookingconfirmation.id;
                item.DocumentNr        = bookingconfirmation.BookingConfirmationNummer;
                item.CreateDate        = DateTime.Now;
                item.LastChange        = DateTime.Now;
                item.Author            = "Ivan Budisa";
                item.DocumentTitel     = "Booking Confirmation" + bookingconfirmation.SiteName;
                item.DocumentStatus    = DocumentStatus.Active;
                item.BookingProcessTyp = BookingProcessItemTyp.BookingConfirmation;
            }
            else
            {
                item.DocumentId     = emailmodel.Id;
                item.DocumentNr     = new Random().Next(1000, 2000).ToString();
                item.CreateDate     = DateTime.Now;
                item.LastChange     = DateTime.Now;
                item.Author         = "Ivan Budisa";
                item.DocumentTitel  = emailmodel.Title;
                item.DocumentStatus = DocumentStatus.Active;
                //item.BookingProcessTyp = BookingProcessItemTyp.BookingConfirmation;
            }

            bookingmodel.BookingProcessItemList.Add(item);
            bookingcontroller.UpdateBookingProcess(bookingmodel);
        }
Example #4
0
        private void AddBookingProcess(CustomerBookingProcessInfo cbpi, QTouristik.Interface.Booking.BookingInquiry bi, int travelApplicantId)
        {
            var            bdm = new QTouristik.PlugIn.BackOffice.Booking.BookingDataManager();
            BookingProcess bp  = new BookingProcess();

            bp.Id                     = Guid.NewGuid().ToString();
            bp.Status                 = DocumentProcessStatus.New;
            bp.OfferInfo.SiteCode     = bi.BookingData.SiteCode;
            bp.OfferInfo.UnitCode     = bi.BookingData.UnitCode;
            bp.OfferInfo.PlaceName    = bi.BookingData.PlaceName;
            bp.OfferInfo.Adults       = bi.BookingData.Adults;
            bp.OfferInfo.CheckIn      = bi.BookingData.CheckIn;
            bp.OfferInfo.CheckOut     = bi.BookingData.CheckOut;
            bp.OfferInfo.Children     = bi.BookingData.Children;
            bp.OfferInfo.Country      = bi.BookingData.Country;
            bp.OfferInfo.OfferCode    = bi.BookingData.OfferCode;
            bp.OfferInfo.OfferName    = bi.BookingData.OfferName;
            bp.OfferInfo.SiteName     = bi.BookingData.SiteName;
            bp.OfferInfo.TourOperator = bi.BookingData.TourOperator;
            bp.OfferInfo.YoungAdults  = bi.BookingData.YoungAdults;
            bp.PartnerId              = 0;

            bp.TravelApplicant.Salutation = bi.BookingData.TravelApplicant.Salutation;
            bp.TravelApplicant.FirstName  = bi.BookingData.TravelApplicant.FirstName;
            bp.TravelApplicant.LastName   = bi.BookingData.TravelApplicant.LastName;
            bp.TravelApplicant.Place      = bi.BookingData.TravelApplicant.Place;
            bp.TravelApplicant.Adress     = bi.BookingData.TravelApplicant.Adress;
            bp.TravelApplicant.ZipCode    = bi.BookingData.TravelApplicant.ZipCode;
            bp.TravelApplicant.Contry     = bi.BookingData.TravelApplicant.Contry;
            bp.ProviderId        = GetProviderId(bp.OfferInfo);
            bp.TravelApplicantId = travelApplicantId;
            bp.Season            = bi.BookingData.CheckIn.Year.ToString();

            BookingProcessItem bpi = new BookingProcessItem();

            bpi.BookingProcessTyp = BookingProcessItemTyp.BookingInquiry;
            bpi.Author            = "Igor Cuic";
            bpi.DocumentNr        = bi.InquiryCode;
            bpi.CreateDate        = DateTime.Now;
            bpi.LastChange        = DateTime.Now;
            bpi.DocumentStatus    = DocumentStatus.Active;
            bpi.DocumentTitel     = "Anmeldebestätigung " + bi.InquiryCode;
            AddBookingInquiry(bp.Id, bpi, bi);
            bp.BookingProcessItemList.Add(bpi);
            bdm.AddMasterData(bp);
        }
Example #5
0
        private void SetModel(TextInfoViewModel model)
        {
            BookingProcessViewModel bookingmodel = new BookingProcessViewModel();

            bookingmodel = bookingcontroller.GetBookingProcess(id);
            BookingProcessItem item = new BookingProcessItem();

            item.DocumentId = model.Id;
            item.CreateDate = model.Date;
            Random r = new Random();

            item.DocumentNr        = r.Next(10000).ToString();
            item.Author            = "Ivan Budisa";
            item.BookingProcessTyp = BookingProcessItemTyp.BookingConfirmation;
            item.LastChange        = DateTime.Now;
            item.DocumentTitel     = model.Title;
            item.DocumentStatus    = DocumentStatus.Active;
            bookingmodel.BookingProcessItemList.Add(item);
            bookingcontroller.UpdateBookingProcess(bookingmodel);
        }
Example #6
0
        private static BookingProcess CreateBookingProcess(SyncBookingInquiry inquiry, Customer customer)
        {
            BookingProcess booking = new BookingProcess();

            booking.Id = inquiry.id;


            booking.OfferInfo.Adults   = inquiry.BookingData.Adults;
            booking.OfferInfo.Children = inquiry.BookingData.Children;
            booking.OfferInfo.CheckIn  = inquiry.BookingData.CheckIn;
            DateTime date = inquiry.BookingData.CheckIn;

            booking.OfferInfo.CheckOut         = inquiry.BookingData.CheckOut;
            booking.OfferInfo.OfferCode        = inquiry.BookingData.OfferCode;
            booking.OfferInfo.SiteCode         = inquiry.BookingData.SiteCode;
            booking.OfferInfo.TourOperatorCode = inquiry.TourOperatorCode;



            booking.TravelApplicant.Adress      = inquiry.BookingData.TravelApplicant.Adress;
            booking.TravelApplicant.Contry      = inquiry.BookingData.TravelApplicant.Contry;
            booking.TravelApplicant.EMail       = inquiry.BookingData.TravelApplicant.EMail;
            booking.TravelApplicant.FirstName   = inquiry.BookingData.TravelApplicant.FirstName;
            booking.TravelApplicant.LastName    = inquiry.BookingData.TravelApplicant.LastName;
            booking.TravelApplicant.MobilePhone = inquiry.BookingData.TravelApplicant.MobilePhone;
            booking.TravelApplicant.Phone       = inquiry.BookingData.TravelApplicant.Phone;
            booking.TravelApplicant.Place       = inquiry.BookingData.TravelApplicant.Place;
            booking.TravelApplicant.Salutation  = inquiry.BookingData.TravelApplicant.Salutation;
            booking.TravelApplicant.ZipCode     = inquiry.BookingData.TravelApplicant.ZipCode;



            List <TravelApplicantPayment> lis = new List <TravelApplicantPayment>();
            TravelApplicantPayment        p1  = new TravelApplicantPayment();

            p1.Date  = inquiry.BookingData.CheckIn;
            p1.Value = inquiry.BookingData.PriceValueByArrival;
            TravelApplicantPayment p2 = new TravelApplicantPayment();

            p2.Date  = inquiry.BookingData.CheckOut;
            p2.Value = inquiry.BookingData.PriceValueByBooking;
            lis.Add(p1);
            lis.Add(p2);
            //booking.Payments = lis;
            booking.Season            = date.Year.ToString();
            booking.Status            = DocumentProcessStatus.New;
            booking.TravelApplicantId = customer.CustomerNr;
            CreateBookingInquiry(inquiry);
            string             bookinginquirynumber = inquiry.BookingInquiryNummer;
            BookingInquiry     inquiryq             = manager.GetBookingInquiryByNumber(bookinginquirynumber);
            BookingProcessItem item = new BookingProcessItem();

            item.DocumentId        = inquiryq.Id;
            item.DocumentNr        = inquiryq.BookingInquiryNummer;
            item.DocumentStatus    = DocumentStatus.Active;
            item.DocumentTitel     = "AB" + "-" + inquiryq.BookingInquiryNummer;
            item.CreateDate        = DateTime.Now;
            item.BookingProcessTyp = BookingProcessItemTyp.BookingInquiry;
            item.Author            = "Igor Cuic";

            List <BookingProcessItem> bookinglist = new List <BookingProcessItem>();

            bookinglist.Add(item);

            booking.BookingProcessItemList = bookinglist;

            return(booking);
        }
Example #7
0
 public void UpdateMasterData(BookingProcessItem document)
 {
     throw new NotImplementedException();
 }
Example #8
0
        private static void CreateBookingItems(BookingProcess bookingProcess, DateTime?bookingdate)
        {
            List <BookingProcessItem> list    = new List <BookingProcessItem>();
            BookingInquiry            inquiry = new BookingInquiry();

            inquiry.BookingProcessId = bookingProcess.Id;
            inquiry.CreateDate       = bookingdate != null ? (DateTime)bookingdate : DateTime.Now;
            inquiry.DocumentId       = bookingProcess.BookingNumber;
            inquiry.docType          = "BookingInquiry";
            manager.AddMasterData(inquiry);

            var bin = manager.GetBookingInquiryByBookingId(bookingProcess.Id);


            var bookinginquiry = new BookingProcessItem();

            bookinginquiry.BookingProcessTyp = BookingProcessItemTyp.BookingInquiry;
            bookinginquiry.CreateDate        = bookingdate != null ? (DateTime)bookingdate : DateTime.Now;
            bookinginquiry.DocumentId        = bin.Id;
            bookinginquiry.LastChange        = DateTime.Now;
            bookinginquiry.DocumentNr        = bookingProcess.BookingNumber;
            bookinginquiry.DocumentTitel     = "Sync";
            bookinginquiry.DocumentStatus    = DocumentStatus.Active;

            ProviderAnnouncement pan = new ProviderAnnouncement();

            pan.BookingProcessId = bookingProcess.Id;
            pan.CreateDate       = bookingdate != null ? (DateTime)bookingdate : DateTime.Now;
            pan.DocumentId       = bookingProcess.BookingNumber;
            pan.docType          = "ProviderAnnouncement";
            manager.AddMasterData(pan);

            var p = manager.GetProviderAnnouncementByBookingId(bookingProcess.Id);

            var providerannouncement = new BookingProcessItem();

            providerannouncement.BookingProcessTyp = BookingProcessItemTyp.ProviderAnnouncement;
            providerannouncement.CreateDate        = bookingdate != null ? (DateTime)bookingdate : DateTime.Now;
            providerannouncement.DocumentId        = p.Id;
            providerannouncement.LastChange        = DateTime.Now;
            providerannouncement.DocumentNr        = bookingProcess.BookingNumber;
            providerannouncement.DocumentTitel     = "Sync";
            providerannouncement.DocumentStatus    = DocumentStatus.Active;

            ProviderConfirmation providerconfirmation = new ProviderConfirmation();

            providerconfirmation.BookingProcessId = bookingProcess.Id;
            providerconfirmation.CreateDate       = bookingdate != null ? ((DateTime)bookingdate).AddDays(1) : DateTime.Now;
            providerconfirmation.DocumentId       = bookingProcess.BookingNumber;
            providerconfirmation.docType          = "ProviderConfirmation";
            manager.AddMasterData(providerconfirmation);

            var pconfirmation = manager.GetProviderConfirmationByBookingId(bookingProcess.Id);
            var pconf         = new BookingProcessItem();

            pconf.BookingProcessTyp = BookingProcessItemTyp.ProviderConfirmation;
            pconf.CreateDate        = bookingdate != null ? ((DateTime)bookingdate).AddDays(1) : DateTime.Now;
            pconf.DocumentId        = pconfirmation.Id;
            pconf.LastChange        = DateTime.Now;
            pconf.DocumentNr        = bookingProcess.BookingNumber;
            pconf.DocumentTitel     = "Sync";
            pconf.DocumentStatus    = DocumentStatus.Active;


            BookingConfirmation bookingConfirmation = new BookingConfirmation();

            bookingConfirmation.BookingProcessId = bookingProcess.Id;
            bookingConfirmation.CreateDate       = bookingdate != null ? ((DateTime)bookingdate).AddDays(1) : DateTime.Now;

            bookingConfirmation.DocumentId = bookingProcess.BookingNumber;
            bookingConfirmation.docType    = "BookingConfirmation";
            manager.AddMasterData(bookingConfirmation);

            var bconfirmation = manager.GetBookingConfirmationByBookingId(bookingProcess.Id);

            var bconf = new BookingProcessItem();

            bconf.BookingProcessTyp = BookingProcessItemTyp.BookingConfirmation;
            bconf.CreateDate        = bookingdate != null ? ((DateTime)bookingdate).AddDays(1) : DateTime.Now;
            bconf.DocumentId        = bconfirmation.Id;
            bconf.LastChange        = DateTime.Now;
            bconf.DocumentNr        = bookingProcess.BookingNumber;
            bconf.DocumentTitel     = "Sync";
            bconf.DocumentStatus    = DocumentStatus.Active;

            CustomerVoucher customerVoucher = new CustomerVoucher();

            customerVoucher.BookingProcessId = bookingProcess.Id;
            customerVoucher.CreateDate       = bookingProcess.OfferInfo.CheckIn.AddDays(-20);
            customerVoucher.DocumentId       = bookingProcess.BookingNumber;
            customerVoucher.docType          = "CustomerVoucher";
            manager.AddMasterData(customerVoucher);

            var cvoucher = manager.GetCustomerVoucherByBookingId(bookingProcess.Id);

            var cvouchera = new BookingProcessItem();

            cvouchera.BookingProcessTyp = BookingProcessItemTyp.CustomerVoucher;
            cvouchera.CreateDate        = bookingProcess.OfferInfo.CheckIn.AddDays(-20);
            cvouchera.DocumentId        = cvoucher.Id;
            cvouchera.LastChange        = DateTime.Now;
            cvouchera.DocumentNr        = bookingProcess.BookingNumber;
            cvouchera.DocumentTitel     = "Sync";
            cvouchera.DocumentStatus    = DocumentStatus.Active;


            BookingInvoice bookingInvoice = new BookingInvoice();

            bookingInvoice.BookingProcessId = bookingProcess.Id;
            bookingInvoice.CreateDate       = bookingProcess.OfferInfo.CheckIn.AddDays(-20);
            bookingInvoice.DocumentId       = bookingProcess.BookingNumber;
            bookingInvoice.docType          = "BookingInvoice";
            manager.AddMasterData(bookingInvoice);

            var bookinvoice = manager.GetBookingInvoiceByBookingId(bookingProcess.Id);
            var binvoice    = new BookingProcessItem();

            binvoice.BookingProcessTyp = BookingProcessItemTyp.BookingInvoice;
            binvoice.CreateDate        = bookingProcess.OfferInfo.CheckIn.AddDays(-20);
            binvoice.DocumentId        = bookinvoice.Id;
            binvoice.LastChange        = DateTime.Now;
            binvoice.DocumentNr        = bookingProcess.BookingNumber;
            binvoice.DocumentTitel     = "Sync";
            binvoice.DocumentStatus    = DocumentStatus.Active;

            list.AddRange(new BookingProcessItem[] { bookinginquiry, providerannouncement, pconf, bconf, cvouchera, binvoice });

            bookingProcess.BookingProcessItemList = list;
        }