public async Task <IActionResult> Edit(int id, [Bind("id,namechanale,token,isactive,isactivesendauto,isactivediscription,isactivepost,isactiveproduct,description")] BotTelegram botTelegram) { if (id != botTelegram.Id) { return(NotFound()); } if (ModelState.IsValid) { try { botTelegram.Id = id; _context.Update(botTelegram); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!botTelegramExists(botTelegram.Id)) { return(NotFound()); } else { throw; } } return(Redirect("/Admin/botTelegrams/Index")); } return(View(botTelegram)); }
public async Task <IActionResult> Create([Bind("id,namechanale,token,isactive,isactivesendauto,isactivediscription,isactivepost,isactiveproduct,description")] BotTelegram botTelegram) { if (ModelState.IsValid) { //_context.Add(botTelegram); //await _context.SaveChangesAsync(); return(Redirect("/Admin/botTelegrams/Index")); } return(View(botTelegram)); }
private void Main_Load(object sender, EventArgs e) { try { Products_DGV.AutoGenerateColumns = false; products = new OperationsProducts(); Operationsbots = new OperationsBots(); Operationsserver = new OperationsServer(); Server = new Server(); telegram = new BotTelegram(); Server.Start(); telegram.StartAsync(); LoadProducts(); } catch (Exception Ex) { Error(Ex.Message); } }