コード例 #1
0
        public List <ReporteFinanciero> getReporteByRut(string run)
        {
            List <ReporteFinanciero> list = ReporteFinancieroDAL.getReporteByRut(run);

            if (list.Count() == 0 || list == null)
            {
                throw new Exception("Usted no posee deudas hasta la fecha");
            }

            return(list);
        }
コード例 #2
0
        /// <summary>
        /// Procesa la carga de datos, alumnos y estados financieros
        /// </summary>
        /// <param name="list"></param>
        /// <param name="alumnos"></param>
        public void loadExcelList(List <ReporteFinanciero> list, List <string> alumnos)
        {
            if (list.Count() == 0 || list == null)
            {
                throw new Exception("Error al leer la planilla");
            }

            //Cada vez que se carga un reporte, se debe limpiar la base de datos
            ReporteFinancieroDAL.deleteAll();

            //Carga los usuarios que fueron separados del excel
            UsuarioAdministradorDAL.loadUsers(alumnos);

            //Procesa los cálculos
            foreach (ReporteFinanciero item in list)
            {
                item.montoInteres  = calcularInteres(item.montoCuota, getDiferenciaDias(item.fechaDocumento, item.fechaVencimiento));
                item.gastoCobranza = calcularGastoCobranza(getDiferenciaDiasAux(getDiferenciaDias(item.fechaDocumento, item.fechaVencimiento)), item.montoCuota);
                item.totalCuota    = calcularTotalDeuda(item.montoCuota, item.montoInteres, item.gastoCobranza);
                item.glosaCuota    = getGlosaEstadoCuota(item.fechaDocumento, item.fechaVencimiento);
            }

            ReporteFinancieroDAL.loadReports(list);
        }