예제 #1
0
        protected void AssignWorkout_OnClick(object sender, EventArgs e)
        {
            trainee = tbll.GetTraineeById(Convert.ToInt32(Request.QueryString["TraineeID"]));

            trainee.WorkoutID = Convert.ToInt32(WorkoutDropdownList.SelectedItem.Value);

            tbll.EditTrainee(trainee);

            Response.Redirect("~/Trainees.aspx");
        }
예제 #2
0
        protected void AssignWorkoutButton_Click(object sender, EventArgs e)
        {
            if (Page.IsValid)
            {
                // this line prints an integer successfully
                WorkoutViewModel workout = workout_BLL.GetWorkoutById(Convert.ToInt32(ddlWorkouts.SelectedValue));
                TraineeViewModel trainee = trainee_BLL.GetTraineeById(Convert.ToInt32(Request.QueryString["TraineeID"]));
                trainee.WorkoutID = workout.WorkoutID;


                trainee_BLL.EditTrainee(trainee);

                Response.Redirect("~/Trainees.aspx");
            }
        }
예제 #3
0
 protected void TraineeEditButton_Click(object sender, EventArgs e)
 {
     //Check to see if all ValidationControls are valid
     if (Page.IsValid)
     {
         //Create new empty ViewModel to pass in the new values
         TraineeViewModel trainee = new TraineeViewModel();
         //Use the same query string to fill the ID
         trainee.TraineeID = Convert.ToInt32(Request.QueryString["TraineeID"]);
         trainee.FirstName = FirstName.Text;
         trainee.LastName  = LastName.Text;
         trainee.Email     = Email.Text;
         trainee.Height    = Convert.ToInt32(Height.Text);
         trainee.Weight    = Convert.ToInt32(Weight.Text);
         trainee.CellNbr   = CellNbr.Text;
         trainee.Gender    = Gender.SelectedValue;
         trainee.Age       = Convert.ToInt32(Age.Text);
         //Call the EditTrainee() method passing in the new values
         bll.EditTrainee(trainee);
         //Redirect to the Trainees.aspx page
         Response.Redirect("~/Trainees.aspx");
     }
 }