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