private void btnLocar_Click(object sender, EventArgs e) { if (tBoxNome.Text != "" && tBoxCpf.Text != "" && tBoxRg.Text != "" && tBoxEndereco.Text != "" && tBoxRetirada.MaskCompleted && tBoxDevolucao.MaskCompleted && tBoxTelefone.MaskCompleted && cBoxPlano.Text != "" && cBoxPagamento.Text != "") { Aluguel novoAluguel = new Aluguel(); novoAluguel.clienteNome = tBoxNome.Text; novoAluguel.clienteRg = tBoxRg.Text; novoAluguel.clienteCpf = tBoxCpf.Text; novoAluguel.clienteEndereco = tBoxEndereco.Text; novoAluguel.clienteTelefone = tBoxTelefone.Text; novoAluguel.veiculo = txtModelo.Text; novoAluguel.veiculoCor = txtCor.Text; novoAluguel.veiculoPlaca = txtPlaca.Text; novoAluguel.plano = cBoxPlano.Text; novoAluguel.formaPagamendo = cBoxPagamento.Text; novoAluguel.dataRetirada = tBoxRetirada.Text; novoAluguel.dataDevolucao = tBoxDevolucao.Text; novoAluguel.alugadoPor = TelaInicial.contaLogada; ListAlugueis.Add(novoAluguel); clientes.SalvarExternamenteEmBanco(ListAlugueis); frota.ListVeiculos.Find(V => V.placa == novoAluguel.veiculoPlaca).status = false; frota.SalvarAoFechar(); frota.AtualizarTabela(); this.Close(); } else { MessageBox.Show("Preecha todos os campos"); } }
private void button1_Click(object sender, EventArgs e) { controleFrota.SalvarAoFechar(); FecharAplicativo(); }
private void btnFechar_Click(object sender, EventArgs e) { TelaControleFrota.SalvarAoFechar(); FecharAplicativo(); }