public bool ForgetPass(ForgetPassword input) { var taikhoan = db.Accounts.FirstOrDefault(x => string.Compare(x.UserName, input.Username) == 0 && string.Compare(x.UserInfo.Email, input.Email) == 0 && !x.DelFlag); if (taikhoan == null) { return false; } else { string newPass = FunctionCommon.AutoPassword(); SendMail.Send(taikhoan.UserInfo.Email, newPass, "[DUTAdmissionSystem] Forget Password"); taikhoan.Password = FunctionCommon.GetMd5(FunctionCommon.GetSimpleMd5(newPass)); db.SaveChanges(); return true; } }