示例#1
0
        public ActionResult Password(FormCollection collection)
        {
            try
            {
                if (collection["Password"] != collection["confirm"])
                {
                    ViewBag.Message = "Password and it's confirm didn't match";
                }
                else
                {
                    dc.Admin_UpdatePassword(Session["username"].ToString(), collection["prev"], collection["password"]);
                    return(RedirectToAction("Index"));
                }
            }
            catch
            {
                ViewBag.Message = "There was a database error";
            }


            if (Request.IsAjaxRequest())
            {
                return(PartialView());
            }
            else
            {
                return(View());
            }
        }