コード例 #1
0
        /// <summary> Inserta una cuenta de ahorro a futuro. </summary>
        /// <param name="tobjIngreso"> Un objeto del tipo ingreso. </param>
        /// <returns> Un string que indica si se ejecuto o no la operación. </returns>
        public string gmtdInsertar(tblEgreso tobjEgreso)
        {
            if (tobjEgreso.egresoEgreso != null)
            {
                for (int a = 0; a < tobjEgreso.egresoEgreso.Count; a++)
                {
                    tobjEgreso.egresoEgreso[a].strCodigoPar = new blOtroEgreso().gmtdConsultar(tobjEgreso.egresoEgreso[a].strCodOtrosEgresos).strCodigoPar;
                }
            }

            if (tobjEgreso.egresoAbonoaPrestamo != null)
            {
                tobjEgreso.egresoAbonoaPrestamo.strCodigoPar = "0001";
            }

            if (tobjEgreso.egresoAhorroalaVista != null)
            {
                tobjEgreso.egresoAhorroalaVista.strCodigoPar = "0001";
            }

            if (tobjEgreso.egresoAhorroEstudiantil != null)
            {
                tobjEgreso.egresoAhorroEstudiantil.strCodigoPar = "0001";
            }

            if (tobjEgreso.egresoAhorroFijo != null)
            {
                tobjEgreso.egresoAhorroFijo.strCodigoPar = "0001";
            }

            if (tobjEgreso.egresoIntereses != null)
            {
                tobjEgreso.egresoIntereses.strCodigoPar = "0001";
            }

            XmlDocument xml = blRecibosEgresos.SerializeServicio(tobjEgreso);

            string Resultado = new daoRecibosEgresos().gmtdInsertar(xml);

            if (Resultado == "0")
            {
                return("- Ha ocurrido un error al ingresar el egreso.");
            }
            else
            {
                return(Resultado + "+Egreso ingresado.");
            }
        }
コード例 #2
0
        /// <summary> Consulta los egresos activos de ahorros en un rango de fechas. </summary>
        /// <param name="tdtmFecha"> La fecha hasta la cual se quieren conocer los datos. </param>
        /// <param name="tintMeses"> Meses de los que se quieren conocer los datos.  </summary>
        /// <returns> Diccionario con los datos consultados. </returns>
        public Dictionary <string, string> gmtdConsultarEgresosdeAhorrosAgrupadosenunRangodeFechas(DateTime tdtmFecha, int tintMeses)
        {
            Dictionary <string, string> lstMeses = new Dictionary <string, string>();

            int intAño = tdtmFecha.Year;
            int intMes = tdtmFecha.Month;

            DateTime[] fechasInciales = new DateTime[tintMeses];
            DateTime[] fechasFinales  = new DateTime[tintMeses];

            for (int a = 0; a < tintMeses; a++)
            {
                if (intMes < 1)
                {
                    intMes  = 12;
                    intAño -= 1;
                }

                DateTime dtmFechaIni = Convert.ToDateTime(intAño.ToString() + "-" + intMes.ToString() + "-" + new blRecibosIngresos().pmtdMostrardiaInicial(intMes, true, intAño).ToString());
                DateTime dtmFechaFin = Convert.ToDateTime(intAño.ToString() + "-" + intMes.ToString() + "-" + new blRecibosIngresos().pmtdMostrardiaInicial(intMes, false, intAño).ToString());

                fechasInciales[a] = dtmFechaIni;
                fechasFinales[a]  = dtmFechaFin;

                intMes--;
            }

            for (int a = tintMeses - 1; a >= 0; a--)
            {
                decimal decValor = new daoRecibosEgresos().gmtdConsultarEgresosdeAhorrosAgrupadosenunRangodeFechas(fechasInciales[a], fechasFinales[a]);

                decimal decCreditos = 0; //new daoRecibosEgresos().gmtdConsultarEgresosporCreditosenunRangodeFechas(fechasInciales[a], fechasFinales[a]);

                decValor = decValor - decCreditos;

                lstMeses.Add(new blRecibosIngresos().pmtdNombreMes(fechasInciales[a].Month), decValor.ToString());
            }

            return(lstMeses);
        }