/// <summary> /// Método que lista todas os funcionários. /// </summary> /// <param name="lojaEnt">Objeto de Loja.</param> /// <param name="strings">Adicione Strings que serão postas na mesma coleção da consulta.</param> /// <returns></returns> public static IList<Funcionario> ListarPorLoja(Loja lojaEnt, ISession listSession, params String[] strings) { try { IList<Funcionario> ilista = new DAOFuncionario(listSession).ListarWhere("loja", lojaEnt, "ativo", true); IList<Funcionario> ilistaVendedorGeral = new DAOFuncionario(listSession).ListarWhere("loja", new Loja { idLoja = "geral" }); for(int i = 0; i < ilistaVendedorGeral.Count; i++) { ilista.Insert(i, new Funcionario { idVendedor = ilistaVendedorGeral[i].idVendedor, nome = ilistaVendedorGeral[i].nome }); } for (int i = 0; i < strings.Count<String>(); i++) { ilista.Insert(i, new Funcionario { nome = strings[i] }); } return ilista; } catch (GenericADOException gae) { MessageLogs.GenericADOExceptionLog(gae); return null; } }
public IList<Estoque> realizarPesquisa(Boolean produtoAtivoFlag, Boolean produtoInativoFlag, String idLoja) { IList<Estoque> Ilista = null; Loja lojaEnt = new Loja(); Produto produtoEnt = new Produto(); lojaEnt.idLoja = idLoja; if(produtoAtivoFlag && produtoInativoFlag) { Ilista = DAOEstoque.listarWhereCriteriaLoja(lojaEnt); } else { if (produtoAtivoFlag) { produtoEnt.ativo = true; } else { produtoEnt.ativo = false; } Ilista = DAOEstoque.listarWhereCriteriaProduto(lojaEnt, produtoEnt); } return Ilista; }
public void setLoja(Loja lojaEnt) { Boolean res = GerenciaArquivoBinario.EscreveEmArquivoBinario<Loja>(Path.Combine(diretorio, nomeArquivo), lojaEnt, FileMode.Create); if(res) { MessageBox.Show("Loja alterada com sucesso. Loja atual: " + lojaEnt.nome); } else { MessageBox.Show("Erro ao alterar loja."); } }
public Loja retornaLoja(DataGridViewRow row) { Loja lojaEnt = new Loja { idLoja = Convert.ToString(row.Cells["codigo"].Value), nome = Convert.ToString(row.Cells["nome"].Value), cnpj = Convert.ToString(row.Cells["cnpj"].Value), ativo = Convert.ToBoolean(row.Cells["ativo"].Value), endereco = new Endereco { idEndereco = Convert.ToString(row.Cells["codigo"].Value) } }; return lojaEnt; }
private void backGroundWorker_DoWork(object sender, DoWorkEventArgs e) { Loja lojaEnt = new Loja(); ArrayList arrayListCheckBoxOperacao = new ArrayList(); IList<object> argumentos = (IList<object>)e.Argument; lojaEnt.idLoja = Convert.ToString(argumentos[2]); foreach (CheckBox checkBox in this.groupBoxOperacao.Controls) { arrayListCheckBoxOperacao.Add(checkBox); } IList<MovEstoque> Ilista = DAOMovEstoque.ListarBetween(Convert.ToDateTime(argumentos[0]), Convert.ToDateTime(argumentos[1]), lojaEnt, arrayListCheckBoxOperacao); IsIlistaEmpty<MovEstoque>.isIlistaEmpty(Ilista); e.Result = Ilista; }
private void pesquisaProduto(DataGridView dgv, Loja lojaEnt) { Produto produtoEnt = new Produto(); String idProduto = txtCodProduto.Text; produtoEnt.idProduto = idProduto; IList<Estoque> Ilista = new DAO<Estoque>(listSession).ListarWhere("produto", produtoEnt, "loja", lojaEnt); IsIlistaEmpty<Estoque>.isIlistaEmpty(Ilista); dgv.DataSource = Ilista; }
public PesquisaPorCod(Produto produto, Loja loja, ISession listSession) { this.produtoEnt = produto; this.lojaEnt = loja; DAOEstoque = new DAOEstoque(listSession); }
private void reexecutaImpressao(Loja lojaEnt, ArrayList arrayListProdVenda, Venda vendaEnt) { if (resultado.Equals(DialogResult.Retry)) { imprimeNota(lojaEnt, arrayListProdVenda, vendaEnt); } }
public void imprimeNota(Loja lojaEnt, ArrayList arrayListProdVenda, Venda vendaEnt) { String szTexto = new String(' ', 4096); szTexto = "<ce>------------------------------------------</ce>\n"; szTexto += "<ce><n><b>VANDA CONFECÇÕES</b></n></ce>\n"; szTexto += "<ce><n><b>LOJA " + lojaEnt.nome + "</b></n></ce>\n"; if(lojaEnt.endereco.rua != String.Empty) { szTexto += "<ce>Rua " + lojaEnt.endereco.rua + "</ce>\n"; } szTexto += "<ce>" + lojaEnt.endereco.bairro + " - " + lojaEnt.endereco.cidade + ", " + lojaEnt.endereco.estado + "\n"; szTexto += "<ce>" + lojaEnt.endereco.cep + "</ce>\n"; if (lojaEnt.endereco.telefone != "") { szTexto += "<ce>Telefone: " + lojaEnt.endereco.telefone + "</ce>\n"; } szTexto += "<ce>------------------------------------------</ce>\n"; szTexto += "<ce>FUNCIONÁRIO: " + vendaEnt.VendedorNome + "</ce>\n"; szTexto += "<ce>VENDA EM: " + vendaEnt.VendaEm + "</ce>\n"; szTexto += "<ce><c>Código Venda: " + vendaEnt.idVenda + "</c></ce>\n"; szTexto += "<ce>------------------------------------------</ce>\n"; szTexto += "Ref.| Descrição | Qtd.| P. Un.<c>(R$)</c>| P. Total <c>(R$)</c>\n"; foreach(object obj in arrayListProdVenda) { if(obj.GetType() == typeof(Prod_Venda)) { Prod_Venda prodVenda = (Prod_Venda)obj; szTexto += prodVenda.ProdutoID + " | <c>" + prodVenda.ProdutoDescricao + "</c> | " + prodVenda.quantidade + " | " + prodVenda.ProdutoPrecoEmString + " | " + prodVenda.PrecoTotalEmString + "\n"; } } szTexto += "\n<ce>VALOR TOTAL (R$): " + vendaEnt.PrecoAposDescontoEmString + "</ce>\n"; szTexto += "<ce><c>PAGO EM CARTÃO (R$): " + vendaEnt.ValorCartaoEmString + " PAGO A VISTA (R$): " + vendaEnt.ValorAVistaEmString + "</c></ce>\n"; szTexto += "<ce><c>VALOR ENTREGUE (R$): " + vendaEnt.ValorEntregueEmString + " TROCO (R$): " + FormataEmReal.retornaEmReal((Convert.ToDouble(vendaEnt.valorEntregue) - Convert.ToDouble(vendaEnt.valorAVista)).ToString()) + "</c></ce>\n"; szTexto += "<ce><c>DESCONTO: " + vendaEnt.DescontoEmString + "</c></ce>\n\n"; szTexto += "<ce>------------------------------------------</ce>\n\n"; szTexto += "<ce>" + DateTime.Now + "</ce>"; retornoStatus = InterfaceEpsonNF.Le_Status(); resultado = DialogResult.Cancel; switch (retornoStatus) { case 0: resultado = MessageBox.Show("IMPRESSORA OFFLINE. CHEQUE AS CONEXÕES OU SE A IMPRESSORA ESTÁ LIGADA E TENTE NOVAMENTE.\nAPERTANDO EM 'CANCELAR' NÃO SERÁ IMPRESSO NENHUM TIPO DE COMPROVANTE PARA O CLIENTE.", "AVISO", MessageBoxButtons.RetryCancel, MessageBoxIcon.Error); reexecutaImpressao(lojaEnt, arrayListProdVenda, vendaEnt); break; case 5: MessageBox.Show("A IMPRESSORA POSSUI POUCO PAPEL. A IMPRESSÃO AINDA SERÁ REALIZADA.", "AVISO", MessageBoxButtons.OK, MessageBoxIcon.Information); break; case 9: resultado = MessageBox.Show("A TAMPA DA IMPRESSORA ESTÁ ABERTA. FECHE-A E TENTE NOVAMENTE.\nAPERTANDO EM 'CANCELAR' NÃO SERÁ IMPRESSO NENHUM TIPO DE COMPROVANTE PARA O CLIENTE.", "AVISO", MessageBoxButtons.RetryCancel); reexecutaImpressao(lojaEnt, arrayListProdVenda, vendaEnt); break; case 24: iRetorno = InterfaceEpsonNF.ImprimeTextoTag(szTexto); iRetorno = InterfaceEpsonNF.AcionaGuilhotina(1); break; case 32: resultado = MessageBox.Show("IMPRESSORA SEM PAPEL. POSICIONE UMA NOVA BOBINA E TENTE NOVAMENTE.\nAPERTANDO EM 'CANCELAR' NÃO SERÁ IMPRESSO NENHUM TIPO DE COMPROVANTE PARA O CLIENTE.", "AVISO", MessageBoxButtons.RetryCancel, MessageBoxIcon.Error); reexecutaImpressao(lojaEnt, arrayListProdVenda, vendaEnt); break; } }