// TODO: Create a "misc" training session, containing all the available exercises. Use than then pick what they want public RecordWorkout(int id, string name, int clientIdSent) { InitializeComponent(); //this.WindowState = FormWindowState.Maximized; //this.FormBorderStyle = FormBorderStyle.None; sessionId = id; sessionName = name; clientId = clientIdSent; labelSessionName.Text = sessionName; ClientDataForm.GetDataFromDatabase("RecordWorkout", id); // ClientData.recordingExercisesTable = ClientData.sessionExercisesTable; dataGridViewExercises.DataSource = ClientDataForm.recordingExercisesTable; }
private void DisplaySessionExercieses(object sender, EventArgs e) { // When user picks a client, the form value will be blank, causing the catch block to be used. Else it'll use the try block try { int id = Convert.ToInt32(comboBoxAssignedTrainingSessions.SelectedValue); if (id == 0) { id = GetFirstIdFromDataTable(); } //ClientData.GetTrainingSessionExercises(id); ClientDataForm.GetDataFromDatabase("GetTrainingSessionExercises", id); dataGridViewSessionExercises.DataSource = ClientDataForm.sessionExercisesTable; } catch { } }
private void button1_Click(object sender, EventArgs e) { int id = Convert.ToInt32(comboBoxClientNames.SelectedValue); // Get the client info & display it on the form //ClientData.GetClientInfo(id); // Testing new method ClientDataForm.GetDataFromDatabase("ClientInfo", id); dataGridViewClientDetails.DataSource = ClientDataForm.clientDataResultsTable; // Get a list of training sessions assigned to the client ClientDataForm.GetDataFromDatabase("ClientTrainingSessions", id); dataGridViewTrainingSessions.DataSource = ClientDataForm.clientTrainingSessionsTable; // Populate the dropdown list with the sessions & the IDs comboBoxAssignedTrainingSessions.DataSource = ClientDataForm.clientTrainingSessionsTable; comboBoxAssignedTrainingSessions.DisplayMember = "Name"; comboBoxAssignedTrainingSessions.ValueMember = "id"; }