public List <Booking> FindAllBookings() { List <Booking> bookingList = new List <Booking>(); bookingList = BookingDAL.FindAllBookings(); return(bookingList); }
public void SaveBooking(Booking booking) { // Uppfyller inte objektet affärsreglerna... ICollection <ValidationResult> validationResults; if (!booking.Validate(out validationResults)) // Använder "extension method" för valideringen! { // Klassen finns under App_Infrastructure. // ...kastas ett undantag med ett allmänt felmeddelande samt en referens // till samlingen med resultat av valideringen. var ex = new ValidationException("Objektet klarade inte valideringen."); ex.Data.Add("ValidationResults", validationResults); throw ex; } // Booking-objektet sparas antingen genom att en ny post // skapas eller genom att en befintlig post uppdateras. if (booking.BookingID == 0) // Ny post om CustomerId är 0! { BookingDAL.InsertBooking(booking); } else { BookingDAL.UpdateBooking(booking); } }
private void button1_Click(object sender, EventArgs e) { try { int a = dataGridView1.CurrentCell.ColumnIndex; int b = dataGridView3.CurrentCell.ColumnIndex; int c = dataGridView2.CurrentCell.ColumnIndex; if (a == 0) { //add.showBalloonTip( dataGridView1.CurrentCell.Value.ToString(), "Student ID Selected"); x = int.Parse(dataGridView1.CurrentCell.Value.ToString()); if (b == 0) { //add.showBalloonTip(dataGridView3.CurrentCell.Value.ToString(), "Tutor ID Selected"); y = int.Parse(dataGridView3.CurrentCell.Value.ToString()); if (c == 0) { //add.showBalloonTip(dataGridView2.CurrentCell.Value.ToString(), "Room ID Selected"); z = int.Parse(dataGridView2.CurrentCell.Value.ToString()); BookingDAL.addNewBooking(x, y, z, cboAllocated.Text, cboDay.Text, cboTime.Text, comboBox2.Text, int.Parse(textBox1.Text), int.Parse(comboBox1.Text)); add.showBalloonTip("Success", "Successfully Add Booking"); cboAllocated.SelectedIndex = -1; cboDay.SelectedIndex = -1; cboTime.SelectedIndex = -1; comboBox1.SelectedIndex = -1; comboBox2.SelectedIndex = -1; textBox1.Text = ""; dataGridView1.ClearSelection(); dataGridView2.ClearSelection(); dataGridView3.ClearSelection(); } else { add.showBalloonTip("Room Number ", "Please Select a Room Number"); } } else { add.showBalloonTip("Tutor ID ", "Please Select a Tutor ID"); } } else { add.showBalloonTip("Student ID ", "Please Select a Student ID"); } } catch (Exception ex) { add.showBalloonTip("Error", "Something Went Wrong"); System.IO.StreamWriter writer = new System.IO.StreamWriter("../../ErrorLog.txt", true); writer.WriteLine("- " + DateTime.Now + " " + ex.Message, true); writer.Flush(); writer.Close(); } }
public IHttpActionResult GetEmployee(int id) { IBooking myDbBooking = new BookingDAL(); btcr = new ASP.NET_Backend.Controller.BookingController(myDbBooking); var hairdresser = btcr.FindHairdresser(3); return(Ok(hairdresser)); }
/// <summary> /// Calls check in function with booking Model BookingDAL.CheckCheckin(bookingModel); /// Returns string dependant on login success /// </summary> public static string ProcessTableCheckin(BookingModel bookingModel) { bool bCheck = BookingDAL.CheckCheckin(bookingModel); //check if booking exists - return false if exists if (bCheck == false) { return(bookingModel.emailAddress + " has successfully checked in!"); } return("Failed to check in. Booking does not exist. If you are more than 15 minutes late your booking has been deleted."); }
private void addBookingstoDb() { List <Booking> bookinglist = parsefile.getCSVBookingdata(); BookingDAL bookingDAL = new BookingDAL(); foreach (Booking bok in bookinglist) { bookingDAL.addBookingDb(bok); } }
/// <summary> /// Books a table with booking Model via TableDAL.CheckTableStatus(bookingModel) /// If booking is successful returns bool true /// else returns bool false /// </summary> public static bool ProcessCalanderBookTable(BookingModel bookingModel) { bool bCheck = TableDAL.CheckTableStatus(bookingModel); //check if booking exists - return false if exists if (bCheck == true) { if (BookingDAL.CreateCalanderBookTable(bookingModel)) { return(true); } } return(false); }
private void button3_Click(object sender, EventArgs e) { try { BookingDAL.TerminateBooking(x); add.showBalloonTip("Success", "Successfully Terminated Booking"); } catch (Exception ex) { add.showBalloonTip("Error", "Something Went Wrong"); System.IO.StreamWriter writer = new System.IO.StreamWriter("../../ErrorLog.txt", true); writer.WriteLine("- " + DateTime.Now + " " + ex.Message, true); writer.Flush(); writer.Close(); } }
protected void Page_Load(object sender, EventArgs e) { List <Inovice> incl = new List <Inovice>(); BookingDAL bd = new BookingDAL(); Inovice inc = (Inovice)Session["Invoice"]; Custname = inc.CustName; Custph = inc.CustContact; Vname = inc.VenName; Vemail = inc.VenEmail; Vph = inc.VenContact; Basic = inc.Basic; Service = inc.ServiceType; }
public void SaveBooking(Booking booking) { ICollection <ValidationResult> validationResults; if (!booking.Validate(out validationResults)) { var ex = new ValidationException("Objektet klarade inte valideringen"); ex.Data.Add("ValidationResults", validationResults); throw ex; } if (booking.BookingID == 0)//Ny post om Id är 0 { BookingDAL.InsertBooking(booking); } else { throw new ApplicationException("Fel uppstod i samband med att ny bokning skulle skapas."); } }
private void btnDeleteBooking_Click(object sender, EventArgs e) { //This code checks if a student id is selected before reading it to a local variable //It then passes that data to a method in a seperate class. if any errors are found they //will be caught by Try-Catch. if No ID selected User prompted to select a Student ID if (dgvViewBookings.CurrentCell.ColumnIndex == 1) { int x = int.Parse(dgvViewBookings.CurrentCell.Value.ToString()); try { BookingDAL.TerminateBooking(x); dgvViewBookings.Update(); } catch { add.showBalloonTip("Error", "Something Went Wrong"); } } else { add.showBalloonTip("Student ID", "Please Select a Student ID"); } }
/// <summary> /// Calls by user ID and User Email /// IncidenceDAL.incAllUserDelete(userID); /// BookingDAL.BookingAllUserDelete(user.Email); /// UserDAL.deleteUser(userID); /// to delete a user and all referances to the user in the database /// </summary> public static void userDelete(int userID) { UserModel user = new UserModel(); /// access user delete function /// user = getUserByID(userID); IncidenceDAL.incAllUserDelete(userID); BookingDAL.BookingAllUserDelete(user.Email); UserDAL.deleteUser(userID); /*bool success; * try * { * * return success = true; * } * catch * { * return success = false; * }*/ }
public static DataSet GetExportVoyagesWithPOL(int Vessel, int POLID) { return(BookingDAL.GetExportVoyagesWithPOL(Vessel, POLID)); }
public static DataSet GetExportMLVoyages(int Vessel) { return(BookingDAL.GetExportMLVoyages(Vessel)); }
/// <summary> /// Gets the bookingID by bookingModel (TableID) via BookingDAL.GetBookingIDByBookingModel(bookingModel) /// Returns bookingID /// </summary> public static int GetBookingIDByBookingModel(BookingModel bookingModel) { int bookingID = BookingDAL.GetBookingIDByBookingModel(bookingModel); return(bookingID); }
/// <summary> /// Searches booking table by booking ID via BookingDAL.CheckBooking(bookingID); /// returns BookingModel booking /// </summary> public static BookingModel SearchBookingByID(int bookingID) { BookingModel booking = BookingDAL.CheckBooking(bookingID); return(booking); }
//Souvik public static IBooking GetBookingByBookingId(int BookingId) { return(BookingDAL.GetBookingByBookingId(BookingId)); }
// Ta bort Booking public void DeleteBooking(int bookingId) { BookingDAL.DeleteBooking(bookingId); }
public static void startEmailWorker() { // main Email worker, searches for any bookings in the next hour // via the booking table, searches user, room and building tables for associated data // loops through each booking sending email notifications via NotifyBL List <BookingModel> groups = new List <BookingModel>(); groups = BookingDAL.loadBookingListattime(); // loops through each booking returned by BookingDAL.loadBookingListattime(); foreach (BookingModel booking in groups) { List <string> dataset1 = new List <string>(); string URL = "https://www.etabletap.com/UL/BookingReceipt.aspx?id=" + booking.bookingID; UserModel user = new UserModel(); TableModel table = new TableModel(); RoomModel room = new RoomModel(); BuildingModel building = new BuildingModel(); table = TableBL.GetTableByID(booking.tableID); user = UserBL.passUserSearch(booking.emailAddress); room = RoomBL.getRoomByID(table.RoomID); building = BuildingBL.getBuildingByID(room.BuildingID); // main user NotifyBL.startNotifyBooking(user.FirstName + " " + user.LastName, user.phoneNum, user.Email, table.TableID.ToString(), room.RoomName, building.BuildingName, booking.bookingDate.ToString(), booking.bookingHour.ToString() + ":00", URL); //booking member 1 try { NotifyBL.startNotifyBooking(user.FirstName + " " + user.LastName, user.phoneNum, booking.memberEmail1, table.TableID.ToString(), room.RoomName, building.BuildingName, booking.bookingDate.ToString(), booking.bookingHour.ToString() + ":00", URL); } catch { } // booking member 2 try { NotifyBL.startNotifyBooking(user.FirstName + " " + user.LastName, user.phoneNum, booking.memberEmail2, table.TableID.ToString(), room.RoomName, building.BuildingName, booking.bookingDate.ToString(), booking.bookingHour.ToString() + ":00", URL); } catch { } // groupmember 3 try { NotifyBL.startNotifyBooking(user.FirstName + " " + user.LastName, user.phoneNum, booking.memberEmail3, table.TableID.ToString(), room.RoomName, building.BuildingName, booking.bookingDate.ToString(), booking.bookingHour.ToString() + ":00", URL); } catch { } // booking member 4 try { NotifyBL.startNotifyBooking(user.FirstName + " " + user.LastName, user.phoneNum, booking.memberEmail4, table.TableID.ToString(), room.RoomName, building.BuildingName, booking.bookingDate.ToString(), booking.bookingHour.ToString() + ":00", URL); } catch { } // groupmember 5 try { NotifyBL.startNotifyBooking(user.FirstName + " " + user.LastName, user.phoneNum, booking.memberEmail5, table.TableID.ToString(), room.RoomName, building.BuildingName, booking.bookingDate.ToString(), booking.bookingHour.ToString() + ":00", URL); } catch { } } }
public static void UpdateBooking(IBooking Booking) { BookingDAL.UpdateBooking(Booking); }
public static string GetRefundPayableId(string RefundPayable) { return(BookingDAL.GetRefundPayableId(RefundPayable)); }
public static string GetBrokeragePayableId(string BrokeragePayable) { return(BookingDAL.GetBrokeragePayableId(BrokeragePayable)); }
public static DataTable GetSlotOperators() { return(BookingDAL.GetSlotOperators()); }
public static DataSet GetExportVoyages(int Vessel, int LocationID) { return(BookingDAL.GetExportVoyages(Vessel, LocationID)); }
public static DataSet GetExportServices(int Line, Int32 Fpod) { return(BookingDAL.GetExportServices(Line, Fpod)); }
public void CreateBooking(Booking b) { BookingDAL.CreateBooking(b); }
// Hämta ut alla bokningar fr tabellen Booking public IEnumerable <Booking> GetBookings() { return(BookingDAL.GetBookings()); }
public void DeleteBooking(Booking b) { BookingDAL.DeleteBooking(b); }
public BookingBL() { dal = new BookingDAL(); }
public static DataTable GetPortWithServices(int ServiceID, Int32 Lineid) { return(BookingDAL.GetPortWithServices(ServiceID, Lineid)); }