コード例 #1
0
 public bool Create_User(ULogin l)
 {
     try
     {
         dbContext.ULogins.Add(l);
         dbContext.SaveChanges();
         return(true);
     }
     catch (Exception e)
     {
         return(false);
     }
 }
コード例 #2
0
        public ULogin Authenticate(String uid, String pwd)
        {
            var credentials = (dbContext.ULogins.Where(a => (a.user_ID.Equals(uid)) && (a.user_Pwd.Equals(pwd)))).FirstOrDefault();

            if (credentials != null)
            {
                ULogin l = new ULogin();
                l = (ULogin)credentials;
                return(l);
            }
            else
            {
                return(null);
            }
        }