private void CarregarProduto() { textBox_nome.Text = ArquivoEstoque.ListaProdutos[Index].Nome; textBox_id.Text = Id.ToString(ArquivoEstoque.ListaProdutos[Index]._id); textBox_quantidade.Text = ArquivoEstoque.ListaProdutos[Index].Quantidade.ToString(); textBox_preco.Text = ArquivoEstoque.ListaProdutos[Index].Preco.ToString("F2"); textBox_descricao.Text = ArquivoEstoque.ListaProdutos[Index].Descricao; pictureBox_imagem.BackgroundImage = Imagem.Carregar(@"Arquivos\Imagens\Estoque\" + Id.ToString(ArquivoEstoque.ListaProdutos[Index]._id) + ".png"); string categoria = ArquivoEstoque.ListaProdutos[Index].Categoria; switch (categoria) { case "Alimentos": comboBox_categoria.SelectedIndex = 0; break; case "Higiene pessoal": comboBox_categoria.SelectedIndex = 1; break; case "Hortifruti": comboBox_categoria.SelectedIndex = 2; break; case "Limpeza": comboBox_categoria.SelectedIndex = 3; break; default: comboBox_categoria.SelectedIndex = 4; break; } }
private void CarregarProduto() { textBox_nome.Text = ArquivoEstoque.ListaProdutos[Index].Nome; textBox_id.Text = ArquivoEstoque.ListaProdutos[Index].ID; textBox_quantidade.Text = ArquivoEstoque.ListaProdutos[Index].Quantidade.ToString(); textBox_preco.Text = ArquivoEstoque.ListaProdutos[Index].Preco.ToString("F2"); textBox_descricao.Text = ArquivoEstoque.ListaProdutos[Index].Descricao; pictureBox_imagem.BackgroundImage = Imagem.Carregar(@"Arquivos\Imagens\Estoque\" + ArquivoEstoque.ListaProdutos[Index].ID + ".png"); if (ArquivoEstoque.ListaProdutos[Index].Categoria == "Alimentos") { comboBox_categoria.SelectedIndex = 0; } else if (ArquivoEstoque.ListaProdutos[Index].Categoria == "Higiene pessoal") { comboBox_categoria.SelectedIndex = 1; } else if (ArquivoEstoque.ListaProdutos[Index].Categoria == "Hortifruti") { comboBox_categoria.SelectedIndex = 2; } else if (ArquivoEstoque.ListaProdutos[Index].Categoria == "Limpeza") { comboBox_categoria.SelectedIndex = 3; } else if (ArquivoEstoque.ListaProdutos[Index].Categoria == "Outros") { comboBox_categoria.SelectedIndex = 4; } }
double CarregarProduto(IProduto produto, ref double quantidade) { double preco = 0; string caminhoImagem = @"Arquivos\Imagens\Estoque\" + produto.ID + ".png"; pictureBoxProduto.Image = Imagem.Carregar(caminhoImagem); labelNome.Text = produto.Nome; if (produto.TipoVenda == "Quilo") { QuantidadeQuilo quantidadeQuilo = new QuantidadeQuilo(); quantidadeQuilo.ShowDialog(); quantidade = quantidadeQuilo.Peso; preco = produto.Preco * quantidade; labelPreco.Text = "Preço: R$ " + preco.ToString("F2"); } else if (produto.TipoVenda == "Unidade") { labelPreco.Text = "Preço: R$ " + produto.Preco.ToString("F2"); preco = produto.Preco; } try //Gerar código de barras do produto { Zen.Barcode.CodeEan13BarcodeDraw brCode = Zen.Barcode.BarcodeDrawFactory.CodeEan13WithChecksum; pictureBoxCodigoBarras.Image = brCode.Draw(produto.ID, 60, 20); } catch { } return(preco); }
private void LimparComponentes() { lb_valorTotal.Text = "R$ 0,00"; lb_dataCadastro.Text = "00/00/0000"; textBox_descricao.Text = ""; pictureBox_produto.Image = Imagem.Carregar(""); pictureBox_categoria.Image = Imagem.Carregar(""); }
private void LimparComponentes() { pictureBoxFornecedor.Image = Imagem.Carregar(""); labelFornecedor.Text = ""; labelTelefone.Text = ""; labelEmail.Text = ""; pictureBoxCategoria.Image = Imagem.Carregar(""); }
private void AbrirImagem() { OpenFileDialog abrirImagem = new OpenFileDialog(); abrirImagem.Filter = "Image files (*.jpg, *.jpeg, *.jpe, *.jfif, *.png) | *.jpg; *.jpeg; *.jpe; *.jfif; *.png"; abrirImagem.Title = "Selecione uma imagem para o produto."; if (abrirImagem.ShowDialog() == DialogResult.OK) { ImagemEntrada = abrirImagem.FileName; pictureBox_Imagem.BackgroundImage = Imagem.Carregar(abrirImagem.FileName); } }
void CarregarProdutoTabela() { int index = 0; string categoria; if (listView_estoque.SelectedItems.Count > 0) { ListViewItem selItem = listView_estoque.SelectedItems[0]; index = selItem.Index; lb_valorTotal.Text = "R$ " + (ArquivoEstoque.ListaProdutos[index].Preco * ArquivoEstoque.ListaProdutos[index].Quantidade).ToString("F2"); lb_dataCadastro.Text = ArquivoEstoque.ListaProdutos[index].DataCadastro.ToString(); textBox_descricao.Text = ArquivoEstoque.ListaProdutos[index].Descricao; pictureBox_produto.Image = Imagem.Carregar(@"Arquivos\Imagens\Estoque\" + Id.ToString(ArquivoEstoque.ListaProdutos[index]._id) + ".png"); categoria = ArquivoEstoque.ListaProdutos[index].Categoria; switch (categoria) { case "Alimentos": pictureBox_categoria.Image = Imagem.Carregar(@"Arquivos\Imagens\Categorias\alimentos.png"); break; case "Limpeza": pictureBox_categoria.Image = Imagem.Carregar(@"Arquivos\Imagens\Categorias\limpeza.png"); break; case "Higiene pessoal": pictureBox_categoria.Image = Imagem.Carregar(@"Arquivos\Imagens\Categorias\higienePessoal.png"); break; case "Hortifruti": pictureBox_categoria.Image = Imagem.Carregar(@"Arquivos\Imagens\Categorias\hortifruti.png"); break; default: pictureBox_categoria.Image = Imagem.Carregar(@"Arquivos\Imagens\Categorias\outros.png"); break; } try //Gerar código de barras do produto { Zen.Barcode.CodeEan13BarcodeDraw brCode = Zen.Barcode.BarcodeDrawFactory.CodeEan13WithChecksum; pB_codigoBarras.Image = brCode.Draw(Id.ToString(ArquivoEstoque.ListaProdutos[index]._id), 60, 20); } catch { } } }
void CarregarProduto(IProduto produto) { string caminhoImagem = @"Arquivos\Imagens\Estoque\" + Id.ToString(produto._id) + ".png"; pictureBoxProduto.Image = Imagem.Carregar(caminhoImagem); labelNome.Text = produto.Nome; labelPreco.Text = "Preço Uni/Kg: R$ " + produto.Preco.ToString("F2"); labelImposto.Text = (produto.Imposto * 100).ToString("F2") + "%"; try //Gerar código de barras do produto { Zen.Barcode.CodeEan13BarcodeDraw brCode = Zen.Barcode.BarcodeDrawFactory.CodeEan13WithChecksum; pictureBoxCodigoBarras.Image = brCode.Draw(Id.ToString(produto._id), 60, 20); } catch { } }
private void CarregarFornecedor() { ImagemEntrada = @"Arquivos\Imagens\Fornecedores\" + ArquivoFornecedores.ListaFornecedores[Index].NumeroDeCadastro + ".png"; ImagemSaida = @"Arquivos\Imagens\Fornecedores\" + ArquivoFornecedores.ListaFornecedores[Index].NumeroDeCadastro + ".png"; textBoxNome.Text = ArquivoFornecedores.ListaFornecedores[Index].Nome; TextBoxCNPJ.Text = ArquivoFornecedores.ListaFornecedores[Index].ID; TextBoxCEP.Text = ArquivoFornecedores.ListaFornecedores[Index].CEP; TextBoxTelefone.Text = ArquivoFornecedores.ListaFornecedores[Index].Telefone; textBoxEmail.Text = ArquivoFornecedores.ListaFornecedores[Index].Email; pictureBoxImagem.BackgroundImage = Imagem.Carregar(@"Arquivos\Imagens\Fornecedores\" + ArquivoFornecedores.ListaFornecedores[Index].NumeroDeCadastro + ".png"); comboBoxCategoria.Items.Insert(0, "Categoria"); comboBoxCategoria.SelectedIndex = 0; comboBoxUF.SelectedIndex = 0; }
void CarregarProdutoTabela() { int index = 0; if (listViewFornecedores.SelectedItems.Count > 0) { ListViewItem selItem = listViewFornecedores.SelectedItems[0]; index = selItem.Index; pictureBoxFornecedor.Image = Imagem.Carregar(@"Arquivos\Imagens\Fornecedores\" + ArquivoFornecedores.ListaFornecedores[index].NumeroDeCadastro + ".png"); labelFornecedor.Text = ArquivoFornecedores.ListaFornecedores[index].Nome.ToUpper(); labelTelefone.Text = ArquivoFornecedores.ListaFornecedores[index].Telefone; labelEmail.Text = ArquivoFornecedores.ListaFornecedores[index].Email; if (ArquivoFornecedores.ListaFornecedores[index].Categoria == "Alimentos") { pictureBoxCategoria.Image = Imagem.Carregar(@"Arquivos\Imagens\Categorias\alimentos.png"); } else if (ArquivoFornecedores.ListaFornecedores[index].Categoria == "Limpeza") { pictureBoxCategoria.Image = Imagem.Carregar(@"Arquivos\Imagens\Categorias\limpeza.png"); } else if (ArquivoFornecedores.ListaFornecedores[index].Categoria == "Higiene pessoal") { pictureBoxCategoria.Image = Imagem.Carregar(@"Arquivos\Imagens\Categorias\higienePessoal.png"); } else if (ArquivoFornecedores.ListaFornecedores[index].Categoria == "Hortifruti") { pictureBoxCategoria.Image = Imagem.Carregar(@"Arquivos\Imagens\Categorias\hortifruti.png"); } else if (ArquivoFornecedores.ListaFornecedores[index].Categoria == "Outros") { pictureBoxCategoria.Image = Imagem.Carregar(@"Arquivos\Imagens\Categorias\outros.png"); } } }