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); } }
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); } }
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); } }
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); } }