Пример #1
0
        public GymTrainer(string firstName, string lastName, string startTime, int roomId)
        {
            GymTrainerFirstName = firstName;
            GymTrainerLastName  = lastName;

            TimeSpan trainerStartTime;

            try
            {
                trainerStartTime = new TimeSpan(Int32.Parse(startTime.Substring(0, 2)),
                                                Int32.Parse(startTime.Substring(3, 2)), Int32.Parse(startTime.Substring(6, 2)));
            }
            catch (Exception ex)
            {
                throw new Exception($"Inavlid start time.\n\n{ex.Message}");
            }

            GymTrainerTableAdapter trainerTableAdapter = new GymTrainerTableAdapter();

            trainerTableAdapter.Insert(GymTrainerFirstName, GymTrainerLastName, trainerStartTime, roomId);
        }
Пример #2
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            gymManagementSystemDatabaseDataSet = ((GymManagementSystemDatabaseDataSet)(this.FindResource("gymManagementSystemDatabaseDataSet")));
            roomTableAdapter                          = new GymRoomTableAdapter();
            trainerTableAdapter                       = new GymTrainerTableAdapter();
            customerTableAdapter                      = new GymCustomerTableAdapter();
            trainerWithRoomNameTableAdapter           = new GymTrainerWithRoomNameTableAdapter();
            equipmentWithRoomNameTableAdapter         = new GymEquipmentWithRoomNameTableAdapter();
            customerWithTrainerNameTableAdapter       = new GymCustomerWithTrainerNameTableAdapter();
            trainerFullNamesTableAdapter              = new GymTrainerFullNamesTableAdapter();
            customerWithExercisePlanTableAdapter      = new GymCustomerWithExercisePlanTableAdapter();
            customerWithoutExercisePlanTableAdapter   = new GymCustomerWithoutExercisePlanTableAdapter();
            gymScheduleAvailabilityTableAdapter       = new GymScheduleAvailabilityTableAdapter();
            allCustomersWithExercisePlanTableAdapter  = new AllGymCustomersWithExercisePlansTableAdapter();
            upcomingSchedulesByCustomerIdTableAdapter = new UpcomingSchedulesByCustomerIdTableAdapter();

            RefreshAllDataTables();
            MenuManagementView_Click(sender, e);
            // TODO: Add code here to load data into the table UpcomingSchedulesByCustomerId.
            // This code could not be generated, because the gymManagementSystemDatabaseDataSetUpcomingSchedulesByCustomerIdTableAdapter.Fill method is missing, or has unrecognized parameters.
            GymManagementSystem.GymManagementSystemDatabaseDataSetTableAdapters.UpcomingSchedulesByCustomerIdTableAdapter gymManagementSystemDatabaseDataSetUpcomingSchedulesByCustomerIdTableAdapter = new GymManagementSystem.GymManagementSystemDatabaseDataSetTableAdapters.UpcomingSchedulesByCustomerIdTableAdapter();
            System.Windows.Data.CollectionViewSource upcomingSchedulesByCustomerIdViewSource = ((System.Windows.Data.CollectionViewSource)(this.FindResource("upcomingSchedulesByCustomerIdViewSource")));
            upcomingSchedulesByCustomerIdViewSource.View.MoveCurrentToFirst();
        }