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); }
protected void btnSend_Click(object sender, EventArgs e) { model = new EmailProcessViewModel(); model.Sender = comboboxFrom.SelectedItem == null ? string.Empty : comboboxFrom.SelectedItem.Value.ToString(); model.Receipent = comboboxTo.SelectedItem == null ? string.Empty : comboboxTo.SelectedItem.Value.ToString(); model.Title = txtSubject.Text; model.Content = GetText(); model.BookingId = id; model.docType = "Email"; model.Status = statuscontroller.GetStatusDataDocument(value).NewStatus; bookingmodel.Status = model.Status; bookingcontroller.UpdateBookingProcess(bookingmodel); controller.AddMasterData(model); SetModel(); }
public void AddMasterData(EmailProcessViewModel model) { BookingDataRepository.AddMasterData(model); }