Exemplo n.º 1
0
 public bool Password(string password, string username)
 {
     log = context.userlog.Where(b => b.username == username).FirstOrDefault();
     if (log.password == password)
     {
         return(true);
     }
     else
     {
         return(false);
     }
 }
Exemplo n.º 2
0
        public bool Username(string _Username)
        {
            log = context.userlog.Where(b => b.username == _Username).FirstOrDefault();

            if (log != null)
            {
                pass = log.password;
                return(true);
            }
            else
            {
                return(false);
            }
        }
Exemplo n.º 3
0
        public userlog OTPcheck(int Otp, string username)
        {
            userlog otp = log = context.userlog.Where(b => b.username == username).FirstOrDefault();

            if (otp.otp == Otp)
            {
                return(otp);
            }
            else
            {
                otp = null;
                return(otp);
            }
        }
Exemplo n.º 4
0
 public bool update(string username)
 {
     try
     {
         Random  rnd     = new Random();
         int     randOTP = rnd.Next(10000, 99999);
         userlog log     = context.userlog.Where(d => d.username == username).FirstOrDefault();
         if (log != null)
         {
             log.otp = randOTP;
             context.SaveChanges();
             return(true);
         }
         else
         {
             return(false);
         }
     }
     catch
     {
         return(false);
     }
 }