private void btn_add_booking_Click(object sender, EventArgs e) { AddBooking form = new AddBooking(bookings, users, rooms, usersPath, bookingsPath, roomsPath); form.SaveObjects += Serialize; openChildForm(form); }
private void rezervareToolStripMenuItem_Click(object sender, EventArgs e) { AddBooking form = new AddBooking(bookings, users, rooms, usersPath, bookingsPath, roomsPath); form.SaveObjects += Serialize; openChildForm(form); }
public ActionResult Add() { AddBooking viewmodel = new AddBooking(); viewmodel.Doctors = db.Doctors.ToList(); viewmodel.Patients = db.Patients.ToList(); return(View(viewmodel)); }
protected void RegisterNewBooking(AddBooking request) { _bookingsByStartDate.Add(request.StartDate, new Booking(request.BookingId, request.Reference, request.StartDate, request.EndDate, request.PropertyId)); for (var currentDate = request.StartDate; currentDate < request.EndDate; currentDate.AddDays(1)) { if (!_unavailableDates.Contains(currentDate)) { _unavailableDates.Add(currentDate); } } }
public ActionResult Add() { AddBooking viewmodel = new AddBooking(); viewmodel.Groomers = db.Groomers.ToList(); viewmodel.Pets = db.Pets.ToList(); viewmodel.Services = db.GroomServices.ToList(); viewmodel.Owners = db.Owners.ToList(); return(View(viewmodel)); }
public async Task <PostResult> CreateBooking(AddBooking booking) { JArray roomdata = new JArray(); foreach (var r in booking.ListRoom) { roomdata.Add(new JObject() { new JProperty("id", r.Id), new JProperty("type", r.Type), new JProperty("room_type", r.RoomType), new JProperty("start_date", booking.CheckInDate), new JProperty("end_date", booking.CheckOutDate), new JProperty("guest_total", r.TotalGuest) }); } JObject @params = new JObject() { new JProperty("params", new JObject() { new JProperty("auth", new JObject() { new JProperty("token", Settings.CurrentHost.Token) }), new JProperty("source", new JObject() { new JProperty("source", "Kamooni Host App"), new JProperty("channel", "Kamooni Host App") }), new JProperty("usr_token", "False"), new JProperty("customer", new JObject() { new JProperty("name", booking.Customer.Name), new JProperty("email", booking.Customer.Email), new JProperty("mobile", booking.Customer.Mobile) }), new JProperty("roomdata", roomdata) }) }; PostResponse response = await restClient.PostAsync <PostResponse, JObject>(Settings.CurrentHost.Url + Constants.ApiURI.URI_CREATE_BOOKING, @params); return(response?.Result); }
public object createbooking(AddBooking Lvm) { try { FRSEntities db = new FRSEntities(); Booking Ru = new Booking(); if (Ru.BookingID == 0) { Ru.FlightID = Lvm.FlightID; Ru.Email = Lvm.Email; Ru.ClassID = Lvm.ClassID; Ru.BookingDate = Lvm.BookingDate; Ru.NoofTickets = Lvm.NoofTickets; Ru.BookingAmount = Lvm.BookingAmount; Ru.DateOfDeparture = Lvm.DateOfDeparture; Ru.ReturnDate = Lvm.ReturnDate; Ru.ReturnTicket = Lvm.ReturnTicket; Ru.ClassDetails = Lvm.ClassDetails; Ru.Del = 1; db.Bookings.Add(Ru); db.SaveChanges(); return(new Response { Status = "Success", Message = "SuccessFully Saved." }); } } catch (Exception) { throw; } return(new Response { Status = "Error", Message = "Invalid Data." }); }
public Controller(AddBooking addBooking) { booking = addBooking; }