Пример #1
0
        public async Task <BaseResults.EmptyResult> Delete([FromQuery] string sid, [FromBody] UgyfelDto dto)
        {
            var result = new BaseResults.EmptyResult();

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

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

            return(result);
        }
Пример #2
0
        public async Task <ColumnSettingsResult> GetReszletekSettings([FromQuery] string sid)
        {
            var result = new ColumnSettingsResult();

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

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

            return(result);
        }
Пример #3
0
        public async Task <StringResult> vCard([FromQuery] string sid, [FromBody] int key)
        {
            var result = new StringResult();

            using (var tr = await _context.Database.BeginTransactionAsync())
                try
                {
                    result.Result = await UgyfelBll.vCardAsync(_context, sid, key);

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

            return(result);
        }
Пример #4
0
        public async Task <BaseResults.EmptyResult> ZoomCheck([FromQuery] string sid, [FromBody] UgyfelZoomParameter par)
        {
            var result = new BaseResults.EmptyResult();

            using (var tr = await _context.Database.BeginTransactionAsync())
                try
                {
                    await UgyfelBll.ZoomCheckAsync(_context, sid, par.Ugyfelkod, par.Ugyfelnev);

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

            return(result);
        }
Пример #5
0
        public async Task <UgyfelResult> CreateNew([FromQuery] string sid)
        {
            var result = new UgyfelResult();

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

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

            return(result);
        }
Пример #6
0
        public async Task <UgyfelResult> Select([FromQuery] string sid, [FromBody] UgyfelParam par)
        {
            var result = new UgyfelResult();

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

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

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

            return(result);
        }