private void Botton_Add_SesInfo_Click(object sender, EventArgs e) { BookingAppContext bc = new BookingAppContext(); Gymsession g = new Gymsession(); g.gid = TextB_SesID_SesInfo.Text; g.gtitle = TextB_Title_SesInfo.Text; g.gdate = Date_Time_Date_SesInfo.Text; g.gmax_spots = TextB_Spots_SesInfo.Text; g.ginstructor = TextB_Instructor_SesInfo.Text; try { bc.Gymsessions.Add(g); bc.SaveChanges(); } catch (Exception ex) { MessageBox.Show(ex.ToString(), "Varning det blev fel"); } /* * string cs = null; * SqlConnection cnn = new SqlConnection(cs); * SqlCommand cmd; * string sql = null; * * cs = "Data Source=LAPTOP-SCJU4H3Q;Initial Catalog=hatoca-inlamning;Integrated Security= SSPI;User ID=hatoca;Password=hatoca123;"; * * try * { * cnn.Open(); * cmd = new SqlCommand(sql, cnn); * cmd.ExecuteNonQuery(); * cmd.Dispose(); * cnn.Close(); * MessageBox.Show("ExecuteNonQuery in SqlCommand executed!!"); * } * catch (Exception ex) * { * MessageBox.Show("Could not open SqlConnection!");*/ }
public BusinessRepository(BookingAppContext context) { _context = context; }
public SeedData(BookingAppContext context) { _context = context; }
public EventRepository(BookingAppContext dataContext) { _dataContext = dataContext; }
public ReservationsController(IReservationRepository reservationRepository, IPricePerPeopleRepository pricePerPeopleRepository, ICustomerRepository customerRepository, IObjectForRentRepository objectForRentRepositorytory, BookingAppContext context) { _reservationRepository = reservationRepository; _objectForRentRepositorytory = objectForRentRepositorytory; _customerRepository = customerRepository; _pricePerPeopleRepository = pricePerPeopleRepository; GetObjectAndCustomersAsync(); }
public TicketRepository(BookingAppContext dataContext) { _dataContext = dataContext; }
public ScheduleRepository(BookingAppContext context) { _context = context; }
public UserRepository(BookingAppContext context) { _context = context; }
public CustomerRepository(BookingAppContext context) { _context = context; }
public ReservationRepository(BookingAppContext context) { _context = context; }
public PlaceRepository(BookingAppContext context) { _dataContext = context; }
public static int AvailableSeatCount(int eventId, BookingAppContext _dataContext) { return(_dataContext.SeatStatuses.Select(x => x.Available == true && x.EventId == eventId).Count()); }
public PricePerPeopleRepository(BookingAppContext context) { _context = context; }
public ObjectForRentRepository(BookingAppContext context) { _context = context; }