public ActionResult ImageUpdate(UserInfoExt ext)
        {
            var userext = UserInfoExtServices.LoadEntities(u => u.Id == ext.Id).FirstOrDefault();

            if (ext.TouXiang == null)
            {
                ViewData["userext"] = userext;
                ViewData["msg"]     = "请进行上传头像";
                return(View());
            }

            userext.TouXiang = ext.TouXiang;

            try
            {
                UserInfoExtServices.Update(userext);
                ViewData["userext"] = userext;
                ViewData["msg"]     = "修改成功";
                return(View());
            }
            catch (Exception)
            {
                ViewData["msg"]     = "修改失败";
                ViewData["userext"] = userext;
                return(View());
            }
        }
        public ActionResult ImageUpdate()
        {
            var userext = UserInfoExtServices.LoadEntities(u => u.UserInfoId == CurrentLoginUser.Id).FirstOrDefault();

            ViewData["userext"] = userext;

            return(View());
        }
        public ActionResult MyInfoUp()
        {
            var dbUserExt = UserInfoExtServices.LoadEntities(u => u.UserInfoId == CurrentLoginUser.Id).FirstOrDefault();

            ViewData["MyInfo"] = dbUserExt;

            return(View());
        }
        public ActionResult MyInfoUp(UserInfoExt ext)
        {
            var userext = UserInfoExtServices.LoadEntities(u => u.Id == ext.Id).FirstOrDefault();

            if (userext != null)
            {
                userext.NickName = ext.NickName;
                userext.RealName = ext.RealName;
                userext.Birthday = ext.Birthday;
                userext.Gender   = ext.Gender;
                userext.Address  = ext.Address;

                try
                {
                    UserInfoExtServices.Update(userext);
                    return(Content("更新成功"));
                }
                catch (Exception)
                {
                    return(Content("请按照格式输入"));
                }
            }
            return(Content("更新失败"));
        }
        public ActionResult Home(int?pageindex)
        {
            if (pageindex == null || pageindex < 1)
            {
                pageindex = 1;
            }

            //未读消息数量
            int weiduNews = MyNewsServices.LoadEntities(u => u.IsSee == noSeeMyNews && u.UserInfoId == CurrentLoginUser.Id).Count();

            ViewData["weiduNews"] = weiduNews;

            ViewData.Model = CurrentLoginUser;

            var userext = UserInfoExtServices.LoadEntities(u => u.UserInfoId == CurrentLoginUser.Id).FirstOrDefault();

            ViewData["userext"] = userext;

            int total = 0;
            IQueryable <Goods> good = GoodsServices.LoadPageEntities((int)pageindex, 9, out total, u => u.DelGlag == normal, u => u.Id, false);

            ViewData["RandGoods"] = good;
            return(View());
        }