public List<clsCuentaPorPagar> consulta() { try { List<clsCuentaPorPagar> lista = new List<clsCuentaPorPagar>(); CuentasPorPagarEntities ent = new CuentasPorPagarEntities(); var con = from w in ent.CuentaPorPagar select w; foreach (var item in con) { clsCuentaPorPagar clas = new clsCuentaPorPagar(); clas._NumCuentaPorPagar = item.NumCuentaPorPagar; clas._NumIngresoEgreso = Convert.ToInt32(item.NumIngresoEgreso); clas._FechaIngreso = item.FechaIngreso; clas._Factura = item.NumeroFactura; clas._FechaTransaccion = item.FechaTransaccion; clas._IdProveedor = Convert.ToInt32(item.IdProveedor); clas._IdEmpresaServicio = item.IdEmpresaServicio; clas._Motivo = item.Motivo; clas._Detalle = item.Detalle; clas._Subtotal = item.Subtotal; clas._Descuento = Convert.ToDecimal(item.Descuento); clas._Total = item.Total; clas._FormaPago = item.FormaPago; clas._ValorEntrada = Convert.ToDecimal(item.ValorEntrada); clas._NumeroLetra = Convert.ToInt32(item.NumeroLetra); clas._IdFrecuencia = Convert.ToInt32(item.IdFrecuencia); clas._ValorLetra = Convert.ToDecimal(item.ValorLetra); clas._SaldoDeuda = Convert.ToDecimal(item.SaldoDeuda); clas._IdUsuario = item.IdUsuario; clas._IdEmpresa = item.IdEmpresa; lista.Add(clas); } return lista; } catch (Exception) { return null; } }
private void tsbConsultar_Click(object sender, EventArgs e) { frmConsultaCuentaPorPagar fr = new frmConsultaCuentaPorPagar(); fr.ShowDialog(); CuentaPorPagar = fr.ctaxpag; txtNroCtaPag.Text = Convert.ToString(CuentaPorPagar._NumCuentaPorPagar); dtpFechaIngreso.EditValue = CuentaPorPagar._FechaIngreso; txtNroFactura.Text = Convert.ToString(CuentaPorPagar._Factura); dtpFechaTransaccion.EditValue = CuentaPorPagar._FechaTransaccion; txtRucProveedor.Text = Convert.ToString(CuentaPorPagar._IdEmpresaServicio); txtMotivo.Text = CuentaPorPagar._Motivo; txtDetalle.Text = CuentaPorPagar._Detalle; //txtSubTotal.Text = Convert.ToString(CuentaPorPagar._Subtotal); //txtDescuento.Text = Convert.ToString(CuentaPorPagar._Descuento); //for (int i = 0; i < 2; i++) //{ // if (i == 0) // { // int a = CuentaPorPagar._ImpuestoCuenta[i]._IdImpuesto; // cbxImpuesto1.EditValue = a; // } // else // { // cbxImpuesto2.EditValue = CuentaPorPagar._ImpuestoCuenta[i]._IdImpuesto; // } //} txtTotal.Text = Convert.ToString(CuentaPorPagar._Total); if (CuentaPorPagar._FormaPago == Convert.ToString(1)) { rdbFormaPago.EditValue = 1; txtValorEntrada.Text = Convert.ToString(CuentaPorPagar._ValorEntrada); txtDeuda.Text = Convert.ToString(CuentaPorPagar._SaldoDeuda); txtNroLetras.Text = Convert.ToString(CuentaPorPagar._NumeroLetra); txtValorCadaLetra.Text = Convert.ToString(CuentaPorPagar._ValorLetra); } else { rdbFormaPago.EditValue = 0; } }
public void Modificar(clsCuentaPorPagar CuentaPorPagar) { }
public Boolean Guardar8(clsCuentaPorPagar CuentaPorPagar) { try { using (CuentasPorPagarEntities ent = new CuentasPorPagarEntities()) { CtaXPag = new CuentaPorPagar() { NumCuentaPorPagar = CuentaPorPagar._NumCuentaPorPagar, NumIngresoEgreso = CuentaPorPagar._NumIngresoEgreso, FechaIngreso = CuentaPorPagar._FechaIngreso, NumeroFactura = CuentaPorPagar._Factura, FechaTransaccion = CuentaPorPagar._FechaTransaccion, IdProveedor = CuentaPorPagar._IdProveedor, Motivo = CuentaPorPagar._Motivo, Detalle = CuentaPorPagar._Detalle, Subtotal = CuentaPorPagar._Subtotal, Total = CuentaPorPagar._Total, FormaPago = CuentaPorPagar._FormaPago, IdUsuario = CuentaPorPagar._IdUsuario, IdEmpresa = CuentaPorPagar._IdEmpresa, }; ent.AddToCuentaPorPagar(CtaXPag); ent.SaveChanges(); GuardarImpuestos(CuentaPorPagar._ImpuestoCuenta); } return true; } catch (Exception) { return false; } }
public Boolean Guardar2(clsCuentaPorPagar CuentaPorPagar) { try { using (CuentasPorPagarEntities ent = new CuentasPorPagarEntities()) { CtaXPag = new CuentaPorPagar() { NumCuentaPorPagar = CuentaPorPagar._NumCuentaPorPagar, FechaIngreso = CuentaPorPagar._FechaIngreso, NumeroFactura = CuentaPorPagar._Factura, FechaTransaccion = CuentaPorPagar._FechaTransaccion, IdEmpresaServicio = CuentaPorPagar._IdEmpresaServicio, Motivo = CuentaPorPagar._Motivo, Detalle = CuentaPorPagar._Detalle, Subtotal = CuentaPorPagar._Subtotal, Total = CuentaPorPagar._Total, FormaPago = CuentaPorPagar._FormaPago, ValorEntrada = CuentaPorPagar._ValorEntrada, NumeroLetra = CuentaPorPagar._NumeroLetra, IdFrecuencia = CuentaPorPagar._IdFrecuencia, ValorLetra = CuentaPorPagar._ValorLetra, SaldoDeuda = CuentaPorPagar._SaldoDeuda, IdUsuario = CuentaPorPagar._IdUsuario, IdEmpresa = CuentaPorPagar._IdEmpresa, }; ent.AddToCuentaPorPagar(CtaXPag); ent.SaveChanges(); GuardarDetCtaPorPagar(CuentaPorPagar._DetCredito); GuardarImpuestos(CuentaPorPagar._ImpuestoCuenta); } return true; } catch (Exception) { return false; } }
public Boolean Guardar0(clsCuentaPorPagar CuentaPorPagar) { Boolean a = false; if (CuentaPorPagar._IdProveedor == 0) { if (CuentaPorPagar._FormaPago == Convert.ToString('0')) { if (CuentaPorPagar._Descuento == 0) { a = Guardar4(CuentaPorPagar); } else { a = Guardar3(CuentaPorPagar); } } else if (CuentaPorPagar._FormaPago == Convert.ToString('1')) { if (CuentaPorPagar._Descuento == 0) { a = Guardar2(CuentaPorPagar); } else { a = Guardar1(CuentaPorPagar); } } } else { if (CuentaPorPagar._FormaPago == Convert.ToString('0')) { if (CuentaPorPagar._Descuento == 0) { a = Guardar8(CuentaPorPagar); } else { a = Guardar7(CuentaPorPagar); } } else if (CuentaPorPagar._FormaPago == Convert.ToString('1')) { if (CuentaPorPagar._Descuento == 0) { a = Guardar6(CuentaPorPagar); } else { a = Guardar5(CuentaPorPagar); } } } return a; }
public void Eliminar(clsCuentaPorPagar CuentaPorPagar) { using (CuentasPorPagarEntities ent = new CuentasPorPagarEntities()) { var x = (from q in ent.CuentaPorPagar where q.NumCuentaPorPagar == (CuentaPorPagar._NumCuentaPorPagar) select q).First(); ent.DeleteObject(x); ent.SaveChanges(); } }