public IEnumerable <StatementListRow> Get([FromQuery] StatementListArgs args) { var criteria = new List <string>(); var id = string.Empty; switch (args.type) { case StatementType.Bank: id = "bank_id"; break; case StatementType.Corporate: id = "corporate_id"; break; case StatementType.Merchant: id = "merchant_id"; break; default: break; } var sql = @" SELECT id, date, statement_end_date FROM public.pdf_statements where " + id + "=@0"; var data = _db.Fetch <StatementListRow>(sql, args.key); return(data); }
public IEnumerable <StatementDataRow> Get([FromQuery] StatementDataArgs args) { //var criteria = new List<string>(); //var id = string.Empty; //switch (args.type) //{ // case StatementType.Bank: // id = "bank_id"; // break; // case StatementType.Corporate: // id = "corporate_id"; // break; // case StatementType.Merchant: // id = "merchant_id"; // break; // default: // break; //} var sql = @" SELECT file_name, pdf_file FROM public.pdf_statements where id=@0"; var data = _db.Fetch <StatementDataRow>(sql, args.ID); return(data); }