public ActionResult SignIn(AccountSignInModel accountSignInModel)
        {
            var account =
                _repository.First<Account>(
                    x => x.Email == accountSignInModel.Email && x.Password == accountSignInModel.Password);

            if (account != null)
            {
                return RedirectToAction("Index");
            }
            return View(accountSignInModel);
        }
        public ActionResult SignIn(AccountSignInModel accountSignInModel)
        {
            var account =
                _repository.First<Account>(
                    x => x.Email == accountSignInModel.Email && x.Password == accountSignInModel.Password);

            if (account!=null)
            {
                var roles = new List<string>();
                roles.Add(account.Role.Name);
                FormsAuthentication.SetAuthCookie(accountSignInModel.Email, accountSignInModel.RememberMe);
                SetAuthenticationCookie(accountSignInModel.Email, roles);

                return RedirectToAction("Index");
            }
            Error("Wrong Email or Password. Please try again");
            //[Authorize]ViewBag.IncorrectPassword = 1;
            return View(accountSignInModel);
        }
        public ActionResult SignIn(AccountSignInModel accountSignInModel)
        {
            var account =
                _repository.First<Account>(
                    x => x.Email == accountSignInModel.Email && x.Password == accountSignInModel.Password);

            if (account!=null)
            {

                List<string> roles = account.Roles.Select(x => x.Name).ToList();
                FormsAuthentication.SetAuthCookie(accountSignInModel.Email, accountSignInModel.RememberMe);
                SetAuthenticationCookie(accountSignInModel.Email,roles);
                return RedirectToAction("Index");
            }

            Error("Email and/or password incorrect");
            return View(accountSignInModel);
        }