Example #1
0
        public static async Task <int> AddAsync(ossContext context, string sid, PenztarTetelDto dto)
        {
            SessionBll.Check(context, sid);
            await CsoportDal.JogeAsync(context, JogKod.PENZTAR);

            dto.Penztarbizonylatszam =
                context.KodGen(KodNev.Penztar.ToString() + dto.Penztarkod).ToString("00000") + "/" +
                dto.Penztarkod;

            var entity = ObjectUtils.Convert <PenztarTetelDto, Models.Penztartetel>(dto);

            return(await PenztarTetelDal.AddAsync(context, entity));
        }
Example #2
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);
        }