public static void UpdateMasterData(BookingConfirmationViewModel model) { var manager = PlugInManager.GetBookingDataManager(); var bookingconfirmation = manager.GetBookingConfirmation(model.id); bookingconfirmation.Id = model.id; bookingconfirmation.BookingInquiryNummer = model.BookingInquiryNummer; bookingconfirmation.BookingConfirmationNummer = model.BookingConfirmationNummer; bookingconfirmation.BookingProcessId = model.BookingProcessId; bookingconfirmation.docType = model.docType; bookingconfirmation.OfferInfo.Country = model.Country; bookingconfirmation.OfferInfo.PlaceName = model.PlaceName; bookingconfirmation.OfferInfo.SiteName = model.SiteName; bookingconfirmation.OfferInfo.TourOperatorCode = model.TourOperatorCode; bookingconfirmation.OfferInfo.CheckIn = model.CheckIn; bookingconfirmation.OfferInfo.CheckOut = model.CheckOut; bookingconfirmation.TravelApplicant.FirstName = model.FirstName; bookingconfirmation.TravelApplicant.LastName = model.LastName; bookingconfirmation.TravelApplicant.Contry = model.TravelerCountry; bookingconfirmation.TravelApplicant.Adress = model.Address; bookingconfirmation.OfferInfo.OfferName = model.OfferName; bookingconfirmation.TravelApplicant.MobilePhone = model.MobilePhone; bookingconfirmation.TravelApplicant.Phone = model.Phone; bookingconfirmation.TravelApplicant.ZipCode = model.ZipCode; bookingconfirmation.TravelApplicant.Place = model.PlaceName; bookingconfirmation.HtmlDocumentView = model.HtmlDocumentView; manager.UpdateMasterData(bookingconfirmation); }
public static List <ProviderAnnouncementViewModel> GetProviderAnnouncementViewModel() { var model = new List <ProviderAnnouncementViewModel>(); var manager = PlugInManager.GetBookingDataManager(); var provideranouncements = manager.GetProviderAnnouncements(); foreach (var announcement in provideranouncements) { var m = new ProviderAnnouncementViewModel(); m.Id = announcement.Id; m.Adults = announcement.Adults; m.BookingId = announcement.BookingProcessId; m.CheckIn = announcement.CheckIn; m.CheckOut = announcement.CheckOut; m.Country = announcement.Country; m.docType = announcement.docType; m.FirstName = announcement.FirstName; m.LastName = announcement.LastName; m.OfferName = announcement.OfferName; m.PlaceName = announcement.PlaceName; m.SiteName = announcement.SiteName; m.TravelerAdress = announcement.TravelerAdress; m.TravelerCountry = announcement.TravelerCountry; m.TravelerPlace = announcement.TravelerPlace; m.TravelerZipCode = announcement.TravelerZipCode; m.HtmlDocumentView = announcement.HtmlDocumentView; model.Add(m); } return(model); }
public static void AddMasterData(BookingProcessViewModel model, string inquirynumber) { var manager = PlugInManager.GetBookingDataManager(); var bookinginquiry = new BookingInquiry(); bookinginquiry.Id = Guid.NewGuid().ToString(); bookinginquiry.BookingInquiryNummer = inquirynumber; bookinginquiry.BookingProcessId = model.Id; bookinginquiry.OfferInfo.Country = model.Country; bookinginquiry.OfferInfo.PlaceName = model.PlaceName; bookinginquiry.OfferInfo.SiteName = model.SiteName; bookinginquiry.OfferInfo.TourOperatorCode = model.TourOperatorCode; bookinginquiry.OfferInfo.CheckIn = model.CheckIn; bookinginquiry.OfferInfo.CheckOut = model.CheckOut; bookinginquiry.TravelApplicant.FirstName = model.FirstName; bookinginquiry.TravelApplicant.LastName = model.LastName; bookinginquiry.TravelApplicant.Contry = model.TravelerCountry; bookinginquiry.TravelApplicant.Adress = model.Address; bookinginquiry.OfferInfo.OfferName = model.OfferName; bookinginquiry.TravelApplicant.MobilePhone = model.MobilePhone; bookinginquiry.TravelApplicant.Phone = model.Phone; bookinginquiry.TravelApplicant.ZipCode = model.ZipCode; bookinginquiry.TravelApplicant.Place = model.PlaceName; manager.AddMasterData(bookinginquiry); }
public static void UpdateMasterData(ProviderAnnouncementViewModel model) { var manager = PlugInManager.GetBookingDataManager(); var announcement = manager.GetProviderAnnouncement(model.Id); announcement.Id = model.Id; announcement.Adults = model.Adults; announcement.BookingProcessId = model.BookingId; announcement.CheckIn = model.CheckIn; announcement.CheckOut = model.CheckOut; announcement.Country = model.Country; announcement.docType = model.docType; announcement.FirstName = model.FirstName; announcement.LastName = model.LastName; announcement.OfferName = model.LastName; announcement.PlaceName = model.PlaceName; announcement.SiteName = model.SiteName; announcement.TravelerAdress = model.TravelerAdress; announcement.TravelerCountry = model.TravelerCountry; announcement.TravelerPlace = model.TravelerPlace; announcement.TravelerZipCode = model.TravelerZipCode; announcement.HtmlDocumentView = model.HtmlDocumentView; manager.UpdateMasterData(announcement); }
public static List <BookingInquiryViewModel> GetBookingInquiryViewModel() { var model = new List <BookingInquiryViewModel>(); var manager = PlugInManager.GetBookingDataManager(); var bookinginquires = manager.GetBookingInquires(); foreach (var bookinginquiry in bookinginquires) { var m = new BookingInquiryViewModel(); m.id = bookinginquiry.Id; m.BookingProcessId = bookinginquiry.BookingProcessId; m.Country = bookinginquiry.OfferInfo.Country; m.PlaceName = bookinginquiry.OfferInfo.PlaceName; m.SiteName = bookinginquiry.OfferInfo.SiteName; m.TourOperatorCode = bookinginquiry.OfferInfo.TourOperatorCode; m.CheckIn = bookinginquiry.OfferInfo.CheckIn; m.CheckOut = bookinginquiry.OfferInfo.CheckOut; m.FirstName = bookinginquiry.TravelApplicant.FirstName; m.LastName = bookinginquiry.TravelApplicant.LastName; m.TravelerCountry = bookinginquiry.TravelApplicant.Contry; m.Address = bookinginquiry.TravelApplicant.Adress; m.OfferName = bookinginquiry.OfferInfo.OfferName; m.MobilePhone = bookinginquiry.TravelApplicant.MobilePhone; m.Phone = bookinginquiry.TravelApplicant.Phone; m.ZipCode = bookinginquiry.TravelApplicant.ZipCode; m.TravelerPlace = bookinginquiry.TravelApplicant.Place; m.HtmlDocumentView = bookinginquiry.HtmlDocumentView; model.Add(m); } return(model); }
public static CustomerViewModel GetCustomerById(string id) { var manager = PlugInManager.GetBookingDataManager(); var bp = manager.GetBookingProcess(id); int customerNr = bp.TravelApplicantId; string travelemail = bp.TravelApplicant.EMail; var customer = manager.GetCustomerByCustomerNr(customerNr); CustomerViewModel m = new CustomerViewModel(); m.id = customer.id; m.Adress = customer.Adress; m.Country = customer.Contry; m.CustomerNr = customer.CustomerNr; m.EMail = customer.EMail; m.FirstName = customer.FirstName; m.LastName = customer.LastName; m.MobilePhone = customer.MobilePhone; m.Phone = customer.Phone; m.Place = customer.Place; m.Salutation = customer.Salutation; m.ZipCode = customer.ZipCode; m.Notes = customer.Notes; m.Contacts = customer.Contacts; CustomerContact contact = new CustomerContact(); contact.Email = customer.EMail; CustomerContact contactapplicant = new CustomerContact(); contactapplicant.Email = travelemail; List <CustomerContact> contacts = m.Contacts; contacts.Add(contact); contacts.Add(contactapplicant); m.Contacts = contacts; int counter = 0; foreach (var item in m.Notes) { item.Id = (++counter).ToString(); } counter = 0; foreach (var item in m.Contacts) { item.Id = (++counter).ToString(); } return(m); }
public static CoreViewModel GetProviderById(string id) { List <ProviderContact> list = new List <ProviderContact>(); var manager = PlugInManager.GetBookingDataManager(); var bp = manager.GetBookingProcess(id); int providerid = bp.AccProvider; var provider = manager.GetProviderForProviderId(providerid); CoreViewModel m = new CoreViewModel(); m.Id = provider.Id; m.Address = provider.Address; m.Country = provider.Country; m.Bank = provider.Bank; m.City = provider.City; m.Contacts = provider.Contacts; m.IBAN = provider.IBAN; m.Name = provider.Name; m.PersonalIdentificationNumber = provider.PersonalIdentificationNumber; m.Notes = provider.Notes; m.ProviderId = provider.ProviderId; m.Title = provider.Title; m.BookingEmail = provider.BookingEmail; m.Cancellations = provider.Cancellations; list = m.Contacts; ProviderContact contact = new ProviderContact(); contact.Email = provider.BookingEmail; list.Add(contact); m.Contacts = list; int counter = 0; foreach (var item in m.Contacts) { item.Id = (++counter).ToString(); } counter = 0; foreach (var item in m.Notes) { item.Id = (++counter).ToString(); } foreach (var item in m.Cancellations) { item.Id = (++counter).ToString(); } return(m); }
public static void AddMasterData(ProviderConfirmationViewModel model) { var manager = PlugInManager.GetBookingDataManager(); var providerconfirmation = new ProviderConfirmation(); providerconfirmation.Id = Guid.NewGuid().ToString(); providerconfirmation.BookingProcessId = model.BookingId; providerconfirmation.docType = model.docType; providerconfirmation.CreateDate = model.CreateDate; providerconfirmation.Title = model.Title; providerconfirmation.Content = model.Content; manager.AddMasterData(providerconfirmation); }
public static void UpdateMasterData(ProviderConfirmationViewModel model) { var manager = PlugInManager.GetBookingDataManager(); var providerconfirmation = manager.GetProviderConfirmation(model.Id); providerconfirmation.Id = model.Id; providerconfirmation.BookingProcessId = model.BookingId; providerconfirmation.docType = model.docType; providerconfirmation.CreateDate = model.CreateDate; providerconfirmation.Title = model.Title; providerconfirmation.Content = model.Content; manager.UpdateMasterData(providerconfirmation); }
public static void UpdateMasterData(TemplateViewModel model) { var manager = PlugInManager.GetBookingDataManager(); var template = new Template(); template.Id = model.Id; template.Name = model.Name; template.StatusId = model.StatusId; template.Text = model.Text; template.Title = model.Title; manager.UpdateMasterData(template); }
protected void btnAdd_Click(object sender, EventArgs e) { var manager = PlugInManager.GetBookingDataManager(); var bookingprocess = new BookingProcess(); bookingprocess.Id = Guid.NewGuid().ToString(); bookingprocess.Status = DocumentProcessStatus.Close; bookingprocess.OfferInfo.Country = txtCountry.Text; bookingprocess.OfferInfo.PlaceName = txtPlace.Text; bookingprocess.OfferInfo.SiteCode = comboboxSite.SelectedItem != null?comboboxSite.SelectedItem.Text:""; string sitecode = bookingprocess.OfferInfo.SiteCode; string sitename = controller.GetSiteName(sitecode); bookingprocess.OfferInfo.SiteName = sitename; bookingprocess.OfferInfo.UnitCode = comboboxUnit.SelectedItem != null ? comboboxUnit.SelectedItem.Text : ""; bookingprocess.OfferInfo.OfferCode = comboboxOffer.SelectedItem != null ? comboboxOffer.SelectedItem.Text : ""; string offercode = bookingprocess.OfferInfo.OfferCode; string offername = controller.GetOfferName(offercode); bookingprocess.OfferInfo.OfferName = offername; bookingprocess.OfferInfo.TourOperatorCode = txtTourOperator.Text.Trim(); bookingprocess.OfferInfo.CheckIn = ASPxDateEditCheckIn.Date; bookingprocess.OfferInfo.CheckOut = ASPxDateEditCheckOut.Date; bookingprocess.OfferInfo.Adults = int.Parse(txtAdults.Text.Trim()); bookingprocess.OfferInfo.Children = int.Parse(txtChildren.Text.Trim()); bookingprocess.TravelApplicant.FirstName = customer.FirstName; bookingprocess.TravelApplicant.LastName = customer.LastName; bookingprocess.TravelApplicant.Contry = customer.Country; bookingprocess.TravelApplicant.Adress = customer.Adress; bookingprocess.TravelApplicantId = customer.CustomerNr; bookingprocess.SellingPartner = int.Parse(txtPartnerId.Text.Trim()); bookingprocess.Season = txtSeason.Text; bookingprocess.TravelApplicant.MobilePhone = customer.MobilePhone; bookingprocess.TravelApplicant.Phone = customer.Phone; bookingprocess.TravelApplicant.ZipCode = customer.ZipCode; bookingprocess.TravelApplicant.Place = customer.Place; bookingprocess.TravelApplicant.Salutation = customer.Salutation; bookingprocess.TravelApplicant.EMail = customer.EMail; List <TravelApplicantPayment> payments = bookingprocess.Payments; TravelApplicantPayment applicantPayment = new TravelApplicantPayment(); applicantPayment.Date = ASPxDateEditPayment.Date; applicantPayment.Value = Decimal.Parse(txtPaymetnValue.Text.Trim()); payments.Add(applicantPayment); bookingprocess.Payments = payments; bookingprocess.BookingNumber = txtBookingNumber.Text; manager.AddMasterData(bookingprocess); }
public static void AddMasterData(TemplateViewModel model) { var template = new Template(); var manager = PlugInManager.GetBookingDataManager(); template.Id = Guid.NewGuid().ToString(); template.Name = model.Name; template.StatusId = model.StatusId; template.Text = model.Text; template.Title = model.Title; manager.AddMasterData(template); }
//Dohvati sve providere iz baze i mapiraj u view objekte i vrati listu public static List <CoreViewModel> GetProviderViewModel() { var model = new List <CoreViewModel>(); var manager = PlugInManager.GetBookingDataManager(); var providers = manager.GetProviders(); foreach (var provider in providers) { var m = new CoreViewModel(); m.Id = provider.Id; m.Address = provider.Address; m.Country = provider.Country; m.Bank = provider.Bank; m.City = provider.City; m.Contacts = provider.Contacts; m.IBAN = provider.IBAN; m.Name = provider.Name; m.PersonalIdentificationNumber = provider.PersonalIdentificationNumber; m.Notes = provider.Notes; m.ProviderId = provider.ProviderId; m.Title = provider.Title; m.BookingEmail = provider.BookingEmail; m.Cancellations = provider.Cancellations; int counter = 0; foreach (var item in m.Contacts) { item.Id = (++counter).ToString(); } counter = 0; foreach (var item in m.Notes) { item.Id = (++counter).ToString(); } foreach (var item in m.Cancellations) { item.Id = (++counter).ToString(); } model.Add(m); } return(model); }
//Dohvati sve booking procese iz baze i mapiraj u view objekte i vrati listu public static List <BookingProcessViewModel> GetBookingProcessViewModel() { var model = new List <BookingProcessViewModel>(); var manager = PlugInManager.GetBookingDataManager(); int i = 0; var bookingprocesses = manager.GetBookingProcesses(); int c = bookingprocesses.Count; foreach (var bookingprocess in bookingprocesses) { var m = new BookingProcessViewModel(); m.Id = bookingprocess.Id; m.Status = bookingprocess.Status; m.Country = bookingprocess.OfferInfo.Country; m.PlaceName = bookingprocess.OfferInfo.PlaceName; m.SiteName = bookingprocess.OfferInfo.SiteName; m.TourOperatorCode = bookingprocess.OfferInfo.TourOperatorCode; m.CheckIn = bookingprocess.OfferInfo.CheckIn; m.CheckOut = bookingprocess.OfferInfo.CheckOut; m.FirstName = bookingprocess.TravelApplicant.FirstName; m.LastName = bookingprocess.TravelApplicant.LastName; m.TravelerCountry = bookingprocess.TravelApplicant.Contry; m.Address = bookingprocess.TravelApplicant.Adress; m.BookingProcessItemList = bookingprocess.BookingProcessItemList; m.TravelApplicantId = bookingprocess.TravelApplicantId; m.PartnerId = bookingprocess.SellingPartner; m.ProviderId = bookingprocess.AccProvider; m.Season = bookingprocess.Season; m.OfferName = bookingprocess.OfferInfo.OfferName; m.MobilePhone = bookingprocess.TravelApplicant.MobilePhone; m.Phone = bookingprocess.TravelApplicant.Phone; m.ZipCode = bookingprocess.TravelApplicant.ZipCode; m.TravelerPlace = bookingprocess.TravelApplicant.Place; m.Days = bookingprocess.OfferInfo.Days; m.PaymentsForProvider = bookingprocess.PaymentsForProvider; m.Payments = bookingprocess.Payments; m.BookingNumber = bookingprocess.BookingNumber; m.TravelApplicantId = bookingprocess.TravelApplicantId; model.Add(m); } return(model); }
// Mapiraj view objekt ,a to je CoreViewModel koji služi za prezentaciju Providera i B2BCustomera u B2BCustomer objekt te napravi update objekta u bazi public static void UpdateMasterDataB2BCustomer(CoreViewModel model) { var manager = PlugInManager.GetBookingDataManager(); var b2bcustomer = new B2BCustomer(); b2bcustomer.Id = model.Id; b2bcustomer.Address = model.Address; b2bcustomer.Country = model.Country; b2bcustomer.Bank = model.Bank; b2bcustomer.City = model.City; b2bcustomer.Contacts = model.Contacts; b2bcustomer.IBAN = model.IBAN; b2bcustomer.Name = model.Name; b2bcustomer.PersonalIdentificationNumber = model.PersonalIdentificationNumber; b2bcustomer.Notes = model.Notes; b2bcustomer.PartnerId = model.ProviderId; manager.UpdateMasterData(b2bcustomer); }
//Dohvati sve customere iz baze i mapiraj u view objekte i vrati listu public static List <CustomerViewModel> GetCustomerViewModel() { var model = new List <CustomerViewModel>(); var manager = PlugInManager.GetBookingDataManager(); var customers = manager.GetCustomers(); foreach (var customer in customers) { var m = new CustomerViewModel(); m.id = customer.id; m.Adress = customer.Adress; m.Country = customer.Contry; m.CustomerNr = customer.CustomerNr; m.EMail = customer.EMail; m.FirstName = customer.FirstName; m.LastName = customer.LastName; m.MobilePhone = customer.MobilePhone; m.Phone = customer.Phone; m.Place = customer.Place; m.Salutation = customer.Salutation; m.ZipCode = customer.ZipCode; m.Notes = customer.Notes; m.Contacts = customer.Contacts; int counter = 0; foreach (var item in m.Notes) { item.Id = (++counter).ToString(); } counter = 0; foreach (var item in m.Contacts) { item.Id = (++counter).ToString(); } model.Add(m); } return(model); }
public static List <TemplateViewModel> GetTemplateViewModel() { var model = new List <TemplateViewModel>(); var manager = PlugInManager.GetBookingDataManager(); var templates = manager.GetTemplates(); foreach (var template in templates) { var m = new TemplateViewModel(); m.Id = template.Id; m.Name = template.Name; m.StatusId = template.StatusId; m.Title = template.Title; m.Text = template.Text; model.Add(m); } return(model); }
// Mapiraj view objekt ,a to je CoreViewModel koji služi za prezentaciju Providera i B2BCustomera u Provider objekt te ga pohrani u bazu public static void AddMasterData(CoreViewModel model) { var manager = PlugInManager.GetBookingDataManager(); var provider = new Provider(); provider.Id = Guid.NewGuid().ToString(); provider.Address = model.Address; provider.Country = model.Country; provider.Bank = model.Bank; provider.City = model.City; provider.Contacts = model.Contacts; provider.IBAN = model.IBAN; provider.Name = model.Name; provider.PersonalIdentificationNumber = model.PersonalIdentificationNumber; provider.Notes = model.Notes; provider.ProviderId = model.ProviderId; provider.Title = model.Title; provider.BookingEmail = model.BookingEmail; provider.Cancellations = model.Cancellations; manager.AddMasterData(provider); }
public static List <ProviderConfirmationViewModel> GetProviderConfirmationViewModel() { var model = new List <ProviderConfirmationViewModel>(); var manager = PlugInManager.GetBookingDataManager(); var providerconfirmations = manager.GetProviderConfirmations(); foreach (var confirmation in providerconfirmations) { var m = new ProviderConfirmationViewModel(); m.Id = confirmation.Id; m.BookingId = confirmation.BookingProcessId; m.docType = confirmation.docType; m.CreateDate = confirmation.CreateDate; m.Title = confirmation.Title; m.Content = confirmation.Content; model.Add(m); } return(model); }
//Mapiraj view objekt u Customer objekt ,te ga pohrani u bazu public static void AddMasterData(CustomerViewModel model) { var customer = new Customer(); var manager = PlugInManager.GetBookingDataManager(); customer.id = Guid.NewGuid().ToString(); customer.Adress = model.Adress; customer.Contry = model.Country; customer.CustomerNr = model.CustomerNr; customer.EMail = model.EMail; customer.FirstName = model.FirstName; customer.LastName = model.LastName; customer.MobilePhone = model.MobilePhone; customer.Phone = model.Phone; customer.Place = model.Place; customer.Salutation = model.Salutation; customer.ZipCode = model.ZipCode; customer.Notes = model.Notes; customer.Contacts = model.Contacts; manager.AddMasterData(customer); }
//Dohvati sve b2bcustomere iz baze i mapiraj u view objekte i vrati listu public static List <CoreViewModel> GetB2BCustomerViewModel() { var model = new List <CoreViewModel>(); var manager = PlugInManager.GetBookingDataManager(); var b2bcustomers = manager.GetB2BCustomers(); foreach (var b2bcustomer in b2bcustomers) { var m = new CoreViewModel(); m.Id = b2bcustomer.Id; m.Address = b2bcustomer.Address; m.Country = b2bcustomer.Country; m.Bank = b2bcustomer.Bank; m.City = b2bcustomer.City; m.Contacts = b2bcustomer.Contacts; m.IBAN = b2bcustomer.IBAN; m.Name = b2bcustomer.Name; m.PersonalIdentificationNumber = b2bcustomer.PersonalIdentificationNumber; m.Notes = b2bcustomer.Notes; m.ProviderId = b2bcustomer.PartnerId; int counter = 0; foreach (var item in m.Contacts) { item.Id = (++counter).ToString(); } counter = 0; foreach (var item in m.Notes) { item.Id = (++counter).ToString(); } model.Add(m); } return(model); }
public static void DeleteMasterData(TemplateViewModel model) { var manager = PlugInManager.GetBookingDataManager(); manager.DeleteTemplate(model.Id); }
// Obriši Provider iz baze public static void DeleteProvider(string id) { var manager = PlugInManager.GetBookingDataManager(); manager.DeleteProvider(id); }
// Obriši B2BCustomer iz baze public static void DeleteMasterDataB2BCustomer(string id) { var manager = PlugInManager.GetBookingDataManager(); manager.DeleteB2BCustomer(id); }