Beispiel #1
0
        public ActionResult Login(Customer customer)
        {
            var result = CustomerRepo.CheckCustomer(customer);

            if (result != null)
            {
                Session["email"]    = customer.Email;
                Session["Customer"] = result;

                return(RedirectToAction("Index", "Home"));
            }
            else
            {
                ViewBag.Message = "Hata";
                return(View());
            }
        }
Beispiel #2
0
        public ActionResult UpdatePassword(string newPassword, string newPassword2, Customer customer)
        {
            var toBeUpdated = CustomerRepo.CheckCustomer(customer);

            if (toBeUpdated != null)
            {
                if (newPassword == newPassword2)
                {
                    var updatedCustomer = CustomerRepo.UpdateCustomerPassword(toBeUpdated, newPassword);
                    return(RedirectToAction("Account", "Customer", updatedCustomer));
                }
                else
                {
                    ViewBag.Error = "Hatalı şifre girdiniz.";
                    return(RedirectToAction("Account", "Customer", customer));
                }
            }
            else
            {
                ViewBag.Error = "Hatalı şifre girdiniz.";
                return(RedirectToAction("Account", "Customer"));
            }
        }