public Task <IEnumerable <KostenartDisplayItem> > GetKostenartenOfLeistung(int faLeistungId, BgSpezkontoTyp typ) { var query = new KostenartenQuery { FaLeistungId = faLeistungId, Typ = typ }; return(_mediator.Process(query)); }
public override async Task <IEnumerable <KostenartDisplayItem> > Handle(KostenartenQuery query) { return(await _dbConnection.QueryAsync <KostenartDisplayItem>( @"SELECT BKA.*, NrName = BKA.KontoNr + ' ' + BKA.Name FROM BgKostenart BKA WHERE EXISTS (SELECT * FROM WhPositionsart WHERE BgKostenartID = BKA.BgKostenartID AND BgKategorieCode = 2 AND (EXISTS (SELECT * FROM BgFinanzplan WHERE WhGrundbedarfTypCode = BgPositionsartID AND FaLeistungID = @FaLeistungId) OR BgGruppeCode BETWEEN 39000 AND 39999 OR @Typ = 1))", new { query.FaLeistungId, query.Typ })); }