Esempio n. 1
0
        public async Task <BaseResults.EmptyResult> Delete([FromQuery] string sid, [FromBody] CikkDto dto)
        {
            var result = new BaseResults.EmptyResult();

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

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

            return(result);
        }
Esempio n. 2
0
        public async Task <ColumnSettingsResult> GetReszletekSettings([FromQuery] string sid)
        {
            var result = new ColumnSettingsResult();

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

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

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

            using (var tr = await _context.Database.BeginTransactionAsync())
                try
                {
                    await CikkBll.ZoomCheckAsync(_context, sid, par.CikkKod, par.Cikk);

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

            return(result);
        }
Esempio n. 4
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. 5
0
        public async Task <CikkMozgasResult> Mozgas([FromQuery] string sid, [FromBody] CikkMozgasParam par)
        {
            var result = new CikkMozgasResult();

            using (var tr = await _context.Database.BeginTransactionAsync())
                try
                {
                    result.Result = await CikkBll.MozgasAsync(_context, sid, par.CikkKod,
                                                              (BizonylatTipus)par.BizonylatTipusKod);

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

            return(result);
        }
Esempio n. 6
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. 7
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);
        }