public IActionResult Install(Install mdl) { var shop = _conf.Get <MainSettings>(); if (!ModelState.IsValid) { return(View(mdl)); } var admin = _conf.Get <AdminSettings>(); var digiseller = _conf.Get <DigisellerSettings>(); digiseller.DigisellerId = mdl.DigisellerId; digiseller.DigisellerUid = mdl.DigisellerUid; _conf.Save(digiseller); admin.Login = mdl.AdminLogin; admin.Password = mdl.Password; _conf.Save(admin); shop.Installed = true; _conf.Save(shop); _client.SellerId = (int)digiseller.DigisellerId; _client.SellerUid = digiseller.DigisellerUid; HttpContext.Session.Authorize(); TempData["success"] = "Установка Digishop произведена успешно!"; return(RedirectToAction("Index", "Home", new { controller = "Home", action = "Index", area = "Dashboard" })); }
public IActionResult System(MainSettings settings) { if (!ModelState.IsValid) { return(View(settings)); } _conf.Save(settings); return(RedirectToMainWithMessage(true, "Настройки системы успешно сохранены.")); }