public ActionResult EditActivity(int activityID) { var activity = _activityManager.RetrieveActivityByID(activityID); ViewBag.ActivityTypeList = _activityManager.RetrieveAllActivityTypes(); ViewBag.Title = "Edit Activity"; return(View(activity)); }
// This helper method fills the text boxes with the information that is loaded into the _activity atribute of this class. private void fillTextBoxes() { populatePeopleAttendingList(); cmbActivityType.SelectedItem = _activity.ActivityTypeID; cmbActivityType.ItemsSource = _activityManager.RetrieveAllActivityTypes(); txtAddress1.Text = _activity.Address1; txtAddress2.Text = _activity.Address2; txtCity.Text = _activity.City; txtEnd.Text = _activity.End.ToShortDateString() + " " + _activity.End.ToShortTimeString(); txtActivityName.Text = _activity.ActivityName; txtLocation.Text = _activity.LocationName; txtStart.Text = _activity.Start.ToShortDateString() + " " + _activity.Start.ToShortTimeString(); txtState.Text = _activity.State; txtZip.Text = _activity.Zip; txtDescription.Text = _activity.Description; }