Example #1
0
        public async Task <SzamlazasiRendResult> Select([FromQuery] string sid, [FromBody] int projektKod)
        {
            var result = new SzamlazasiRendResult();

            using (var tr = await _context.Database.BeginTransactionAsync())
                try
                {
                    result.Result = await SzamlazasiRendBll.SelectAsync(_context, sid, projektKod);

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

            return(result);
        }
Example #2
0
        public async Task <SzamlazasiRendResult> CreateNew([FromQuery] string sid)
        {
            var result = new SzamlazasiRendResult();

            using (var tr = await _context.Database.BeginTransactionAsync())
                try
                {
                    result.Result = new List <SzamlazasiRendDto> {
                        await SzamlazasiRendBll.CreateNewAsync(_context, sid)
                    };

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

            return(result);
        }