コード例 #1
0
        public List <FormatoDataSourceShow> CargarInforme(string tipofor)
        {
            List <FormatoDataSourceShow> formato = new List <FormatoDataSourceShow>();

            try
            {
                var items = this.persistencia.CargarInforme(tipofor);
                if (items != null)
                {
                    foreach (var item in items)
                    {
                        FormatoDataSourceShow format = new FormatoDataSourceShow();
                        format.Nombre        = item.nombref;
                        format.ClaseCuenta   = item.clasemayor;
                        format.Linea         = item.linea;
                        format.CuentaInicial = this.persistenciaCuenta.DevolverCuenta(item.cuentaini);
                        format.CuentaFinal   = this.persistenciaCuenta.DevolverCuenta(item.cuentafin);
                        formato.Add(format);
                    }
                }
                else
                {
                    formato = this.FormatoNull();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(formato);
        }
コード例 #2
0
        private List <FormatoDataSourceShow> FormatoNull()
        {
            List <FormatoDataSourceShow> cuenta = new List <FormatoDataSourceShow>();
            FormatoDataSourceShow        ds     = new FormatoDataSourceShow();

            ds.Nombre        = null;
            ds.Linea         = null;
            ds.ClaseCuenta   = null;
            ds.CuentaFinal   = null;
            ds.CuentaInicial = null;
            cuenta.Add(ds);
            return(cuenta);
        }