Esempio n. 1
0
        public async Task <Int32Result> Add([FromQuery] string sid, [FromBody] PenztarTetelDto dto)
        {
            var result = new Int32Result();

            using (var tr = await _context.Database.BeginTransactionAsync())
                try
                {
                    result.Result = await PenztarTetelBll.AddAsync(_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 = PenztarTetelBll.ReszletekSettings(_context, sid);

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

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

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

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

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

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