Ejemplo n.º 1
0
        public async Task <ColumnSettingsResult> GetReszletekSettings([FromQuery] string sid)
        {
            var result = new ColumnSettingsResult();

            using (var tr = await _context.Database.BeginTransactionAsync())
                try
                {
                    result.Result = IratBll.ReszletekSettings(_context, sid);

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

            return(result);
        }
Ejemplo n.º 2
0
        public async Task <BaseResults.EmptyResult> Delete([FromQuery] string sid, [FromBody] IratDto dto)
        {
            var result = new BaseResults.EmptyResult();

            using (var tr = await _context.Database.BeginTransactionAsync())
                try
                {
                    await IratBll.DeleteAsync(_context, sid, dto);

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

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

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

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

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

            using (var tr = await _context.Database.BeginTransactionAsync())
                try
                {
                    var t = await IratBll.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);
        }