public ActionResult ChangeData()
 {
    var memberAccount = db.member.Where(x => x.Account == User.Identity.Name).FirstOrDefault();
    MemberDataViewModel memberData = new MemberDataViewModel()
    {
        Account = memberAccount.Account,
        Adress = memberAccount.Adress,
        Email = memberAccount.Email,
        Name = memberAccount.Name,
        Telphone = memberAccount.Telphone,
    };
     
     return View(memberData);
 }
 public ActionResult ChangeData(MemberDataViewModel memberData)
 {
     var memberAccount = db.member.Where(x => x.Account == memberData.Account).FirstOrDefault();
     if (memberAccount.PassWord != memberData.PassWord)
     {
         ModelState.AddModelError("PassWord", "密碼不正確");
     }
     if (ModelState.IsValid)
     {
         memberAccount.Adress = memberData.Adress;
         memberAccount.Email = memberData.Email;
         memberAccount.Name = memberData.Name;
         memberAccount.Telphone = memberData.Telphone;
         memberAccount.PassWord = memberData.PassWord2;
         db.Entry(memberAccount).State = EntityState.Modified;
         db.SaveChanges();
         TempData["Change"] = "更改成功";
         memberData.PassWord = "";
         memberData.PassWord2 = "";
         return View(memberData);
     }
     return View(memberData);
 }