public List<clsCuentaPorPagarDetalle> ConsultaDetalleCuentas() { try { List<clsCuentaPorPagarDetalle> lista = new List<clsCuentaPorPagarDetalle>(); CuentasPorPagarEntities ent = new CuentasPorPagarEntities(); var con = from w in ent.DeudaDet select w; foreach (var item in con) { clsCuentaPorPagarDetalle clase = new clsCuentaPorPagarDetalle(); clase._IdEmpresa = item.IdEmpresa; clase._NumCuentaPorPagar = item.NumCuentaPorPagar; clase._NumCuentaPorPagarDetalle = item.NumDetalleDeuda; clase._ValorLetra = item.ValorLetra; clase._FechaVencimiento = item.FechaVencimiento; clase._Estado = item.Estado; clase._numeroPagos = 0; clase._totalPagar = 0; clase._AutorizarPago = false; lista.Add(clase); } return lista; } catch (Exception) { return null; } }
public List<clsCuentaPorPagarDetalle> consultaDetalle(int ind) { try { List<clsCuentaPorPagarDetalle> lista = new List<clsCuentaPorPagarDetalle>(); CuentasPorPagarEntities ent = new CuentasPorPagarEntities(); var con = from w in ent.DeudaDet where w.NumCuentaPorPagar == ind select w; foreach (var item in con) { clsCuentaPorPagarDetalle clas = new clsCuentaPorPagarDetalle(); clas._IdEmpresa = item.IdEmpresa; clas._NumCuentaPorPagar = item.NumCuentaPorPagar; clas._NumCuentaPorPagarDetalle = item.NumDetalleDeuda; clas._ValorLetra = item.ValorLetra; clas._FechaVencimiento = item.FechaVencimiento; clas._Estado = item.Estado; lista.Add(clas); } return lista; } catch (Exception) { return null; } }
private List<clsCuentaPorPagarDetalle> GenerarDetallePagos(int tmp) { List<clsCuentaPorPagarDetalle> detalleDeuda = new List<clsCuentaPorPagarDetalle>(); DateTime fechita = Convert.ToDateTime(dtpFechaTransaccion.EditValue); for (int i = 0; i < Convert.ToInt32(txtNroLetras.Text); i++) { clsCuentaPorPagarDetalle pago = new clsCuentaPorPagarDetalle(); pago._IdEmpresa = 1; pago._NumCuentaPorPagar = Convert.ToInt32(txtNroCtaPag.Text); pago._NumCuentaPorPagarDetalle = i+1; pago._ValorLetra = Convert.ToDecimal(txtValorCadaLetra.Text); switch (tmp) { case 1: fechita = fechita.AddDays(1); break; case 2: fechita = fechita.AddDays(7); break; case 3: fechita = fechita.AddMonths(1); break; case 4: fechita = fechita.AddMonths(6); break; case 5: fechita = fechita.AddYears(1); break; } pago._FechaVencimiento = fechita; pago._Estado = 1; detalleDeuda.Add(pago); } return detalleDeuda; }