public View_Reserva() { InitializeComponent(); Alterar = false; reserva = new Reserva(); reserva.Usuario = Ctr_Usuario.UsuarioLogado; //reserva.Veiculo = new Veiculo() { ValorDia = 825.12 }; Ctr_Veiculo.DefinirVeiculo(new Veiculo()); Ctr_Local.DefinirLocal(new Local(), Local.Tipo.Destino); Ctr_Local.DefinirLocal(new Local(), Local.Tipo.Partida); dateTimePartida.MinDate = dateTimeRetorno.MinDate = DateTime.Now; reserva.DataHoraInicial = reserva.DataHoraFinal = DateTime.Now; this.dateTimePartida.ValueChanged += new System.EventHandler(this.dateTimePartida_ValueChanged); this.dateTimeRetorno.ValueChanged += new System.EventHandler(this.dateTimeRetorno_ValueChanged); }
private void buttonSelecionar_Click(object sender, EventArgs e) { Local Local = new Local(); Local.ID = Convert.ToInt16(listView1.SelectedItems[0].SubItems[0].Text); Local.Nome = listView1.SelectedItems[0].SubItems[1].Text; Local.Bairro = listView1.SelectedItems[0].SubItems[2].Text; Local.Cidade = listView1.SelectedItems[0].SubItems[3].Text; Local.Estado = listView1.SelectedItems[0].SubItems[4].Text; if (this.SelecionarParaReserva) { Ctr_Local.DefinirLocal(Local, Tipo); } else { View_Local view_Local = new View_Local(Local); view_Local.ShowDialog(); } this.Close(); }