예제 #1
0
        public async Task <IActionResult> Edit(int id, [Bind("MMCId,MustContainWord")] MessageMustContain messageMustContain)
        {
            if (id != messageMustContain.MMCId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(messageMustContain);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!MessageMustContainExists(messageMustContain.MMCId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(messageMustContain));
        }
        public async Task <IActionResult> Edit(int id, [Bind("ChannelId,IntervalMins")] TelegramChannel telegramChannel)
        {
            if (id != telegramChannel.ChannelId)
            {
                return(NotFound());
            }


            try
            {
                var channel = _context.Channels.Where(c => c.ChannelId == telegramChannel.ChannelId).FirstOrDefault();



                _context.Update(channel);
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!TelegramChannelExists(telegramChannel.ChannelId))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }
            return(RedirectToAction(nameof(Edit), new { id = telegramChannel.ChannelId }));
        }
예제 #3
0
 public async Task <IActionResult> Edit([Bind("ID,Intervalmins,Deschatid")] TelegramScraperSettings telegramScraperSettings)
 {
     if (ModelState.IsValid)
     {
         try
         {
             _context.Update(telegramScraperSettings);
             await _context.SaveChangesAsync();
         }
         catch (DbUpdateConcurrencyException)
         {
         }
         return(RedirectToAction("Index", "Home"));
     }
     return(View(telegramScraperSettings));
 }