//Cadastro do participante no banco protected void Save(object sender, DirectEventArgs e) { MA_PARTICIPANTE_HOBBIE hobbieparticipante = new MA_PARTICIPANTE_HOBBIE(); hobbieparticipante.cod_participante = Int32.Parse(cod_participanteId.SelectedItem.Value); hobbieparticipante.cod_item = Int32.Parse(cod_itemId.SelectedItem.Value); hobbieparticipante.cod_status = Int32.Parse(cod_statusId.SelectedItem.Value); //Caso o form não possui código, será inserido um novo hobbie de participante if (cod_p_hobbieId.Text == "") { this.GestorDeHobbieDeParticipante.InserirNovoParticipanteHobbie(hobbieparticipante); ParticipanteHobbieWindowId.Close(); LimpaForm(); } //Caso contrário, o form será atualizado else { hobbieparticipante.cod_p_hobbie = Int32.Parse(cod_p_hobbieId.Text); this.GestorDeHobbieDeParticipante.AtualizarHobbieDoParticipante(hobbieparticipante); ParticipanteHobbieWindowId.Close(); LimpaForm(); } }
//Inicializa a tela de cadastro de hobbie de participante protected void Add(object sender, DirectEventArgs e) { ParticipanteHobbieWindowId.Show(); }