private void CargarGrilla(Int32 CodPrestamo) { Clases.cFunciones fun = new Clases.cFunciones(); Clases.cPagoIntereses pago = new Clases.cPagoIntereses(); DataTable trdo = pago.GetInteresesPagadosxCodPrestamo(CodPrestamo); trdo = fun.TablaaFechas(trdo, "Importe"); Grilla.DataSource = trdo; Grilla.Columns[0].Visible = false; }
private void btnGrabar_Click(object sender, EventArgs e) { Clases.cFunciones fun = new Clases.cFunciones(); if (fun.ValidarFecha(txtFechaPago.Text) == false) { MessageBox.Show("La fecha de pago es incorrecta", Clases.cMensaje.Mensaje()); return; } string Descripcion = "PAGO DE INTERÉS " + txtNombre.Text.ToString(); Int32 CodPrestamo = Convert.ToInt32(Principal.CodigoPrincipalAbm); DateTime Fecha = Convert.ToDateTime(txtFechaPago.Text); double Importe = fun.ToDouble(txtMontoApagar.Text); Clases.cMovimiento mov = new Clases.cMovimiento(); Clases.cPagoIntereses pago = new Clases.cPagoIntereses(); pago.RegistrarPago(CodPrestamo, Fecha, Importe); mov.RegistrarMovimientoDescripcion(-1, Principal.CodUsuarioLogueado, -1 * Importe, 0, 0, 0, 0, Fecha, Descripcion); MessageBox.Show("Datos grabados correctamente", Clases.cMensaje.Mensaje()); CargarGrilla(CodPrestamo); }
private void btnEliminar_Click(object sender, EventArgs e) { Clases.cFunciones fun = new Clases.cFunciones(); if (Grilla.CurrentRow == null) { MessageBox.Show("Debe seleccionar un registro para continuar", Clases.cMensaje.Mensaje()); return; } if (fun.ValidarFecha(txtFechaPago.Text) == false) { MessageBox.Show("La fecha de Pago Ingresada es incorrecta", Clases.cMensaje.Mensaje()); return; } string msj = "Confirma eliminar el Pago "; var result = MessageBox.Show(msj, "Información", MessageBoxButtons.YesNo, MessageBoxIcon.Question); // If the no button was pressed ... if (result == DialogResult.No) { return; } DateTime Fecha = Convert.ToDateTime(txtFechaPago.Text); Int32 CodPago = Convert.ToInt32(Grilla.CurrentRow.Cells[0].Value); double Importe = fun.ToDouble(Grilla.CurrentRow.Cells[2].Value.ToString()); Clases.cPagoIntereses Pago = new Clases.cPagoIntereses(); Pago.BorrarPago(CodPago); string Descripcion = "ANULACION PAGO " + txtNombre.Text; Clases.cMovimiento mov = new Clases.cMovimiento(); mov.RegistrarMovimientoDescripcion(-1, Principal.CodUsuarioLogueado, Importe, 0, 0, 0, 0, Fecha, Descripcion); MessageBox.Show("Datos grabados correctamente", Clases.cMensaje.Mensaje()); }
private void btnBuscar_Click(object sender, EventArgs e) { Clases.cFunciones fun = new Clases.cFunciones(); if (fun.ValidarFecha(txtFechaDesde.Text) == false) { MessageBox.Show("Fecha desde incorrecta", Clases.cMensaje.Mensaje()); return; } if (fun.ValidarFecha(txtFechaHasta.Text) == false) { MessageBox.Show("Fecha hasta incorrecta", Clases.cMensaje.Mensaje()); return; } if (Convert.ToDateTime(txtFechaDesde.Text) > Convert.ToDateTime(txtFechaHasta.Text)) { MessageBox.Show("La fecha desde debe ser inferior a la fecha hasta", Clases.cMensaje.Mensaje()); return; } DateTime FechaDesde = Convert.ToDateTime(txtFechaDesde.Text); DateTime FechaHasta = Convert.ToDateTime(txtFechaHasta.Text); Clases.cPagoIntereses pago = new Clases.cPagoIntereses(); DataTable trdo = pago.GetPagosInteresxFecha(FechaDesde, FechaHasta); txtTotal.Text = fun.TotalizarColumna(trdo, "Importe").ToString(); if (txtTotal.Text != "") { txtTotal.Text = fun.SepararDecimales(txtTotal.Text); txtTotal.Text = fun.FormatoEnteroMiles(txtTotal.Text); } trdo = fun.TablaaMiles(trdo, "Importe"); Grilla.DataSource = trdo; Grilla.Columns[0].Width = 630; }
private void GetGanancia() { Clases.cFunciones fun = new Clases.cFunciones(); Clases.cVenta objVenta = new Clases.cVenta(); Clases.cPunitorioCobranza objPunitorioCobranza = new Clases.cPunitorioCobranza(); Clases.cPunitorioCuota objPunitorioCuota = new Clases.cPunitorioCuota(); DateTime FechaDesde = Convert.ToDateTime(txtFechaDesde.Text); DateTime FechaHasta = Convert.ToDateTime(txtFechaHasta.Text); DataTable trdo = objVenta.GetVentasxFecha(FechaDesde, FechaHasta, "", null); Clases.cPreVenta objPreVenta = new Clases.cPreVenta(); DataTable trdo2 = objPreVenta.GetPreVentasxFecha(FechaDesde, FechaHasta, "", null); //le agre[g string Dato = ""; Int32 PosPintar = 0; PosPintar = trdo.Rows.Count; for (int i = 0; i < trdo2.Rows.Count; i++) { DataRow fila; fila = trdo.NewRow(); for (int j = 0; j < trdo2.Columns.Count; j++) { Dato = trdo2.Rows[i][j].ToString(); fila[j] = Dato; } trdo.Rows.Add(fila); } Clases.cPunitorioCuotasAnteriores objPunDocAnt = new Clases.cPunitorioCuotasAnteriores(); Int32 Cant = trdo.Rows.Count; txtCantidad.Text = Cant.ToString(); trdo = fun.TablaaMiles(trdo, "ImporteVenta"); trdo = fun.TablaaMiles(trdo, "ImporteEfectivo"); trdo = fun.TablaaMiles(trdo, "ImporteAutoPartePago"); trdo = fun.TablaaMiles(trdo, "ImporteCredito"); trdo = fun.TablaaMiles(trdo, "ImportePrenda"); trdo = fun.TablaaMiles(trdo, "Cheque"); trdo = fun.TablaaMiles(trdo, "ImporteCobranza"); trdo = fun.TablaaMiles(trdo, "Ganancia"); double Utilidad = fun.TotalizarColumna(trdo, "Ganancia"); Double ImportePunitorioCobranza = objPunitorioCobranza.GetImportexFecha(FechaDesde, FechaHasta); Double ImportePunitorioCuota = objPunitorioCuota.GetImportexFecha(FechaDesde, FechaHasta); Double ImportePunitorioCuotasAnterioes = objPunDocAnt.GetImportexFecha(FechaDesde, FechaHasta); Double TotalPunitorio = ImportePunitorioCobranza + ImportePunitorioCuota + ImportePunitorioCuotasAnterioes; txtUtilidad.Text = fun.TotalizarColumna(trdo, "Ganancia").ToString(); txtUtilidad.Text = fun.FormatoEnteroMiles(txtUtilidad.Text); Clases.cGastosNegocio gastos = new Clases.cGastosNegocio(); double TotalGastos = gastos.GetGastosNegocioxFecha(FechaDesde, FechaHasta); txtGastos.Text = fun.SepararDecimales(TotalGastos.ToString()); txtGastos.Text = fun.FormatoEnteroMiles(txtGastos.Text); Clases.cPagoIntereses objpago = new Clases.cPagoIntereses(); double TotalPago = objpago.GetResumenPagosInteresesxFecha(FechaDesde, FechaHasta); txtInteresesPagados.Text = fun.SepararDecimales(TotalPago.ToString()); txtInteresesPagados.Text = fun.FormatoEnteroMiles(txtInteresesPagados.Text); double InteresesGanados = 0; Clases.cCuotasAnteriores cuotasAnt = new Clases.cCuotasAnteriores(); Clases.cCuota cuota = new Clases.cCuota(); InteresesGanados = cuota.GetGanaciaCobroCuotas(FechaDesde, FechaHasta); InteresesGanados = InteresesGanados + cuotasAnt.GetGanaciaCobroCuotas(FechaDesde, FechaHasta); txtInteresesGanados.Text = InteresesGanados.ToString(); txtInteresesGanados.Text = fun.FormatoEnteroMiles(txtInteresesGanados.Text); double Ganancia = Utilidad + TotalPunitorio - TotalPago - TotalGastos + InteresesGanados; txtResultado.Text = fun.SepararDecimales(Ganancia.ToString()); txtResultado.Text = fun.FormatoEnteroMiles(txtResultado.Text); txtPunitorio.Text = TotalPunitorio.ToString(); txtPunitorio.Text = fun.FormatoEnteroMiles(txtPunitorio.Text); }