Ejemplo n.º 1
0
        public async Task <BizonylatResult> Get([FromQuery] string sid, [FromBody] int bizonylatKod)
        {
            var result = new BizonylatResult();

            using (var tr = await _context.Database.BeginTransactionAsync())
                try
                {
                    result.Result = new List <BizonylatDto> {
                        await BizonylatBll.GetAsync(_context, sid, bizonylatKod)
                    };

                    tr.Commit();
                }
                catch (Exception ex)
                {
                    tr.Rollback();
                    result.Error = ex.InmostMessage();
                }

            return(result);
        }
Ejemplo n.º 2
0
        public async Task <BizonylatResult> Select([FromQuery] string sid, [FromBody] BizonylatParam par)
        {
            var result = new BizonylatResult();

            using (var tr = await _context.Database.BeginTransactionAsync())
                try
                {
                    var t = await BizonylatBll.SelectAsync(_context, sid, par.RekordTol, par.LapMeret,
                                                           par.BizonylatTipus, par.Fi);

                    result.Result       = t.Item1;
                    result.OsszesRekord = t.Item2;

                    tr.Commit();
                }
                catch (Exception ex)
                {
                    tr.Rollback();
                    result.Error = ex.InmostMessage();
                }

            return(result);
        }