示例#1
0
        public void Add()
        {
            UserBDContext context = new UserBDContext();

            context.Users.Add(this);
            context.SaveChanges();
        }
示例#2
0
        public bool CheckID()
        {
            UserBDContext context = new UserBDContext();
            var           check   = context.Users.Where(u => u.UserName.Equals(this.UserName)).ToList();

            if (check.Count() > 0)
            {
                return(false);
            }
            else
            {
                return(true);
            }
        }
示例#3
0
        public bool CheckEmail()
        {
            UserBDContext context = new UserBDContext();
            var           check   = context.Users.Where(u => u.Email.Equals(this.Email)).ToList();

            if (check.Count > 0)
            {
                return(false);
            }
            else
            {
                return(true);
            }
        }
示例#4
0
        public bool Login()
        {
            UserBDContext context = new UserBDContext();
            var           data    = context.Users.Where(u => u.UserName.Equals(this.UserName) && u.Password.Equals(this.Password)).ToList();

            if (data.Count() > 0)
            {
                return(false);
            }
            else
            {
                return(true);
            }
        }