示例#1
0
        public static string ConsultarItensOrcamento(int iOrcamento)
        {
            //Criar objeto do tipo de classe "Negocio Orçamento"
            NegocioOrcamento negOrcamento = new NegocioOrcamento();

            //Criar variável do tipo datatable, para carregar os itens comprados
            DataTable dtRetorno = negOrcamento.ConsultarItensComprados(iOrcamento);

            //Criar a variavel para exibir os itens
            string sTabela = "<table id=\"tblItensCompra\" class=\"table table-bordered\"><thead><tr><th style=\"width:60px\">Código</th><th style=\"width:400px\">Nome</th><th style=\"width:200px\">Preço venda</th><th style=\"width:200px\">Estoque</th><th style=\"width:200px\">Peso</th></tr>";

            //verifica se a variavel datatable está preenchida
            if (dtRetorno.Rows.Count > 0)
            {
                //percorrer cada linha da variavel table
                foreach (DataRow item in dtRetorno.Rows)
                {
                    //criar uma linha na tabela
                    sTabela += "<tr>";
                    //percorrer as colunas da variavel table
                    for (int i = 0; i < item.ItemArray.Length; i++)
                    {
                        //adicionar a coluna na table
                        sTabela += "<td>" + item[i].ToString() + "</td>";
                    }
                    //fecha a linha da tabela
                    sTabela += "</tr>";
                }
            }
            //retorna a tabela preenchida
            return(sTabela += "</table>");
        }
示例#2
0
 public static string InserirItensOrcamento(int iOrcamento, int iProdutoID)
 {
     try
     {
         NegocioOrcamento negOrcamento = new NegocioOrcamento();
         negOrcamento.InserirItensOrcamento(iOrcamento, iProdutoID);
         return("OK");
     }
     catch (Exception erro)
     {
         return(erro.Message);
     }
 }
示例#3
0
 public static string ContinuarComprando()
 {
     try
     {
         NegocioOrcamento negOrcamento = new NegocioOrcamento();
         DataTable        dtRetorno    = negOrcamento.InserirOrcamento();
         if (dtRetorno.Rows.Count > 0)
         {
             return(dtRetorno.Rows[0][0].ToString());
         }
         else
         {
             return("Nenhum retorno esperado");
         }
     }
     catch (Exception erro)
     {
         return(erro.Message);
     }
 }