Beispiel #1
0
        public ActionResult AddNewMember(Models.MemberInfo mi)
        {
            DB.DB        mydb = new DB.DB("SQLAdmin", "admin1234");
            DB.ICustomer ic   = new DB.Impl_Customer(mydb.Connection);

            ic.AddNewMember(mi.Phone, mi.PW, mi.Name, mi.Email);

            return(RedirectToAction("Index", "Login", new { msg = "成功加入會員,請登入!" }));
        }
        public ActionResult UpdatePW(Models.MemberInfo Mi)
        {
            if (!CheckLI(Session["Login"].ToString(), Mi.oldPW))
            {
                return(RedirectToAction("ChangePW", new { msg = "無效的舊密碼!" }));
            }
            else if (Mi.oldPW == Mi.PW)
            {
                return(RedirectToAction("ChangePW", new { msg = "新舊密碼不能相同!" }));
            }

            DB.DB        mydb = new DB.DB("SQLAdmin", "admin1234");
            DB.ICustomer ic   = new DB.Impl_Customer(mydb.Connection);
            ic.ChangePassword(Session["Login"].ToString(), Mi.PW);
            return(RedirectToAction("ChangePW", new { msg = "密碼變更成功!" }));
        }