Exemplo n.º 1
0
        public IActionResult GetCodes([FromRoute] int id, [FromQuery] int page)
        {
            var sql      = new SQL(_config.GetConnectionString("SQLConnnection"));
            var pageSize = Convert.ToInt32(_config.GetSection("Pagination")["PageNumber"]);
            var alphabet = _config.GetSection("Base26")["Alphabet"];

            var codes = sql.GetCodes(id, alphabet, page, pageSize);
            var pages = sql.PageCount(id);


            return(Ok(new TableData(codes, pages, page)));
        }
        public IActionResult GetCodes([FromRoute] int id, [FromQuery] int page)
        {
            var sql           = new SQL(connectionString: _config.GetConnectionString("Storage"));
            var codeConverter = new CodeConverter(_config.GetSection("Base26")["Alphabet"]);
            var tableData     = sql.GetCodes(
                campaignID: id,
                pageNumber: page,
                pageSize: Convert.ToInt32(_config.GetSection("Pagination")["PageSize"]),
                codeConverter: new CodeConverter(_config.GetSection("Base26")["Alphabet"]));

            return(Ok(tableData));
        }
Exemplo n.º 3
0
        public IActionResult GetCodes([FromRoute] int id, [FromQuery] int page)
        {
            var sql = new SQL(connectionString: _config.GetConnectionString("Storage"));

            var file = new CloudReader(filePath: _config.GetSection("File")["SeedBlobUrl"]);

            var pageSize = Convert.ToInt32(_config.GetSection("Pagination")["PageNumber"]);

            var alphabet = _config.GetSection("Base26")["Alphabet"];

            var codes = sql.GetCodes(id, page, pageSize, alphabet);

            var pages = sql.PageCount(id);

            return(Ok(new TableData(codes, pages, page)));
        }