Esempio n. 1
0
        public async Task <CikkResult> Read([FromQuery] string sid, [FromBody] string maszk)
        {
            var result = new CikkResult();

            using (var tr = await _context.Database.BeginTransactionAsync())
                try
                {
                    result.Result = await CikkBll.ReadAsync(_context, sid, maszk);

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

            return(result);
        }
Esempio n. 2
0
        public async Task <CikkResult> Get([FromQuery] string sid, [FromBody] int key)
        {
            var result = new CikkResult();

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

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

            return(result);
        }
Esempio n. 3
0
        public async Task <CikkResult> Select([FromQuery] string sid, [FromBody] CikkParam par)
        {
            var result = new CikkResult();

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

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

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

            return(result);
        }