コード例 #1
0
 public ActionResult ManagePanel(LoginModel model)
 {
     var loginPreferences = new LoginPreferences
     {
         OfflineMode = model.OfflineMode,
         PanelAdminEmail = model.PanelAdminEmail,
         PanelAdminUrl = model.PanelAdminUrl,
         PanelPassword = model.PanelPassword
     };
     if (model.OfflineMode == false)
     {
         if (ModelState.IsValid)
         {
             return RedirectToAction("Index", "ManagePanel", loginPreferences);
         }
         return View("Index");
     }
     return View("Index");
 }
コード例 #2
0
        public ActionResult CreatePanel(LoginModel model)
        {
            string encryptedPassword = PasswordUtill.Encrypt(model.PanelPassword);
            var loginPreferences = new LoginPreferences
            {
                OfflineMode = model.OfflineMode,
                PanelAdminEmail = model.PanelAdminEmail,
                PanelAdminUrl = model.PanelAdminUrl,
                PanelPassword = encryptedPassword
            };

            if (model.OfflineMode == false)
            {
                if (ModelState.IsValid)
                {
                    return RedirectToAction("Index", "Home", loginPreferences);
                }
                return View("Index");
            }
            return RedirectToAction("Index", "Home", loginPreferences);
        }