예제 #1
0
        public async Task <bool> End(int doorId, int IntimidatorId)
        {
            IntimidatorIntimidation intimidation = await new IntimidationData(_context).SelectAsync(Time.GetSystemNow().Date, doorId, IntimidatorId);

            if (intimidation == null)
            {
                return(false);
            }

            intimidation.Depleted = true;

            return(await new IntimidationData(_context).End(intimidation));
        }
예제 #2
0
        public async Task <bool> Start(IntimidatorIntimidation intimidatorIntimidation)
        {
            try
            {
                _context.IntimidatorIntimidations.Add(intimidatorIntimidation);
                int affectedRows = await _context.SaveChangesAsync();

                return(affectedRows > 0);
            }
            catch (Exception)
            {
                return(false);
            }
        }