public void StopClient(IBooking client) { Console.WriteLine(" Stopping Client..."); ((System.ServiceModel.Channels.IChannel)client).Close(); _fac.Close(); Console.WriteLine("[DONE]"); }
private void LoadData(string bookingid) { booking = facade.GetBooking(bookingid); reservation = facade.GetReservation(booking.ReservationID); contract = facade.GetCustomer(booking.ContractID); InitializeWindowContent(); }
public CustomerController(ICustomer customer, IBooking booking, IRoom room, IBed bed) { _icustomer = customer; _ibooking = booking; _iroom = room; _ibed = bed; }
private void CheckOutBtn_Click(object sender, RoutedEventArgs e) { if (CheckInCheckOutDataGrid.SelectedItem == null) { MessageBox.Show("请选择一个订单!"); return; } else if (searchbyRooms) { IRoom rm = CheckInCheckOutDataGrid.SelectedItem as IRoom; if (rm.RStatus != RoomStatus.Occupied) { MessageBox.Show("房间没有人入住!"); return; } CheckOutWindow checkoutWin = new CheckOutWindow(CheckInCheckOutDataGrid.SelectedItem as IRoom); checkoutWin.ShowDialog(); } else if (!searchbyRooms) { IBooking bk = CheckInCheckOutDataGrid.SelectedItem as IBooking; if (bk.RoomID == "") { MessageBox.Show("未入住,不能离店!"); return; } CheckOutWindow checkoutWin = new CheckOutWindow((CheckInCheckOutDataGrid.SelectedItem as IBooking).ID); checkoutWin.ShowDialog(); } }
public Form1() { InitializeComponent(); _calc = StartClient(new QpidBinding("192.168.1.14", 5673)); _order.Type = "Default"; _order.Price = 0; }
/// <summary> /// /// </summary> /// <param name="objectSpace"></param> /// <param name="booking"></param> private void ShowBookingDialog(IObjectSpace objectSpace, IBooking booking) { var detailViewBooking = Application.CreateDetailView(objectSpace, booking); ShowViewParameters parameters = new ShowViewParameters(detailViewBooking) { TargetWindow = TargetWindow.Default, Context = TemplateContext.PopupWindow }; DialogController dialogController = new DialogController(); dialogController.SaveOnAccept = true; dialogController.AcceptAction.Caption = CaptionHelper.GetLocalizedText("DialogButtons", "Ok", "Ok"); dialogController.CancelAction.Caption = CaptionHelper.GetLocalizedText("DialogButtons", "Cancel", "Cancel"); dialogController.AcceptAction.ActionMeaning = ActionMeaning.Accept; dialogController.CancelAction.ActionMeaning = ActionMeaning.Cancel; dialogController.CanCloseWindow = true; dialogController.Accepting += new EventHandler <DialogControllerAcceptingEventArgs>(dialogController_Accepting); dialogController.Cancelling += new EventHandler(dialogController_Cancelling); parameters.Controllers.Add(dialogController); Application.ShowViewStrategy.ShowView(parameters, new ShowViewSource(Frame, null)); }
public void StopClient(IBooking client) { Console.WriteLine(" Stopping Client..."); ((IChannel)client).Close(); fac.Close(); Console.WriteLine("[DONE]"); }
public IActionResult Import([FromForm] FileViewModel model) { IFormFile file = model.importedFile; if (file == null) { return(RedirectToAction("Index")); } List <BookingExportImportViewModel> importedBookings = bookingService.Import(file); if (!cache.TryGetValue(CacheKeys.BOOKING, out bookings)) { bookings = new List <IBooking>(); } List <ILocation> locations; if (!cache.TryGetValue(CacheKeys.LOCATION, out locations)) { locations = new List <ILocation>(); } foreach (BookingExportImportViewModel b in importedBookings) { IBooking boo = b.generateBooking(); bool uniqeId = true; foreach (IBooking ib in bookings) { if (ib.id.Equals(b.id)) { uniqeId = false; } } if (uniqeId) { if (TryValidateModel(boo)) { bookings.Add(boo); boo.station = null; bool notIncluded = true; foreach (ILocation loc in locations) { if (loc.id.Equals(boo.location.id)) { notIncluded = false; break; } } if (notIncluded) { locations.Add(boo.location); } } } } cache.Set(CacheKeys.LOCATION, locations); cache.Set(CacheKeys.BOOKING, bookings); return(RedirectToAction("Index")); }
public AssignmentForm(SchedulerControl control, Appointment apt, IBooking parent, DevExpress.XtraGrid.GridControl gridControl1) { InitializeComponent(); _control = control; _apt = apt; //se c'è un oggetto assignment sottostante è un aggiornamento altrimenti una creazione Assignment a = _apt.GetSourceObject(_control.Storage) as Assignment; if (a == null) { _isCreationOp = true; } else { _isCreationOp = false; } lstcont.Items.Clear(); _parentBooking = parent; _gridControl1 = gridControl1; LoadResourcesCombo(); LoadBedTypesCombo(); LoadAppointmentData(); }
public void CalculatePaymentsForBooking(IBooking booking) { Booking bookingModel = (Booking)booking; bookingModel.CalculateAmounts(); PaymentStrategy paymentStrategy = new PaymentStrategy(customerController); paymentStrategy.CreatePayments(bookingModel, paymentController); }
public IInvoice ReturnBook(int bookingNr) { IBooking booking = bookings.Where(x => x.BookingNr == bookingNr).FirstOrDefault(); foreach (IBook book in booking.Books) { book.Return(); books.Where(x => x.ISBN == book.ISBN).Select(x => { return(book); }).ToList(); } booking.BookingCompleted = true; int time = DateTime.Now.Subtract(booking.StartDate).Days; int totalPrice = 0; if (time > 21) { totalPrice = 10 * booking.Books.Count(); } bookings.Where(x => x.BookingNr == booking.BookingNr).Select(x => { return(booking); }).ToList(); int invoiceNr = 1; if (invoices.Count() != 0) { invoiceNr = invoices.Max(x => x.InvoiceNr) + 1; } Invoice invoice = new Invoice(invoiceNr, booking, totalPrice); invoices.Add(invoice); return(invoice); }
private void btnBook_Click(object sender, EventArgs e) { IBooking book = new IBooking(); book.Surname = txtSurname.Text; book.OtherNames = txtOtherNames.Text; book.PhoneNum = Int32.Parse(txtPhoneNum.Text); book.Email = txtEmail.Text; book.ArrivalDate = dpArrivalDate.Value; book.ArrivalTime = dpArrivalTime.Value.TimeOfDay; book.DepatureDate = dpDepartureDate.Value; book.DepartureTime = dpDepartureTime.Value.TimeOfDay; book.NoOfNights = Int32.Parse(txtNumOfNight.Text); book.NumberOfAdults = Int32.Parse(txtNumOfAdults.Text); book.RoomNum = txtRoomNum.Text; book.ClientType = iTypeRoomCustComboBox.Text; book.Selected = txtSelected.Text; book.RoomRate = decimal.Parse(txtCost.Text); book.DepositedAmount = decimal.Parse(txtAmount.Text); book.ChequeNum = Int32.Parse(txtChequeNum.Text); dc.IBookings.InsertOnSubmit(book); dc.SubmitChanges(); MessageBox.Show("Booking done SuccessFull", "Booking", MessageBoxButtons.OK, MessageBoxIcon.Information); this.Close(); }
public static void ConfirmBooking(IBooking bookingToConfirm) { if (bookingToConfirm == null) { throw new ArgumentNullException("Booking cant be null"); } using (DatabaseEntities context = new DatabaseEntities()) { Booking result = (from booking in context.Bookings where booking.bookingID == bookingToConfirm.bookingID select booking).SingleOrDefault(); if (result != null) { result.confirmed = true; result.date = bookingToConfirm.GetDate().GetDatabaseFormat(); result.time = bookingToConfirm.GetTime().GetFormatted(); result.cost = bookingToConfirm.GetCost(); if (bookingToConfirm.GetBookingType() == BookingType.SIMPLE) { result.bookingType = "simple"; } else { result.bookingType = "facilitated"; } context.SaveChanges(); } } }
/// <summary> /// Deposit /// </summary> /// <param name="booking"></param> public void Deposit(IBooking booking) { if (booking.Value < 0) throw new ArgumentOutOfRangeException( "Deposit amount must be greater than zero!"); bookings.Add(booking); }
public static void UpdateBooking(IBooking Booking) { string strExecution = "[exp].[usp_UpdateBookingFromCharges]"; long bookingId = 0; using (DbQuery oDq = new DbQuery(strExecution)) { oDq.AddBigIntegerParam("@BookingId", Booking.BookingID); oDq.AddBooleanParam("@BrokeragePayable", Booking.BrokeragePayable); oDq.AddDecimalParam("@BrokeragePercent", 12, 2, Booking.BrokeragePercentage); oDq.AddIntegerParam("@BrokeragePayableId", Booking.BrokeragePayableId); oDq.AddBooleanParam("@RefundPayable", Booking.RefundPayable); oDq.AddIntegerParam("@RefundPayableId", Booking.RefundPayableId); oDq.AddVarcharParam("@ExportRemarks", 300, Booking.ExportRemarks); oDq.AddVarcharParam("@RateReference", 50, Booking.RateReference); oDq.AddVarcharParam("@RateType", 20, Booking.RateType); oDq.AddIntegerParam("@fk_FreightPayable", Booking.FreightPayableId); oDq.AddVarcharParam("@UploadFilePath", 200, Booking.UploadPath); oDq.AddIntegerParam("@SlotOperatorId", Booking.SlotOperatorId); oDq.AddVarcharParam("@Shipper", 300, Booking.Shipper); oDq.AddVarcharParam("@PpCc", 10, Booking.PpCc); oDq.AddIntegerParam("@ModifiedBy", Booking.ModifiedBy); oDq.AddDateTimeParam("@ModifiedOn", Booking.ModifiedOn); bookingId = Convert.ToInt64(oDq.GetScalar()); } }
/// <summary> /// Es wird eine Nachricht generiert entsprechend der übergebenen Bezeichung, bezüglich der übergebene Buchung. /// Es wird die Methode zu senden von Nachrichten aufgerufen. /// </summary> /// <param name="booking">Buchung für die eine Nachricht generiet wird.</param> /// <param name="eventName">Bezeichung, was für eine Art von Nachricht erzeugt werden soll.</param> public string generate(IBooking booking, string eventName) { string message = ""; switch (eventName) { case NotificationEvent.ACCEPTED: message = generateMessageAccepted(booking); break; case NotificationEvent.DECLINED: message = generateMessageDeclined(booking); break; case NotificationEvent.CHECKIN: message = generateMessageCheckIn(booking); break; case NotificationEvent.CHECKOUT: message = generateMessageCheckOut(booking); break; case NotificationEvent.BEGINN: message = generateMessageBeginn(booking); break; default: break; } return(message); }
/// <summary> /// Generiert eine "CheckIn"-Nachricht zu der entsprechenden Buchung. /// </summary> /// <param name="booking">Buchung zu der die Nachricht erzeugt wird.</param> /// <returns></returns> private string generateMessageCheckIn(IBooking booking) { string message = string.Format(commands.ElementAt(0), booking.location.name, booking.socStart, booking.socEnd) + commands.ElementAt(3) + string.Format(commands.ElementAt(7), booking.endTime.ToString("dd.MM.yyyy"), booking.endTime.ToString("HH:mm:ss")); return(message); }
public CheckOutWindow(string bookingid) { booking = facade.GetBooking(bookingid); room = facade.GetRoom(booking.RoomID); InitializeComponent(); InitializeWindowContent(); }
internal IBooking UpdateBooking(IBooking booking) { connect(); SQLiteCommand cmd = new SQLiteCommand("UPDATE Booking SET RESERVETIME=:RESERVETIME,CONTRACTID=:CONTRACTID,ROOMID=:ROOMID,BSTATUS=:BSTATUS WHERE BOOKINGID=:BOOKINGID", sqlCon); cmd.Parameters.AddWithValue("BOOKINGID", booking.ID); //cmd.Parameters.AddWithValue("STARTDATE", booking.StartDate); //cmd.Parameters.AddWithValue("ENDDATE", booking.EndDate); cmd.Parameters.AddWithValue("RESERVETIME", booking.ReserveTime); cmd.Parameters.AddWithValue("CONTRACTID", booking.ContractID); //cmd.Parameters.AddWithValue("ROOMTYPE", booking.Roomtype); //cmd.Parameters.AddWithValue("THISPRICE", booking.ThisPrice); cmd.Parameters.AddWithValue("ROOMID", booking.RoomID); //cmd.Parameters.AddWithValue("RESERVATIONID", booking.ReservationID); cmd.Parameters.AddWithValue("BSTATUS", booking.BStatus.ToString()); try { cmd.ExecuteNonQuery(); } catch (Exception ex) { throw new Exception("Booking with ID: " + booking.ID + " could not be updated!\n" + ex.Message); } finally { disconnect(); } return(GetBooking(booking.ID)); }
/// <summary> /// /// </summary> /// <param name="csvExport"></param> /// <param name="booking"></param> /// <param name="counter" ></param> private static void AddRow(CsvExport csvExport, IBooking booking, int counter) { var timeDiff = booking.EndTime.Subtract(booking.StartTime); csvExport.AddRow(); csvExport["UN_ID"] = $"{counter}"; csvExport["COMP_ID"] = booking.Customer.ShortName; csvExport["USER_ID"] = booking.Employee.User.UserName; csvExport["DESC"] = booking.Task.Name; csvExport["DESC_MEMO"] = booking.TaskDescription; csvExport["NDESC"] = booking.Task.Number.ToString(); csvExport["DAT"] = booking.Date.ToShortDateString(); csvExport["NR_WEEK"] = string.Format("{0}", booking.Date.CalendarWeek()); csvExport["T_START"] = booking.StartTime.ToString(); csvExport["T_END"] = booking.EndTime.ToString(); csvExport["T_S_FACT"] = ""; csvExport["T_E_FACT"] = ""; csvExport["CUSTOMER"] = string.Format("{0} {1}", booking.Customer.Number, booking.Customer.Name); csvExport["TIME_DIFF"] = string.Format("{0:D2}:{1:D2}:{2:D2}", timeDiff.Hours, timeDiff.Minutes, timeDiff.Seconds); csvExport["TIME_FACT"] = ""; csvExport["PAYED"] = "FALSCH"; csvExport["NSEC"] = timeDiff.TotalSeconds.ToString(); csvExport["NSEC_FACT"] = "0"; csvExport["KNR"] = booking.Customer.Number.ToString(); csvExport["NPROJECT"] = booking.Project.Number.ToString(); csvExport["DESCP"] = booking.Project.Name; csvExport["BOOKED"] = "FALSCH"; csvExport["UNIT"] = "0"; csvExport["PRICE"] = "{0}"; }
public void DeleteBooking(IBooking booking) { BookingEntity entity = (BookingEntity)booking; entity.Deleted = true; bookings.Remove(booking); }
public IBooking UpdateBooking(IBooking booking) { IBooking originalBooking = _context.tblBookings.Find(booking.BookingID); originalBooking = booking; _context.SaveChanges(); return(originalBooking); }
private void button2_Click(object sender, EventArgs e) { Receipt r = _calc.Checkout(); richTextBox1.Text = r.Summary + "\n" + "Total Price = " + r.Price; // reset _calc = StartClient(new QpidBinding("192.168.1.14", 5673)); }
/// <summary> /// Generiert eine "Abgelehnt"-Nachricht zu der entsprechenden Buchung. /// </summary> /// <param name="booking">Buhcung zu der die Nachricht erzeugt wird.</param> /// <returns></returns> private string generateMessageDeclined(IBooking booking) { string message = string.Format(commands.ElementAt(0), booking.location.name, booking.socStart, booking.socEnd) + commands.ElementAt(2) + string.Format(commands.ElementAt(6), booking.socStart, booking.socEnd, booking.startTime.ToString("dd.MM.yyyy HH:mm:ss"), booking.endTime.ToString("dd.MM.yyyy HH:mm:ss"), booking.capacity); return(message); }
public APIBookingController(ICustomer icustomer, ICustomerAcount iacount, IRoom iroom, IBooking ibooking, IBookedBeds bookedbeds, IBed ibed) { _icustomer = icustomer; _iacount = iacount; _iroom = iroom; _ibooking = ibooking; _bookedBeds = bookedbeds; _ibed = ibed; }
internal Booking(IBooking bookingEntity, IDataAccessFacade dataAccessFacade) { this.dataAccessFacade = dataAccessFacade; _bookingEntity = bookingEntity; // Create Models of supplier and customer _supplier = new Supplier(dataAccessFacade, _bookingEntity.Supplier); _customer = new Customer(_bookingEntity.Customer, dataAccessFacade); }
public IBooking ReservBook(IList <IBook> books, int libNr, int memberNr) { ILibrarian librarian = GetLibrarianNr(libNr); IMember member = GetMemberNr(memberNr); IBooking booking = inventory.ReserveBook(books, librarian, member); bookings.Add(booking); return(booking); }
private void Form1_Load(object sender, EventArgs e) { booking = new Booking(new Database()); FillCustomers(); FillGenres(); FillVideos(); FillAvailbaleVideos(); FillBookedVideos(); }
/// <summary> /// 记录订单 booking 中旅客列表 customers 的 CheckIn 事件 /// </summary> internal void Log_CheckIn(List <ICustomer> customers, IBooking booking) { string temp = null; foreach (ICustomer cus in customers) { temp += (cus.Name + " "); } dbCon.CreateLog(temp + " checked in room: " + dbCon.GetRoom(booking.RoomID).RoomNum); }
private void ResetUserInterface() { if (activeBooking != null) { bookings.DeleteID(activeBooking.GetID()); activeBooking = null; screen.ClearTextBoxes(); screen.DisableButtons(); } }
public Guid AddBooking(IBooking booking) { var command = new AddBookingCommand(booking); var result = _processor.ProcessCommand(command); if (result.EventsWereEmitted) { return command.CreatedGuid; } throw new CreationFailedException(command.CreatedGuid, typeof (IBooking)); }
public tblBooking(IBooking booking) { this.BookingID = booking.BookingID; this.Deleted = booking.Deleted; this.InPrice = booking.InPrice; this.OutPrice = booking.OutPrice; this.ServiceDate = booking.ServiceDate; this.ServiceID = booking.ServiceID; this.SiteID = booking.SiteID; }
public IPaymentContract CreatePaymentContract(IBooking iBooking, IPaymentRule iPaymentRule) { IPaymentContract iPaymentContract = paymentContractController.Create(iBooking, iPaymentRule); iPaymentContract = dataAccessFacade.CreatePaymentContract(iPaymentContract); if (iPaymentContract.Deleted == false) { UpdatePaymentContract(iPaymentContract); } return iPaymentContract; }
public List<IPaymentContract> CreatePaymentContracts(IBooking iBooking, List<IPaymentRule> iPaymentRules) { List<IPaymentContract> newPaymentContracts = new List<IPaymentContract>(); foreach (IPaymentRule iPaymentRule in iPaymentRules) { IPaymentContract paymentContract = CreatePaymentContract(iBooking, iPaymentRule); newPaymentContracts.Add(paymentContract); } return newPaymentContracts; }
public Booking(IBooking iBooking) { Id = iBooking.Id; Deleted = iBooking.Deleted; LastUpdated = iBooking.LastUpdated; Sale = iBooking.Sale; Supplier = iBooking.Supplier; BookingType = iBooking.BookingType; StartDate = iBooking.StartDate; EndDate = iBooking.EndDate; TotalAmount = iBooking.TotalAmount; Valuta = iBooking.Valuta; Notes = iBooking.Notes; }
public PaymentContract(IBooking iBooking, IPaymentRule iPaymentRule) { Booking = iBooking; if (iPaymentRule.ReferenceDate == ReferenceDate.BookingEndDate) { DueDate = iBooking.EndDate.AddDays(iPaymentRule.PaymentDate); } else { DueDate = iBooking.StartDate.AddDays(iPaymentRule.PaymentDate); } Amount = iBooking.TotalAmount * iPaymentRule.Percentage; Valuta = iBooking.Valuta; }
internal Booking(Supplier supplier, Customer customer, string sale, int bookingNumber, DateTime startDate, DateTime endDate, IDataAccessFacade dataAccessFacade) { validateSale(sale); validateEndDate(startDate, endDate); // Get entities for DataAccess ISupplier supplierEntity = supplier._supplierEntity; ICustomer customerEntity = customer._customerEntity; this.dataAccessFacade = dataAccessFacade; _bookingEntity = dataAccessFacade.CreateBooking(supplierEntity, customerEntity, sale, bookingNumber, startDate, endDate); _supplier = supplier; _customer = customer; }
public void UpdateBooking(IBooking booking) { BookingEntity entity = (BookingEntity)booking; entity.LastModified = DateTime.Now; }
private void bookingsDataGrid_SelectionChanged(object sender, SelectionChangedEventArgs e) { selectedBooking = (IBooking)bookingsDataGrid.SelectedItem; setValuesInTextBoxes(); }
public IPaymentRuleCatalog CreatePaymentRuleCatalog(IBooking iBooking) { IPaymentRuleCatalog iPaymentRuleCatalog = paymentRuleCatalogController.Create(iBooking); iPaymentRuleCatalog = dataAccessFacade.CreatePaymentRuleCatalog(iPaymentRuleCatalog); if (iPaymentRuleCatalog.Deleted == false) { UpdatePaymentRuleCatalog(iPaymentRuleCatalog); } return iPaymentRuleCatalog; }
public IPaymentRuleCatalog GetPaymentRuleCatalog(IBooking iBooking) { IPaymentRuleCatalog prc = paymentRuleCatalogController.GetPaymentRuleCatalog(iBooking); if (prc == null) { prc = CreatePaymentRuleCatalog(iBooking); } return prc; }
public IBooking DeleteBooking(IBooking iBooking) { iBooking = bookingController.Delete(iBooking); return iBooking; }
public IBooking CreateBooking(IBooking iBooking) { iBooking = bookingController.Create(iBooking); return iBooking; }
public void UpdateBooking(IBooking booking) { //Calls Bookingcollection class for update bookingCollection.Update((Booking) booking); }
/// <summary> /// Withdraw /// </summary> /// <param name="booking"></param> public void Withdraw(IBooking booking) { if (booking.Value > 0) throw new ArgumentOutOfRangeException( "Withdraw amount must be less than zero!"); bookings.Add(booking); }
public void UpdateBooking(IBooking booking) { //Calls update for a specific Booking. bookingMapper.Update((BookingEntity)booking); }
public BookingController(IBooking injected) { bookie = injected; }
public BookingBLL() { _booking = DataAccessFactory.Instance.Booking; }
public void DeleteBooking(IBooking booking) { //Calls the delete for a specific Booking. bookingMapper.Delete((BookingEntity)booking); }
private IBooking UpdateBooking(IBooking iBooking) { iBooking = bookingController.Update(iBooking); dataAccessFacade.UpdateBooking(iBooking); return iBooking; }
public void DeleteBooking(IBooking booking) { //Calls Bookingcollection class for delete bookingCollection.Delete((Booking) booking); }
public PaymentRuleCatalog(IBooking iBooking) { Supplier = iBooking.Supplier; Customer = iBooking.Sale.Customer; BookingType = iBooking.BookingType; }