private void MenuItemNFerramenta_Click(object sender, EventArgs e) { Ferramenta objFerramenta = new Ferramenta(); ManterFerramenta cadastroF = new ManterFerramenta("", objFerramenta, funcionario); cadastroF.ShowDialog(); funcionario = cadastroF.usuarioLogado; }
private void btnEditar_Click(object sender, EventArgs e) { if (objFerramenta == null) { new Mensagem("Selecione uma ferramenta \n primeiro!", "informacao", SGA.Properties.Resources.atencao).ShowDialog(); } else { ManterFerramenta telaDetalhes = new ManterFerramenta("Edicao", objFerramenta, usuarioLogado); telaDetalhes.ShowDialog(); usuarioLogado = telaDetalhes.usuarioLogado; pbxFerramenta.Image = null; objFerramenta = null; montarTela(); } }
private void btnNFerramenta_Click(object sender, EventArgs e) { if (tipoTela == "pesquisa") { Ferramenta ferr = new Ferramenta(); ManterFerramenta novaFerr = new ManterFerramenta("cadastro", ferr, usuarioLogado); novaFerr.ShowDialog(); usuarioLogado = novaFerr.usuarioLogado; pbxFerramenta.Image = null; } else { adicionarlistaFerr(); ferramentasSelecionadas = new List<Ferramenta>(); if (arrayFerramentasRequsicao.Count > 0) { this.DialogResult = DialogResult.OK; } else { new Mensagem("Selecione ao menos\n uma ferramenta para prosseguir!", "informacao", SGA.Properties.Resources.atencao).ShowDialog(); preencherListView(); } } montarTela(); }
private void btnDetalhes_Click_1(object sender, EventArgs e) { if (tipoTela == "pesquisa") { if (objFerramenta == null) { new Mensagem("Selecione uma ferramenta \n primeiro!", "informacao", SGA.Properties.Resources.atencao).ShowDialog(); } else { ManterFerramenta telaDetalhes = new ManterFerramenta("Detalhes", objFerramenta, usuarioLogado); telaDetalhes.ShowDialog(); usuarioLogado = telaDetalhes.usuarioLogado; pbxFerramenta.Image = null; objFerramenta = null; montarTela(); } } else { tipoLista = "selecionadas"; adicionarlistaFerr(); ferramentasSelecionadas = new List<Ferramenta>(); if (arrayFerramentasRequsicao.Count > 0) { listVFerramenta.Items.Clear(); foreach (Ferramenta ferr in arrayFerramentasRequsicao) { var item = new ListViewItem(new[] { ferr.codFerramenta, ferr.nomeFerramenta, ferr.codFabricante, ferr.codGrupo }); item.Checked = true; listVFerramenta.Items.Add(item); } } else { new Mensagem("Nenhuma ferramenta selecionada!", "informacao", SGA.Properties.Resources.atencao).ShowDialog(); preencherListView(); } } }