Exemplo n.º 1
0
        public ActionResult Login(TMRC_CSP.Areas.Reseller.Models.ResellerLogin r)
        {
            string res = string.Empty;

            if (ModelState.IsValid)
            {
                ViewModel.Account.Login login = new ViewModel.Account.Login();
                res = login.IsValid(r);
                if (res.Contains("Home/"))
                {
                    return(RedirectToAction(res));
                }
            }
            ViewBag.msg = res;
            return(View());
        }
Exemplo n.º 2
0
 public string SavePassword(Models.ChangePassword c)
 {
     try
     {
         var db = new TMRC_CSP.ViewModel.Context.ConnectionStringsContext();
         if (Login._r.Password == c.OldPassword) //Confirmation is it valid user
         {
             var res = db.Resellers.Where(m => m.Email == Login._r.Email).SingleOrDefault();
             res.Password         = c.NewPassword;
             res.Is1stTimePassChg = true;
             db.SaveChanges();
             ViewModel.Account.Login login = new ViewModel.Account.Login();
             login.SignOut();
             return("Successfully Password Changed.");
         }
         return("Unknown error ocuur, Please try again.");
     }
     catch (Exception ex)
     {
         return("Unknown error ocuur, Please try again.");
     }
 }
Exemplo n.º 3
0
 public ActionResult SignOut()
 {
     ViewModel.Account.Login login = new ViewModel.Account.Login();
     login.SignOut();
     return(RedirectToAction("Login"));
 }