private void listViewEvent_MouseClick(object sender, MouseEventArgs e) { ListViewItem listItem = listViewEvent.SelectedItems[0]; String name = listItem.SubItems[0].Text; String description = listItem.SubItems[1].Text; String localidad = listItem.SubItems[2].Text; String fecha = listItem.SubItems[3].Text; int n_participantes = Convert.ToInt16(listItem.SubItems[4].Text); int n_maxParticipantes = Convert.ToInt16(listItem.SubItems[5].Text); String type = listItem.SubItems[6].Text; int id_user = Convert.ToInt16(listItem.SubItems[7].Text); InfoEvents infoEvents = new InfoEvents(name, description, localidad, fecha, n_participantes, n_maxParticipantes, type, id_user, user.Id); infoEvents.ShowDialog(); }
/// <summary> /// Collect the data of the event that we select to display it later in the following window /// When the window is opened later it closes, if there is any modification of any event update /// the listView /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void listViewEvent_MouseClick(object sender, MouseEventArgs e) { ListViewItem listItem = listViewEvent.SelectedItems[0]; String name = listItem.SubItems[0].Text; String description = listItem.SubItems[1].Text; String city = listItem.SubItems[2].Text; String direction = listItem.SubItems[3].Text; String date = listItem.SubItems[4].Text; String time = listItem.SubItems[5].Text; String duration = listItem.SubItems[6].Text; int n_participants = Convert.ToInt32(listItem.SubItems[7].Text); int n_maxParticipants = Convert.ToInt32(listItem.SubItems[8].Text); String type = listItem.SubItems[9].Text; String mood = listItem.SubItems[10].Text; int id_user = Convert.ToInt32(listItem.SubItems[11].Text); int id_event = Convert.ToInt32(listItem.SubItems[12].Text); InfoEvents infoEvents = new InfoEvents(id_event, name, description, city, direction, date, time, duration, n_participants, n_maxParticipants, type, mood, id_user, user); infoEvents.ShowDialog(); updateListView(); }