本文整理汇总了C#中Booking类的典型用法代码示例。如果您正苦于以下问题:C# Booking类的具体用法?C# Booking怎么用?C# Booking使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Booking类属于命名空间,在下文中一共展示了Booking类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: AddEditBooking_Load
private void AddEditBooking_Load(object sender, EventArgs e)
{
var unitOfWork = new UnitOfWork();
cbType.DataSource = unitOfWork.BookingClassificationRepository.Get().ToList();
cbType.DisplayMember = "ClassificationName";
cbType.ValueMember = "Id";
var startDate = DateTime.Today;
startDate.AddSeconds(-startDate.Second);
startDate.AddMinutes(-startDate.Minute);
dtpBookingTime.Value = startDate;
if (currentBookingID != null)
{
currentBooking = unitOfWork.BookingRepository.Get(null, null, "Employee,BookingClasification,BookingNotes").Where(x => x.Id == currentBookingID).FirstOrDefault();
btnSave.Text = "Save Changes";
dtpBookingTime.Value = currentBooking.BookingDate;
tbName.Text = currentBooking.Name;
tbContactNumber.Text = currentBooking.ContactNumber;
tbEmail.Text = currentBooking.Email;
cbType.SelectedValue = currentBooking.BookingClasification.Id;
newbookingNotes = currentBooking.BookingNotes.Where(x => x.DateInactive == null).ToList();
}
RebindNotes();
}
开发者ID:tsunamisukoto,项目名称:Book-A-Majig2,代码行数:26,代码来源:AddEditBooking.cs
示例2: AddBooking
public Booking AddBooking(Booking booking)
{
Bookings.Add(booking);
SaveChanges();
return booking;
}
开发者ID:stefanidi,项目名称:NineITBookingAppByRomanStefanidi,代码行数:7,代码来源:BookingContext.cs
示例3: setup
private async void setup()
{
Functions functions = new Functions();
JsonValue list = await functions.getBookings (this.Student.StudentID.ToString());
JsonValue results = list ["Results"];
tableItems = new List<Booking>();
if (list ["IsSuccess"]) {
for (int i = 0; i < results.Count; i++) {
if (DateTime.Parse (results [i] ["ending"]) < DateTime.Now) {
Booking b = new Booking (results [i]);
if (b.BookingArchived == null) {
tableItems.Add (b);
}
}
}
tableItems.Sort((x, y) => DateTime.Compare(x.StartDate, y.StartDate));
this.TableView.ReloadData ();
} else {
createAlert ("Timeout expired", "Please reload view");
}
if (tableItems.Count == 0) {
createAlert ("No Bookings", "You do not have any past bookings");
}
}
开发者ID:SDP2015Group7,项目名称:HELPSMobile,代码行数:25,代码来源:HistoryTableViewController.cs
示例4: Book
public IView Book(int roomId, DateTime startDate, DateTime endDate, string comments)
{
this.Authorize(Roles.User, Roles.VenueAdmin);
var room = this.Data.RepositoryWithRooms.Get(roomId);
if (room == null)
{
return this.NotFound(string.Format("The room with ID {0} does not exist.", roomId));
}
if (startDate > endDate)
{
throw new ArgumentException("The date range is invalid.");
}
var availablePeriod = room.AvailableDates.FirstOrDefault(d => d.StartDate <= startDate || d.EndDate >= endDate);
if (availablePeriod == null)
{
throw new ArgumentException(string.Format("The room is not available to book in the period {0:dd.MM.yyyy} - {1:dd.MM.yyyy}.", startDate, endDate));
}
decimal totalPrice = (endDate - startDate).Days * room.PricePerDay;
var booking = new Booking(this.CurrentUser, startDate, endDate, totalPrice, comments);
room.Bookings.Add(booking);
this.CurrentUser.Bookings.Add(booking);
this.UpdateRoomAvailability(startDate, endDate, room, availablePeriod);
return this.View(booking);
}
开发者ID:exploitx3,项目名称:HighQualityCode,代码行数:29,代码来源:RoomsController.cs
示例5: Invoice
public Invoice(int invoice_id, int entity_id, int invoice_type_id, int booking_id, int payer_organisation_id, int payer_patient_id, int non_booking_invoice_organisation_id, string healthcare_claim_number, int reject_letter_id, string message,
int staff_id, int site_id, DateTime invoice_date_added, decimal total, decimal gst, decimal receipts_total, decimal vouchers_total, decimal credit_notes_total, decimal refunds_total,
bool is_paid, bool is_refund, bool is_batched, int reversed_by, DateTime reversed_date, DateTime last_date_emailed)
{
this.invoice_id = invoice_id;
this.entity_id = entity_id;
this.invoice_type = new IDandDescr(invoice_type_id);
this.booking = booking_id == -1 ? null : new Booking(booking_id);
this.payer_organisation = payer_organisation_id == 0 ? null : new Organisation(payer_organisation_id);
this.payer_patient = payer_patient_id == -1 ? null : new Patient(payer_patient_id);
this.non_booking_invoice_organisation = non_booking_invoice_organisation_id == -1 ? null : new Organisation(non_booking_invoice_organisation_id);
this.healthcare_claim_number = healthcare_claim_number;
this.reject_letter = reject_letter_id == -1 ? null : new Letter(reject_letter_id);
this.message = message;
this.staff = new Staff(staff_id);
this.site = site_id == -1 ? null : new Site(site_id);
this.invoice_date_added = invoice_date_added;
this.total = total;
this.gst = gst;
this.receipts_total = receipts_total;
this.vouchers_total = vouchers_total;
this.credit_notes_total = credit_notes_total;
this.refunds_total = refunds_total;
this.is_paid = is_paid;
this.is_refund = is_refund;
this.is_batched = is_batched;
this.reversed_by = reversed_by == -1 ? null : new Staff(reversed_by);
this.reversed_date = reversed_date;
this.last_date_emailed = last_date_emailed;
}
开发者ID:nblaurenciana-md,项目名称:Websites,代码行数:30,代码来源:Invoice.cs
示例6: Update
/// <summary>
/// Update an existing Booking entry.
/// </summary>
/// <param name="p_booking">Bookingobject with an ID.</param>
/// <returns>Updated Bookingobject.</returns>
public Booking Update(Booking p_booking)
{
using (var context = new FhdwHotelContext())
{
using (var transaction = context.Database.BeginTransaction())
{
try
{
p_booking.Hotel = context.Hotel.SingleOrDefault(h => h.ID == p_booking.Hotel.ID);
context.Booking.Add(p_booking);
context.SaveChanges();
transaction.Commit();
return p_booking;
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine(ex.Message);
transaction.Rollback();
return null;
}
}
}
}
开发者ID:Benzolitz,项目名称:FHDW.Hotel,代码行数:31,代码来源:BookingRepository.cs
示例7: btnBook_Click
protected void btnBook_Click(object sender, EventArgs e)
{
Booking booking = new Booking();
booking.BookingDate = DateTime.Now;
booking.BookingNo = BookingDB.CreateBookingNum(Session["CustId"].ToString(), ddlPackage.SelectedItem.Value.ToString());
booking.TravelerCount = Int32.Parse(ddlTravelCount.SelectedItem.Value);
booking.CustomerId = Int32.Parse(Session["CustId"].ToString());
booking.TripTypeId = ddlTripType.SelectedItem.Value.ToString();
booking.PackageId = Int32.Parse(ddlPackage.SelectedItem.Value);
//lblMessage.Text = "booking = " + booking.BookingDate + " " + booking.BookingNo + " " + booking.TravelerCount + " " +
// booking.CustomerId + " " + booking.TripTypeId + " " + booking.PackageId;
if (BookingDB.InsertBooking(booking))
{
lblMessage.ForeColor = System.Drawing.Color.Green;
lblMessage.Text = "Booking succeeded! Thank you for Booking with Travel Experts.";
// TODO: reset fields
}
else
{
lblMessage.ForeColor = System.Drawing.Color.Red;
lblMessage.Text = "Booking failed!. Please contact Travel Experts";
}
//Response.Redirect("UserHome.aspx");
}
开发者ID:marpoff,项目名称:TravelExpertsASPWebForms,代码行数:27,代码来源:Bookings.aspx.cs
示例8: PutBooking
public IHttpActionResult PutBooking(int id, Booking booking)
{
if (!ModelState.IsValid)
{
return BadRequest(ModelState);
}
if (id != booking.Booking_id)
{
return BadRequest();
}
db.Entry(booking).State = EntityState.Modified;
try
{
db.SaveChanges();
}
catch (DbUpdateConcurrencyException)
{
if (!BookingExists(id))
{
return NotFound();
}
else
{
throw;
}
}
return StatusCode(HttpStatusCode.NoContent);
}
开发者ID:Bang0123,项目名称:SWC2sem,代码行数:32,代码来源:BookingsController.cs
示例9: update
public void update(Booking booking)
{
bookingNameLabel.Text = booking.Topic;
dateLabel.Text = booking.StartDate.ToShortDateString();
dayLabel.Text = booking.StartDate.DayOfWeek.ToString ();
timeLabel.Text = booking.StartDate.ToShortTimeString() + " - " + booking.EndDate.ToShortTimeString();
}
开发者ID:SDP2015Group7,项目名称:HELPSMobile,代码行数:7,代码来源:BookingCell.cs
示例10: CreateOrUpdateBooking
/// <summary>Creates or updates a booking.</summary>
/// <param name="booking">The booking to create/update.</param>
/// <param name="wasAChange">If the call changed a booking instead of creating a new one, this will be true.</param>
/// <returns>The result of the method call.</returns>
public static RequestResult CreateOrUpdateBooking(Booking booking, out bool wasAChange)
{
wasAChange = false;
Booking[] bookings;
var result = ServiceClients.BookingManager.GetBookingsByDate(out bookings, booking.StartTime.Date);
if (result != RequestStatus.Success) return RequestResult.InvalidInput;
var temp = bookings.FirstOrDefault(b => BookingsOverlap(b, booking));
RequestStatus rs;
if (temp == null) rs = ServiceClients.BookingManager.CreateBooking(PersonModel.loggedInUser.Token, ref booking);
else
{
temp.StartTime = booking.StartTime;
temp.EndTime = booking.EndTime;
rs = ServiceClients.BookingManager.ChangeTimeOfBooking(PersonModel.loggedInUser.Token, ref temp);
wasAChange = true;
}
switch (rs)
{
case RequestStatus.Success: return RequestResult.Success;
case RequestStatus.AccessDenied: return RequestResult.AccessDenied;
case RequestStatus.InvalidInput: return RequestResult.InvalidInput;
default: return RequestResult.Error;
}
}
开发者ID:esfdk,项目名称:itubs,代码行数:33,代码来源:BookingModel.cs
示例11: AddNewBookingToDB
//add a new booking passing roombooking means extra unneeded data is being shunted around.
//public void AddNewBookingToDB(int RoomIdfk, DateTime BookingFrom, DateTime BookingTo, Decimal Roomcost) {
public void AddNewBookingToDB(RoomBooking myRB)
{
using (var context = new Sunshine_HotelEntities1())
{
// CREATE a new booking
var newbooking = new Booking();
newbooking.RoomIDFK = myRB.RoomIdfk;
newbooking.BookingFrom = myRB.BookingFrom.Date;
newbooking.BookingTo = myRB.BookingTo.Date;
//add in the cost of the room extracted from the dictionary
newbooking.RoomCost = myRB.roomCost;
// RoomCost = (decimal) newbooking.RoomCost;
//update db
context.Bookings.Add(newbooking);
context.SaveChanges();
var BookedConfirmationMessage = Environment.NewLine + "You have booked Room " +
myRB.RoomIdfk + Environment.NewLine + "From " +
myRB.BookingFrom + " To " + Environment.NewLine +
myRB.BookingTo + Environment.NewLine + " For " +
(string.Format("{0:C}", myRB.roomCost));
//show a confirmation message
MessageBox.Show(BookedConfirmationMessage);
}
}
开发者ID:Netchicken,项目名称:Hotel,代码行数:29,代码来源:ModelCalls.cs
示例12: AddBooking
public void AddBooking(String username, int referenceNumber)
{
var booking = new Booking();
booking.reference_number = referenceNumber;
booking.creator = username;
db.Bookings.InsertOnSubmit(booking);
db.SubmitChanges();
}
开发者ID:thebinarysearchtree,项目名称:infs3204,代码行数:8,代码来源:BookingRepository.cs
示例13: CreateBooking
public void CreateBooking(Booking booking)
{
this.bookings.Add(booking);
this.hotelRooms
.GetById(booking.HotelRoomsId)
.Booked = true;
this.bookings.SaveChanges();
}
开发者ID:iwelina-popova,项目名称:HotelSystem,代码行数:8,代码来源:BookingsService.cs
示例14: TimetableModel
public TimetableModel(List<Room> Rooms, List<TimeSlot> Times, Booking[,] Bookings, DateTime Day)
{
this.Rooms = Rooms;
this.Times = Times;
this.Bookings = Bookings;
this.Day = Day;
ValidTimetable = true;
}
开发者ID:hnefatl,项目名称:Prototype1,代码行数:8,代码来源:TimetableModel.cs
示例15: Event
/// <summary>
/// Constructor that prefills the fields.
/// </summary>
/// <param name="pk"></param>
/// <param name="start"></param>
/// <param name="end"></param>
/// <param name="name"></param>
public Event(Booking aBooking)
{
this.booking = aBooking;
this.Start = aBooking.Startdatetime;
this.End = aBooking.Enddatetime;
this.PK = aBooking.Bookingid;
}
开发者ID:andersruberg,项目名称:RehabWeb,代码行数:15,代码来源:Event.cs
示例16: milesForBooking
private static int milesForBooking(Booking booking)
{
if (booking.GetType() == typeof(Flight))
{
return ((Flight)booking).Miles;
}
return 0;
}
开发者ID:CSSE376,项目名称:savagejs,代码行数:8,代码来源:User.cs
示例17: CancelBooking
public void CancelBooking(Booking booking)
{
CancelRequest cancelrequest = new CancelRequest();
cancelrequest.Signature = signature;
CancelRequestData cancelrequestdata = new CancelRequestData();
cancelrequest.CancelRequestData = cancelrequestdata;
cancelrequestdata.CancelBy = CancelBy.Journey;
CancelJourney canceljourney = new CancelJourney();
cancelrequestdata.CancelJourney = canceljourney;
CancelJourneyRequest canceljourneyrequest = new CancelJourneyRequest();
canceljourney.CancelJourneyRequest = canceljourneyrequest;
//Journey[] journeys = new Journey[1];
//journeys[0] = new Journey();
//journeys[0].Segments = new Segment[1];//here i am assuming this is a direct journey with one segment
//journeys[0].Segments[0] = new Segment();
//journeys[0].Segments[0].ActionStatusCode = booking.Journeys[0].Segments[0].ActionStatusCode;
//journeys[0].Segments[0].DepartureStation = booking.Journeys[0].Segments[0].DepartureStation;
//journeys[0].Segments[0].ArrivalStation = booking.Journeys[0].Segments[0].ArrivalStation;
//journeys[0].Segments[0].STD = booking.Journeys[0].Segments[0].STD;
//journeys[0].Segments[0].STA = booking.Journeys[0].Segments[0].STA;
//journeys[0].Segments[0].FlightDesignator = booking.Journeys[0].Segments[0].FlightDesignator;//flight designator means carrier code
canceljourneyrequest.Journeys = new Journey[1];
canceljourneyrequest.Journeys[0] = new Journey();
canceljourneyrequest.Journeys[0].Segments = new Segment[booking.Journeys[0].Segments.Length];
for (int i = 0; i < booking.Journeys[0].Segments.Length; i++)
{
canceljourneyrequest.Journeys[0].Segments[i] = new Segment();
canceljourneyrequest.Journeys[0].Segments[i].STA = booking.Journeys[0].Segments[i].STA;
canceljourneyrequest.Journeys[0].Segments[i].STD = booking.Journeys[0].Segments[i].STD;
canceljourneyrequest.Journeys[0].Segments[i].ArrivalStation = booking.Journeys[0].Segments[i].ArrivalStation;
canceljourneyrequest.Journeys[0].Segments[i].DepartureStation = booking.Journeys[0].Segments[i].DepartureStation;
canceljourneyrequest.Journeys[0].Segments[i].FlightDesignator = booking.Journeys[0].Segments[i].FlightDesignator;
canceljourneyrequest.Journeys[0].Segments[i].Fares = new Fare[1];
canceljourneyrequest.Journeys[0].Segments[i].Fares[0] = new Fare();
canceljourneyrequest.Journeys[0].Segments[i].Fares[0].CarrierCode = booking.Journeys[0].Segments[i].Fares[0].CarrierCode;
canceljourneyrequest.Journeys[0].Segments[i].PaxSSRs = new PaxSSR[0];
}
canceljourneyrequest.Journeys = booking.Journeys;
CancelResponse cancelresponse = clientapi.Cancel(cancelrequest);
Console.WriteLine("Balance Due after cancellation: {0:C}", cancelresponse.BookingUpdateResponseData.Success.PNRAmount.BalanceDue);
CommitRequest commitrequest = new CommitRequest();
commitrequest.BookingRequest = new CommitRequestData();
commitrequest.BookingRequest.Booking = new Booking();
commitrequest.BookingRequest.Booking.RecordLocator = booking.RecordLocator;
commitrequest.BookingRequest.Booking.CurrencyCode = booking.CurrencyCode;
commitrequest.BookingRequest.Booking.ReceivedBy = new ReceivedByInfo();
commitrequest.BookingRequest.Booking.ReceivedBy.ReceivedBy = "Michelle New";
commitrequest.Signature = signature;
CommitResponse commitbookingresponse = clientapi.Commit(commitrequest);
}
开发者ID:jetstarapisupport,项目名称:API-Test-Program,代码行数:57,代码来源:Booking2.cs
示例18: Delete
public void Delete(Booking entity)
{
if (HasPayments(entity)) {
throw new BookingHasPaymentsException();
}
_unitOfWork.BookingRepository.Delete(entity);
_unitOfWork.Commit();
}
开发者ID:EmilyWatsonCF,项目名称:ResortManager,代码行数:9,代码来源:BookingService.cs
示例19: BookingChangeHistory
public BookingChangeHistory(int booking_change_history_id, int booking_id, int moved_by, DateTime date_moved, int booking_change_history_reason_id, DateTime previous_datetime)
{
this.booking_change_history_id = booking_change_history_id;
this.booking = new Booking(booking_id);
this.moved_by = moved_by;
this.date_moved = date_moved;
this.booking_change_history_reason = new IDandDescr(booking_change_history_reason_id);
this.previous_datetime = previous_datetime;
}
开发者ID:nblaurenciana-md,项目名称:Websites,代码行数:9,代码来源:BookingChangeHistory.cs
示例20: Read
public override Room Read(Booking booking)
{
var room = DBConnection.ExecuteQuery(
$"SELECT r.Id AS RoomId, Capacity FROM ConferenceRoom AS r "+
$"JOIN Booking ON r.Id = Booking.ConferenceRoomId "+
$"WHERE Booking.Id = {booking.Id};"
);
return ParseToRoom(room).FirstOrDefault();
}
开发者ID:stenshoj,项目名称:postgaarden,代码行数:10,代码来源:SqliteRoomCrud.cs
注:本文中的Booking类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论