Esempio n. 1
0
        public UserInfo ForgotPasswordValidation(UserInfo userLoginData)
        {
            var checkLoginData = entity.UserInfoes.Where(a => a.Email.Equals(userLoginData.Email)).FirstOrDefault();

            if (checkLoginData == null)
            {
                return checkLoginData;
            }
            else
            {
                var getPasswordDetail = entity.UserInfoes.Where(a => a.Email.Equals(userLoginData.Email)).Select(a => a.Password).FirstOrDefault();
                MailMessage mm = new MailMessage("*****@*****.**", userLoginData.Email);
                mm.Subject = "Workbounty Password Recovery";
                mm.Body = string.Format("Hi {0},<br /><br />Your password is {1}.<br /><br />Thank You.", checkLoginData.Email, getPasswordDetail);
                mm.IsBodyHtml = true;
                SmtpClient smtp = new SmtpClient();
                smtp.Host = "smtp.gmail.com";
                smtp.EnableSsl = true;
                NetworkCredential NetworkCred = new NetworkCredential();
                NetworkCred.UserName = "******";
                NetworkCred.Password = "******";
                smtp.UseDefaultCredentials = true;
                smtp.Credentials = NetworkCred;
                smtp.Port = 587;
                smtp.Send(mm);

                return checkLoginData;
            }
        }
Esempio n. 2
0
        public UserInfo UserLogin(UserInfo userLoginData)
        {
            try
            {
                var checkLoginData = entity.UserInfoes.Where(a => a.Email.Equals(userLoginData.Email) && a.Password.Equals(userLoginData.Password)).FirstOrDefault();

                if (checkLoginData == null)
                {
                    return checkLoginData;
                }
                else
                {
                    return checkLoginData;
                }
            }
            catch (Exception)
            {
                return null;
            }
        }
Esempio n. 3
0
 public UserInfo AddUserDetails(UserInfo userSignupData)
 {
     try
     {
         var checkUserSignupInfo = entity.UserInfoes.Where(a => a.Email.Equals(userSignupData.Email)).FirstOrDefault();
         if (checkUserSignupInfo == null)
         {
             entity.UserInfoes.Add(userSignupData);
             entity.SaveChanges();
             return userSignupData;
         }
         else
         {
             return null;
         }
     }
     catch (Exception)
     {
         return null;
     }
 }