Example #1
0
 public DataTable localizarComRetorno(String descricao, String atributo)
 {
     try{
         DataTable tab;
         objDAL = new ProdutosDAL();
         tab    = objDAL.localizar(descricao, atributo);
         objDAL = null;
         return(tab);
     }
     catch (Exception) {
         throw;
     }
 }
Example #2
0
 public void localizar()
 {
     try
     {
         objDAL          = new ProdutosDAL();
         this.pro_codigo = objDAL.localizar(this.pro_codigo);
         objDAL          = null;
     }
     catch (Exception)
     {
         throw;
     }
 }
Example #3
0
        public void localizar(String descricao, String atributo)
        {
            try
            {
                DataTable tab;
                objDAL = new ProdutosDAL();

                tab = objDAL.localizar(atributo, descricao);
                if (tab.Rows.Count > 0)
                {
                    this.pro_codigo     = int.Parse(tab.Rows[0]["pro_codigo"].ToString());
                    this.pro_nome       = tab.Rows[0]["pro_nome"].ToString();
                    this.pro_quantidade = int.Parse(tab.Rows[0]["pro_quantidade"].ToString());
                    this.pro_precoCusto = Decimal.Parse(tab.Rows[0]["pro_precoCusto"].ToString());
                    this.pro_precoVenda = Decimal.Parse(tab.Rows[0]["pro_precoVenda"].ToString());
                    this.pro_categoria  = int.Parse(tab.Rows[0]["pro_categoria"].ToString());
                    if (tab.Rows[0]["pro_grupo"] != DBNull.Value)
                    {
                        this.pro_grupo = int.Parse(tab.Rows[0]["pro_grupo"].ToString());
                    }
                    else
                    {
                        this.pro_grupo = 0;
                    }
                    if (tab.Rows[0]["pro_subGrupo"] != DBNull.Value)
                    {
                        this.pro_subGrupo = int.Parse(tab.Rows[0]["pro_subGrupo"].ToString());
                    }
                    else
                    {
                        this.pro_subGrupo = 0;
                    }
                    if (tab.Rows[0]["pro_unidade"] != DBNull.Value)
                    {
                        this.pro_unidade = int.Parse(tab.Rows[0]["pro_unidade"].ToString());
                    }
                    else
                    {
                        this.pro_unidade = 0;
                    }
                    //this.pro_estoqueMin = int.Parse(tab.Rows[0]["   "].ToString());
                    //this.pro_estoqueMax = int.Parse(tab.Rows[0]["pro_estoqueMax"].ToString());
                    this.pro_dataCadastro = DateTime.Parse(tab.Rows[0]["pro_dataCadastro"].ToString());
                    if (tab.Rows[0]["pro_codigoBarra"] != DBNull.Value)
                    {
                        this.pro_codigoBarra = tab.Rows[0]["pro_codigoBarra"].ToString();
                    }
                    else
                    {
                        this.pro_codigoBarra = null;
                    }

                    try { this.pro_marca = int.Parse(tab.Rows[0]["pro_marca"].ToString()); }
                    catch { }
                    this.pro_fornecedor = int.Parse(tab.Rows[0]["pro_fornecedor"].ToString());

                    if (tab.Rows[0]["pro_tamanho"] != DBNull.Value)
                    {
                        this.pro_tamanho = int.Parse(tab.Rows[0]["pro_tamanho"].ToString());
                    }
                    else
                    {
                        this.pro_tamanho = 0;
                    }

                    if (tab.Rows[0]["pro_margem"] != DBNull.Value)
                    {
                        this.pro_margem = Decimal.Parse(tab.Rows[0]["pro_margem"].ToString());
                    }
                    else
                    {
                        this.pro_margem = 0;
                    }
                    //
                    //if (tab.Rows[0]["pro_comissao"] != DBNull.Value)
                    //    this.pro_comissao = Decimal.Parse(tab.Rows[0]["pro_comissao"].ToString());
                    //else
                    //    this.pro_comissao = 0;
                }
                objDAL = null;
            }
            catch (Exception)
            {
                throw;
            }
        }