public void localizarProdutoDaVenda(int codigoCompra, int codigoProduto) { try { DataTable tab; objDAL = new vendaItensDAL(); tab = objDAL.localizarProdutoDaCompra(codigoCompra, codigoProduto); if (tab.Rows.Count > 0) { this.ven_codigo = int.Parse(tab.Rows[0]["ven_codigo"].ToString()); this.pro_codigo = int.Parse(tab.Rows[0]["pro_codigo"].ToString()); this.vi_quantidade = decimal.Parse(tab.Rows[0]["vi_quantidade"].ToString()); this.vi_valorUnitario = decimal.Parse(tab.Rows[0]["vi_valorUnitario"].ToString()); this.vi_subtotal = decimal.Parse(tab.Rows[0]["vi_subtotal"].ToString()); this.vi_desconto = decimal.Parse(tab.Rows[0]["vi_desconto"].ToString()); this.vi_percentual = decimal.Parse(tab.Rows[0]["vi_percentual"].ToString()); this.vi_mesGarantia = int.Parse(tab.Rows[0]["vi_MesGarantia"].ToString()); this.vi_tara = (tab.Rows[0]["vi_tara"].ToString()); } objDAL = null; } catch (Exception) { throw; } }
public void excluir() { try { objDAL = new vendaItensDAL(); objDAL.excluir(this.ven_codigo); objDAL = null; } catch (Exception) { throw; } }
public void alterar() { try { objDAL = new vendaItensDAL(); objDAL.alterar(this.ven_codigo, this.pro_codigo, this.vi_quantidade, this.vi_valorUnitario, this.vi_subtotal, this.vi_desconto, this.vi_percentual, this.vi_mesGarantia, this.vi_tara); objDAL = null; } catch (Exception) { throw; } }
public void localizar() { try { objDAL = new vendaItensDAL(); this.ven_codigo = objDAL.localizar(this.ven_codigo); objDAL = null; } catch (Exception) { throw; } }
public DataTable localizarEmTudo(String descricao) { try { DataTable tab; objDAL = new vendaItensDAL(); tab = objDAL.localizarEmTudo(descricao); objDAL = null; return(tab); } catch (Exception) { throw; } }
public DataTable localizarLeaveComRetorno(String descricao, String atributo) { try { DataTable tab; objDAL = new vendaItensDAL(); tab = objDAL.localizarLeaveComRetorno(descricao, atributo); objDAL = null; return(tab); } catch (Exception) { throw; } }
private void dgVendas_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { try { if (e.RowIndex > -1 && e.RowIndex < dgVendas.Rows.Count) { int cod = 0; cod = int.Parse(dgVendas.Rows[e.RowIndex].Cells[0].Value.ToString()); if (cod != 0) { vendaItensDAL vi = new vendaItensDAL(); DataTable tabItensVendaItens = null; tabItensVendaItens = vi.localizarLeaveID(cod); dgItensVendas.DataSource = tabItensVendaItens; vi = null; } } } catch (Exception ex) { MessageBox.Show(ex.Message, "Erro", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1); } }