//保存头像
        public int bao(DTO.UserInfoDto du)
        {
            var ui = DbContexts.UserInfo.Find(du.Id);

            ui.UserHeadPortrait = du.UserHeadPortrait;

            return(DbContexts.SaveChanges());
        }
        /// <summary>
        /// 找回密码方法
        /// </summary>
        /// <param name="whereLambda"></param>
        /// <returns></returns>
        public int ForgetThePwd(DTO.UserInfoDto Uidto)
        {
            //根据邮箱修改密码
            var ForgetThePwdEntity = DbContexts.UserInfo.Where(p => p.UserEmail == Uidto.UserEmail).First();

            ForgetThePwdEntity.UserPassword = Uidto.UserPassword;
            int i = DbContexts.SaveChanges();

            return(i);
        }
        //保存资料
        public int update(DTO.UserInfoDto du)
        {
            var ui = DbContexts.UserInfo.Find(du.Id);

            ui.UserName      = du.UserName;
            ui.UserEmail     = du.UserEmail;
            ui.UserAutograph = du.UserAutograph;
            ui.UserSex       = du.UserSex;
            ui.UserRegion    = du.UserRegion;
            ui.UserBirthday  = du.UserBirthday;
            return(DbContexts.SaveChanges());
        }
        /// <summary>
        /// 注册方法
        /// </summary>
        /// <param name="whereLambda"></param>
        /// <returns></returns>
        public int AddRegister(DTO.UserInfoDto Uidto)
        {
            //return DbContext.UserInfo.Where(whereLambda).AsQueryable();
            Models.UserInfo Userlist = new Models.UserInfo()
            {
                UserName     = Uidto.UserName,
                UserEmail    = Uidto.UserEmail,
                UserPassword = Uidto.UserPassword
            };
            DbContexts.UserInfo.Add(Userlist);
            int i = DbContexts.SaveChanges();

            return(i);
        }
 /// <summary>
 /// 发布微博
 /// </summary>
 /// <param name="Uid"></param>
 /// <param name="Mbd"></param>
 /// <returns></returns>
 public int PublishWeibo(DTO.UserInfoDto Uid, DTO.MicroBlogsDto Mbd)
 {
     Models.MicroBlog Mb = new Models.MicroBlog()
     {
         UserID        = Uid.Id,
         Title         = Mbd.Title,
         Content_text  = Mbd.Content_text,
         Content_img   = Mbd.Content_img,
         Points_number = 0,
         Place         = Mbd.Place,
         Cansee_states = 0
     };
     DbContexts.MicroBlog.Add(Mb);
     return(DbContexts.SaveChanges());
 }
        /// <summary>
        /// 发布微博
        /// </summary>
        /// <param name="Uid"></param>
        /// <param name="Mbd"></param>
        /// <returns></returns>
        public int PublishWeibo(DTO.UserInfoDto Uid, DTO.MicroBlogsDto Mbd)
        {
            var uifSvc = new DAL.MicroBlogService();

            return(uifSvc.PublishWeibo(Uid, Mbd));
        }