public DltClienteVisual() { //Visual Cadastrar Nome de Locações this.Text = "Deletar Cliente"; //Inserindo titulo da página this.BackColor = Color.White; lblId = new LibsLabel("Informe o Id do cliente que deseja deletar:", new Point(20, 30), new Size(250, 30)); IEnumerable <Model.Cliente> clientes; try { clientes = Controller.Cliente.ListarClientes(); } catch (Exception error) { throw error; } List <string> comboClientes = new List <string>(); foreach (Model.Cliente item in clientes) { comboClientes.Add($"{item.Id} - {item.Nome}"); } string[] options = comboClientes.ToArray(); cbId = new LibsComboBox(new Point(20, 80), new Size(150, 80), options); //Criando botões btnConfirmar = new LibsButtons("Confirmar", new Point(18, 350), new Size(200, 30)); btnConfirmar.Click += new EventHandler(this.btnConfirmarClick); btnConfirmar.BackColor = Color.White; //Criando botões btnCancelar = new LibsButtons("Cancelar", new Point(230, 350), new Size(200, 30)); btnCancelar.Click += new EventHandler(this.btnCancelarClick); btnCancelar.BackColor = Color.White; pictureBox = new PictureBox(); pictureBox.Size = new Size(600, 600); pictureBox.Location = new Point(0, 0); pictureBox.Load("Images\\Logo_rent_vehicles.png"); pictureBox.SizeMode = PictureBoxSizeMode.Normal; this.Size = new Size(600, 450); //Trabalhando com o tamanho da janela this.Controls.Add(lblId); //Chamando e adicionando os métodos acima this.Controls.Add(cbId); this.Controls.Add(btnConfirmar); this.Controls.Add(btnCancelar); this.Controls.Add(pictureBox); }
public RemoverClientes() { this.Text = "Remover Loca"; lblId = new LibLabel("Selecione o cliente desejado para exclusão:", new Point(20, 30), new Size(250, 15)); IEnumerable <Model.Cliente> clientes; try { clientes = Controller.Cliente.ListarClientes(); } catch (Exception e) { throw e; } List <string> comboClientes = new List <string>(); foreach (Model.Cliente item in clientes) { comboClientes.Add($"{item.Id} - {item.Nome} - {item.DataNascimento} - {item.Cpf}"); } string[] options = comboClientes.ToArray(); comboId = new LibsComboBox(new Point(20, 50), new Size(370, 80), options); btnEcluirCliente = new LibButton("Salvar", new Point(50, 90), new Size(100, 40)); btnEcluirCliente.Click += new EventHandler(this.btnConfirmarClick); btnCancelar = new LibButton("Cancelar", new Point(150, 90), new Size(100, 40)); btnCancelar.Click += new EventHandler(this.botaoCancelar); this.Size = new Size(420, 180); this.Controls.Add(lblId); this.Controls.Add(comboId); this.Controls.Add(btnEcluirCliente); this.Controls.Add(btnCancelar); }
public RemoverLocacao() { this.Text = "Remover Locacao"; lblId = new LibLabel("Selecione a Locação desejada para exclusão:", new Point(20, 30), new Size(250, 15)); IEnumerable <Model.Locacao> locacoes; try { locacoes = Controller.Locacao.ListarLocacoes(); } catch (Exception e) { throw e; } List <string> comboLocacoes = new List <string>(); foreach (Model.Locacao item in locacoes) { comboLocacoes.Add($"{item.Id} - {item.DataLocacao}"); } string[] options = comboLocacoes.ToArray(); comboId = new LibsComboBox(new Point(20, 50), new Size(370, 80), options); btnEcluirLocacao = new LibButton("Salvar", new Point(50, 90), new Size(100, 40)); btnEcluirLocacao.Click += new EventHandler(this.btnConfirmarClick); btnCancelar = new LibButton("Cancelar", new Point(150, 90), new Size(100, 40)); btnCancelar.Click += new EventHandler(this.botaoCancelar); this.Size = new Size(420, 180); this.Controls.Add(lblId); this.Controls.Add(comboId); this.Controls.Add(btnEcluirLocacao); this.Controls.Add(btnCancelar); }
public RemoverVeiculoLeve() { this.Text = "Remover Veiculo Leve"; lblId = new LibLabel("Selecione o Veículo desejado para exclusão:", new Point(20, 30), new Size(250, 15)); IEnumerable <Model.VeiculoLeve> veiculosLeves; try { veiculosLeves = Controller.VeiculoLeve.ListarVeiculosLeves(); } catch (Exception e) { throw e; } List <string> comboVeiculosLeves = new List <string>(); foreach (Model.VeiculoLeve item in veiculosLeves) { comboVeiculosLeves.Add($"{item.Id} - {item.Marca} - {item.Modelo} - {item.Ano} - {item.Preco} - {item.Cor}"); } string[] options = comboVeiculosLeves.ToArray(); comboId = new LibsComboBox(new Point(20, 50), new Size(370, 80), options); btnEcluirVeiculoLeve = new LibButton("Salvar", new Point(50, 90), new Size(100, 40)); btnEcluirVeiculoLeve.Click += new EventHandler(this.btnConfirmarClick); btnCancelar = new LibButton("Cancelar", new Point(150, 90), new Size(100, 40)); btnCancelar.Click += new EventHandler(this.botaoCancelar); this.Size = new Size(420, 180); this.Controls.Add(lblId); this.Controls.Add(comboId); this.Controls.Add(btnEcluirVeiculoLeve); this.Controls.Add(btnCancelar); }
public CadLocacaoVisual() { this.AutoScroll = false; this.HorizontalScroll.Enabled = false; this.HorizontalScroll.Visible = false; this.HorizontalScroll.Maximum = 0; this.AutoScroll = true; //Visual Cadastrar Nome de Locações this.Text = "Cadastro de Locações"; //Inserindo titulo da página this.BackColor = Color.White; lblCliente = new LibsLabel("Cliente:", new Point(20, 15), new Size(110, 40)); IEnumerable <Model.Cliente> clientes; try { clientes = Controller.Cliente.ListarClientes(); } catch (Exception error) { throw error; } List <string> comboClientes = new List <string>(); foreach (Model.Cliente item in clientes) { comboClientes.Add($"{item.Id} - {item.Nome}"); } string[] options = comboClientes.ToArray(); cbCliente = new LibsComboBox(new Point(20, 60), new Size(200, 80), options); //Visual Cadastrar data de locação lblDataLocacao = new LibsLabel("Data de Locação:", new Point(20, 100), new Size(110, 40)); //txtDataLocacao = new LibsMaskedTextBox(new Point(20, 150), new Size(110, 80), "00/00/0000"); DateTime dtInicio = new DateTime(2021, 05, 11); calendarioLocacao = new LibsCalendarView(new Point(20, 150)); calendarioLocacao.MaxSelectionCount = 1; calendarioLocacao.MinDate = new DateTime(2021, 01, 01); calendarioLocacao.MaxDate = new DateTime(2025, 01, 01); calendarioLocacao.SelectionRange = new SelectionRange(dtInicio, new DateTime(2021, 01, 01)); lblveiculoLeves = new LibsLabel("Veiculo Leve:", new Point(20, 340), new Size(110, 40)); IEnumerable <Model.VeiculoLeve> veiculosLeves; try { veiculosLeves = Controller.VeiculoLeve.ListarVeicLeve(); } catch (Exception error) { throw error; } List <string> comboVeicLeve = new List <string>(); foreach (Model.VeiculoLeve item in veiculosLeves) { comboVeicLeve.Add($"{item.Id} - {item.Marca} - {item.Modelo} - {item.Ano} - {item.Cor}"); } string[] opt = comboVeicLeve.ToArray(); cbVeiculoLeves = new LibsCBBox(new Point(20, 400), new Size(200, 80), opt); lblveiculoPesados = new LibsLabel("Veiculo Pesado:", new Point(20, 470), new Size(110, 40)); IEnumerable <Model.VeiculoPesado> veiculoPesados; try { veiculoPesados = Controller.VeiculoPesado.ListarVeicPesado(); } catch (Exception error) { throw error; } List <string> comboVeicPesado = new List <string>(); foreach (Model.VeiculoPesado item in veiculoPesados) { comboVeicPesado.Add($"{item.Id} - {item.Marca} - {item.Modelo} - {item.Ano} - {item.Restricoes}"); } string[] opt1 = comboVeicPesado.ToArray(); cbVeiculoPesados = new LibsCBBox(new Point(20, 520), new Size(200, 80), opt1); //Visual Botão de confirmação //Criando botões btnConfirmar = new LibsButtons("Confirmar Cadastro", new Point(18, 570), new Size(200, 30)); btnConfirmar.Click += new EventHandler(this.btnConfirmarClick); btnConfirmar.BackColor = Color.White; //Criando botões btnCancelar = new LibsButtons("Cancelar", new Point(230, 570), new Size(200, 30)); btnCancelar.Click += new EventHandler(this.btnCancelarClick); btnCancelar.BackColor = Color.White; pictureBox = new PictureBox(); pictureBox.Size = new Size(600, 600); pictureBox.Location = new Point(0, 0); pictureBox.Load("Images\\Logo_rent_vehicles.png"); pictureBox.SizeMode = PictureBoxSizeMode.Normal; this.Size = new Size(600, 450); //Trabalhando com o tamanho da janela this.Controls.Add(lblCliente); //Chamando e adicionando os métodos acima this.Controls.Add(cbCliente); this.Controls.Add(lblDataLocacao); this.Controls.Add(calendarioLocacao); this.Controls.Add(lblveiculoLeves); this.Controls.Add(cbVeiculoLeves); this.Controls.Add(lblveiculoPesados); this.Controls.Add(cbVeiculoPesados); this.Controls.Add(btnConfirmar); this.Controls.Add(btnCancelar); this.Controls.Add(pictureBox); }