public ActionResult ChangePassPage(ChangePasswordViewModel model)
        {
            UsersService users = new UsersService();
            String currentUsername = User.Identity.Name;
            User user = (User)users.FindUserByUsername(currentUsername);

            if (user.Password.Equals(model.currentPassword))
            {
                if (model.newPassword.Equals(model.confirmNewPass))
                {
                    user.Password = model.confirmNewPass;
                    users.Edit(user);
                }
                else
                {
                    ViewBag.Error = "Password didn't match!!!";
                    return View(model);
                }
            }
            else
            {
                ViewBag.Error = "Password incorect!!";
                return View(model);
            }

            return RedirectToAction("Index", "Home");
        }
 /// <summary>
 /// Go to change password page for current loged in user.
 /// </summary>
 public ActionResult ChangePassPage(String id)
 {
     UsersService users = new UsersService();
     User user = (User)users.FindUserByUsername(id);
     String currentUsername = User.Identity.Name;
     if (!currentUsername.Equals(user.Username))
     {
         return RedirectToAction("Index", "Home");
     }
     ChangePasswordViewModel model = new ChangePasswordViewModel();
     return View(model);
 }