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!");*/
        }
Beispiel #2
0
 public BusinessRepository(BookingAppContext context)
 {
     _context = context;
 }
Beispiel #3
0
 public SeedData(BookingAppContext context)
 {
     _context = context;
 }
Beispiel #4
0
 public EventRepository(BookingAppContext dataContext)
 {
     _dataContext = dataContext;
 }
Beispiel #5
0
 public ReservationsController(IReservationRepository reservationRepository, IPricePerPeopleRepository pricePerPeopleRepository, ICustomerRepository customerRepository, IObjectForRentRepository objectForRentRepositorytory, BookingAppContext context)
 {
     _reservationRepository       = reservationRepository;
     _objectForRentRepositorytory = objectForRentRepositorytory;
     _customerRepository          = customerRepository;
     _pricePerPeopleRepository    = pricePerPeopleRepository;
     GetObjectAndCustomersAsync();
 }
Beispiel #6
0
 public TicketRepository(BookingAppContext dataContext)
 {
     _dataContext = dataContext;
 }
Beispiel #7
0
 public ScheduleRepository(BookingAppContext context)
 {
     _context = context;
 }
Beispiel #8
0
 public UserRepository(BookingAppContext context)
 {
     _context = context;
 }
Beispiel #9
0
 public CustomerRepository(BookingAppContext context)
 {
     _context = context;
 }
 public ReservationRepository(BookingAppContext context)
 {
     _context = context;
 }
Beispiel #11
0
 public PlaceRepository(BookingAppContext context)
 {
     _dataContext = context;
 }
Beispiel #12
0
 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;
 }
Beispiel #14
0
 public ObjectForRentRepository(BookingAppContext context)
 {
     _context = context;
 }