Esempio n. 1
0
        public static async Task <int> UpdateAsync(ossContext context, string sid, ParticioDto dto)
        {
            SessionBll.Check(context, sid);
            await CsoportDal.JogeAsync(context, JogKod.PARTICIO);

            await ParticioDal.Lock(context, dto.Particiokod, dto.Modositva);

            var entity = await ParticioDal.GetAsync(context);

            ObjectUtils.Update(dto, entity);
            return(ParticioDal.Update(context, entity));
        }
Esempio n. 2
0
        public async Task <Int32Result> Update([FromQuery] string sid, [FromBody] ParticioDto dto)
        {
            var result = new Int32Result();

            using (var tr = await _context.Database.BeginTransactionAsync())
                try
                {
                    result.Result = await ParticioBll.UpdateAsync(_context, sid, dto);

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

            return(result);
        }