Exemplo n.º 1
0
        public BooksDetails(int id)
        {
            jiaoziEntities db = new jiaoziEntities();

            Bc = db.BookComment.Where(o => o.BookID == id);
            B  = db.Books.Where(b => b.BookID == id).FirstOrDefault();
        }
Exemplo n.º 2
0
 public bool Login(int?UserID, string PasswordL)
 {
     using (jiaoziEntities db = new jiaoziEntities())
     {
         var users = db.Users.Where(x => x.UserID == UserID && x.Password == PasswordL).FirstOrDefault();
         if (users != null)
         {
             return(true);
         }
         else
         {
             return(false);
         }
     }
 }
Exemplo n.º 3
0
 public string FindPassword(string Email, string TrueName)
 {
     using (jiaoziEntities db = new jiaoziEntities())
     {
         var passwords = db.Users.Where(m => m.Email == Email && m.TrueName == TrueName).FirstOrDefault();
         if (passwords != null)
         {
             var password = passwords.Password;
             return(password);
         }
         else
         {
             string message = "提交信息有误,找回密码失败!";
             return(message);
         }
     }
 }
Exemplo n.º 4
0
        public bool Registe(string TrueName, string PasswordR, string Email)
        {
            using (jiaoziEntities db = new jiaoziEntities())
            {
                if (db.Users.Any(x => x.Email == Email))
                {
                    return(false);
                }
                else
                {
                    var users = new Users()
                    {
                        TrueName = TrueName,

                        Password = PasswordR,
                        Email    = Email
                    };
                    db.Users.Add(users);
                    db.SaveChanges();
                    return(true);
                }
            }
        }
Exemplo n.º 5
0
        IQueryable <RemarkComments> IRemarkcomments.Getcommentsbyid(int id)
        {
            jiaoziEntities db = new jiaoziEntities();

            return(db.RemarkComments.OrderByDescending(p => p.RemarkID).Where(p => p.RemarkID == id));
        }
Exemplo n.º 6
0
        IQueryable <News> INews2.FindNewsbyid(int Newsid)
        {
            jiaoziEntities db = new jiaoziEntities();

            return(db.News.Where(n => n.NewsID == Newsid));
        }