Beispiel #1
0
        public ActionResult Edit(Currency currency)
        {
            if (ModelState.IsValid && _unitRepo.UpdateCurrency(currency))
            {
                MoneyHelper.SetDefaultCurrency();
                return(RedirectToAction("Index"));
            }

            return(View());
        }
Beispiel #2
0
 public ActionResult Login(LoginViewModel model, string returnUrl)
 {
     if (ModelState.IsValid)
     {
         try
         {
             if (!CurrentUser.Login(model.Email, model.Password, model.RememberMe))
             {
                 ModelState.AddModelError("", Resource.InvalidEmailOrPassword);
             }
             else
             {
                 MoneyHelper.SetDefaultCurrency();
                 return(RedirectToLocal(returnUrl));
             }
         }
         catch (ConcurrentLoginLimitException ex)
         {
             ModelState.AddModelError("", "Your account is currently logged in somewhere else. Please try again later!");
         }
     }
     return(View(model));
 }
Beispiel #3
0
 public ActionResult DeleteConfirmed(int id)
 {
     _unitRepo.DeleteCurrency(id);
     MoneyHelper.SetDefaultCurrency();
     return(RedirectToAction("Index"));
 }