Esempio n. 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session[YSWL.Common.Globals.SESSIONKEY_ADMIN] != null)
            {
                YSWL.Accounts.Bus.User currentUser = (YSWL.Accounts.Bus.User)Session[YSWL.Common.Globals.SESSIONKEY_ADMIN];

                LogHelp.AddUserLog(currentUser.UserName, currentUser.UserType, "退出系统", this);

                #region 更新最新的登录时间
                ColoPay.BLL.Members.UsersExp uBll   = new BLL.Members.UsersExp();
                Model.Members.UsersExpModel  uModel = new Model.Members.UsersExpModel();
                uModel = uBll.GetUsersExpModel(currentUser.UserID);
                if (uModel != null)
                {
                    uModel.LastAccessIP  = Request.UserHostAddress;
                    uModel.LastLoginTime = DateTime.Now;
                    uBll.Update(uModel);
                }
                #endregion
            }
            FormsAuthentication.SignOut();
            Session.Remove(Globals.SESSIONKEY_ADMIN);
            Session.Clear();
            Session.Abandon();
            Response.Clear();
            Response.Write("<script language='javascript'>window.top.location='" + defaullogin + "'</script>");
            Response.End();
        }
Esempio n. 2
0
 public void UpdateUserDomain(FormCollection collection)
 {
     if (!HttpContext.User.Identity.IsAuthenticated || CurrentUser == null)
     {
         RedirectToAction(ViewBag.BasePath + "Account/Login");//去登录
     }
     else
     {
         JsonObject json = new JsonObject();
         Model.Members.UsersExpModel model = bllUE.GetUsersModel(CurrentUser.UserID);
         if (null == model)
         {
             RedirectToAction(ViewBag.BasePath + "Account/Login");//去登录
         }
         else
         {
             model.HomePage = collection["Domain"];
             if (bllUE.Update(model))
             {
                 json.Accumulate("STATUS", "SUCC");
             }
             else
             {
                 json.Accumulate("STATUS", "FAIL");
             }
             Response.Write(json.ToString());
         }
     }
 }
Esempio n. 3
0
 public YSWL.MALL.Model.Members.UsersExpModel GetUserModel(int UserID)
 {
     YSWL.MALL.BLL.Members.UsersExp        UserExBll   = new BLL.Members.UsersExp();
     YSWL.MALL.Model.Members.UsersExpModel UserExModel = new Model.Members.UsersExpModel();
     UserExModel = UserExBll.GetUsersModel(UserID);
     return(UserExModel);
 }
Esempio n. 4
0
        public bool UpdateEx(Model.Members.UsersExpModel model)
        {
            if (Exists(model.UserID))
            {
                return(Update(model));
            }
            else
            {
                model.UserID                     = model.UserID;
                model.BirthdayVisible            = 0;
                model.BirthdayIndexVisible       = false;
                model.ConstellationVisible       = 0;
                model.ConstellationIndexVisible  = false;
                model.NativePlaceVisible         = 0;
                model.NativePlaceIndexVisible    = false;
                model.RegionId                   = 0;
                model.AddressVisible             = 0;
                model.AddressIndexVisible        = false;
                model.BodilyFormVisible          = 0;
                model.BodilyFormIndexVisible     = false;
                model.BloodTypeVisible           = 0;
                model.BloodTypeIndexVisible      = false;
                model.MarriagedVisible           = 0;
                model.MarriagedIndexVisible      = false;
                model.PersonalStatusVisible      = 0;
                model.PersonalStatusIndexVisible = false;
                model.LastAccessIP               = "";
                model.LastAccessTime             = DateTime.Now;
                model.LastLoginTime              = DateTime.Now;
                model.LastPostTime               = DateTime.Now;

                return(Add(model));
            }
        }
Esempio n. 5
0
 public ActionResult Gravatar(FormCollection collection)
 {
     ViewBag.Title = "修改头像";
     try
     {
         if (CurrentUser == null)
         {
             return(RedirectToAction("Login", "Account"));//去登录
         }
         else
         {
             Model.Members.UsersExpModel model = bllUE.GetUsersModel(CurrentUser.UserID);
             if (null != model)
             {
                 model.Gravatar = collection["Gravatar"];
                 if (bllUE.Update(model))//更新扩展信息  ,后期将更新头像独立一个方法。
                 {
                     return(RedirectToAction("Personal"));
                 }
                 else
                 {
                     return(RedirectToAction("Personal"));
                 }
             }
             else
             {
                 return(RedirectToAction("Login", "Account"));//去登录
             }
         }
     }
     catch
     {
         return(View());
     }
 }
Esempio n. 6
0
        public ActionResult AjaxUserInfo(int?UserID, string NickName)
        {
            YSWL.MALL.BLL.Members.Users           UserBll     = new BLL.Members.Users();
            YSWL.MALL.BLL.Members.UsersExp        UserExBll   = new BLL.Members.UsersExp();
            YSWL.MALL.Model.Members.UsersExpModel UserExModel = new Model.Members.UsersExpModel();
            int ID;

            if (!string.IsNullOrEmpty(NickName))
            {
                if ((ID = UserBll.GetUserIdByNickName(NickName)) > 0)
                {
                    UserID = ID;
                }
                else
                {
                    return(View("_AjaxUserInfo", UserExModel));
                }
            }
            if (UserID.HasValue)
            {
                UserExModel = UserExBll.GetUsersModel(UserID.Value);
                YSWL.MALL.BLL.Ms.Regions RegionBll = new BLL.Ms.Regions();
                string strAddress = RegionBll.GetRegionNameByRID(Common.Globals.SafeInt(UserExModel.Address, 0));
                if (strAddress.Contains("北京北京"))
                {
                    strAddress = strAddress.Replace("北京北京", "北京");
                }
                else if (strAddress.Contains("上海上海"))
                {
                    strAddress = strAddress.Replace("上海上海", "上海");
                }
                else if (strAddress.Contains("重庆重庆"))
                {
                    strAddress = strAddress.Replace("重庆重庆", "重庆");
                }
                else if (strAddress.Contains("天津天津"))
                {
                    strAddress = strAddress.Replace("天津天津", "天津");
                }
                UserExModel.Address = string.IsNullOrEmpty(UserExModel.Address) ? "暂未设置" : strAddress;
            }
            YSWL.MALL.BLL.SNS.UserShip shipBll = new YSWL.MALL.BLL.SNS.UserShip();
            if (currentUser != null)
            {
                if (currentUser.UserID == UserID.Value)
                {
                    ViewBag.IsSelf = true;
                }
                else
                {
                    if (shipBll.Exists(currentUser.UserID, UserID.Value))
                    {
                        ViewBag.IsFellow = true;
                    }
                }
            }
            return(View("_AjaxUserInfo", UserExModel));
        }
Esempio n. 7
0
        public ActionResult UserInfo()
        {
            //YSWL.Accounts.Bus.User currentUser = this.CurrentUser;
            BLL.Members.UsersExp        userEXBll = new BLL.Members.UsersExp();
            Model.Members.UsersExpModel model     = userEXBll.GetUsersModel(CurrentUser.UserID);

            ViewBag.userIP = Request.UserHostAddress;
            return(View(model));
        }
Esempio n. 8
0
 public ActionResult UserModify()
 {
     if (HttpContext.User.Identity.IsAuthenticated)
     {
         BLL.Members.UsersExp        userEXBll = new BLL.Members.UsersExp();
         Model.Members.UsersExpModel model     = userEXBll.GetUsersModel(CurrentUser.UserID);
         if (null != model)
         {
             return(View(model));
         }
     }
     return(RedirectToAction("Login", "Account"));//去登录
 }
Esempio n. 9
0
        /// <summary>
        /// 用户中心及其导航条
        /// </summary>
        /// <returns></returns>
        public PartialViewResult UserInfo(int uid = -1, string nickname = "")
        {
            YSWL.MALL.BLL.Members.Users           UserBll   = new BLL.Members.Users();
            YSWL.MALL.Model.Members.UsersExpModel UserModel = new Model.Members.UsersExpModel();
            YSWL.MALL.BLL.Ms.Regions RegionBll  = new BLL.Ms.Regions();
            YSWL.MALL.BLL.SNS.Star   starManage = new YSWL.MALL.BLL.SNS.Star();
            int ID;

            if (!string.IsNullOrEmpty(nickname) && ((ID = UserBll.GetUserIdByNickName(nickname)) > 0))
            {
                uid = ID;
            }
            //是否是发表动态页面
            ViewBag.IsPost        = uid == -1;
            ViewBag.IsCurrentUser = false;
            uid = uid > -1 ? uid : currentUser.UserID;
            if (currentUser != null && uid == currentUser.UserID)
            {
                ViewBag.IsCurrentUser = true;
            }


            UserModel = GetUserModel(uid);
            string strAddress = RegionBll.GetRegionNameByRID(Common.Globals.SafeInt(UserModel.Address, 0));

            if (strAddress.Contains("北京北京"))
            {
                strAddress = strAddress.Replace("北京北京", "北京");
            }
            else if (strAddress.Contains("上海上海"))
            {
                strAddress = strAddress.Replace("上海上海", "上海");
            }
            else if (strAddress.Contains("重庆重庆"))
            {
                strAddress = strAddress.Replace("重庆重庆", "重庆");
            }
            else if (strAddress.Contains("天津天津"))
            {
                strAddress = strAddress.Replace("天津天津", "天津");
            }
            UserModel.Address = string.IsNullOrEmpty(UserModel.Address) ? "暂未设置" : strAddress;
            //是否是达人
            ViewBag.IsStar = starManage.IsStar(uid);
            //用户等级

            YSWL.MALL.BLL.SNS.GradeConfig manage = new YSWL.MALL.BLL.SNS.GradeConfig();
            ViewBag.Level = manage.GetUserLevel(UserModel.Points);

            return(PartialView("_UserInfo", UserModel));
        }
Esempio n. 10
0
 public ActionResult Tags()
 {
     ViewBag.Title = "个人标签设置";
     if (currentUser != null)
     {
         YSWL.MALL.BLL.SNS.Tags          bTags    = new Tags();
         YSWL.MALL.BLL.SNS.TagType       bTagType = new TagType();
         List <YSWL.MALL.Model.SNS.Tags> list     = bTags.GetModelList("TypeId=" + bTagType.GetTagsTypeId("用户标签") + "");
         Model.Members.UsersExpModel     model    = bllUE.GetUsersModel(CurrentUser.UserID);
         ViewBag.UserTags = model.Remark;
         return(View(list));
     }
     return(new EmptyResult());
 }
Esempio n. 11
0
        public ActionResult AjaxAddTags(FormCollection fc)
        {
            string strTag = fc["tags"];

            if (currentUser != null && !string.IsNullOrEmpty(strTag))
            {
                Model.Members.UsersExpModel model = bllUE.GetUsersModel(CurrentUser.UserID);
                model.Remark = string.IsNullOrEmpty(model.Remark) ? strTag : model.Remark + "," + strTag;
                if (bllUE.Update(model))
                {
                    return(Content("Ok"));
                }
            }
            return(new EmptyResult());
        }
Esempio n. 12
0
 public void UpdateUserInfo(FormCollection collection)
 {
     if (!HttpContext.User.Identity.IsAuthenticated || CurrentUser == null)
     {
         RedirectToAction(ViewBag.BasePath + "Account/Login");//去登录
     }
     else
     {
         JsonObject json = new JsonObject();
         Model.Members.UsersExpModel model = bllUE.GetUsersModel(CurrentUser.UserID);
         if (null == model)
         {
             RedirectToAction("Login");//去登录
         }
         else
         {
             model.TelPhone = collection["TelPhone"];
             string birthday = collection["Birthday"];
             if (!string.IsNullOrWhiteSpace(birthday) && PageValidate.IsDateTime(birthday))
             {
                 model.Birthday = Globals.SafeDateTime(birthday, DateTime.Now);
             }
             else
             {
                 model.Birthday = null;
             }
             model.Constellation  = collection["Constellation"];  //星座
             model.PersonalStatus = collection["PersonalStatus"]; //职业
             model.Singature      = collection["Singature"];
             model.Address        = collection["Address"];
             User currentUser = new YSWL.Accounts.Bus.User(CurrentUser.UserID);
             currentUser.Sex      = collection["Sex"];
             currentUser.Email    = collection["Email"];
             currentUser.NickName = collection["NickName"];
             currentUser.Phone    = collection["Phone"];
             if (currentUser.Update() && bllUE.Update(model))
             {
                 json.Accumulate("STATUS", "SUCC");
             }
             else
             {
                 json.Accumulate("STATUS", "FAIL");
             }
             Response.Write(json.ToString());
         }
     }
 }
Esempio n. 13
0
 /// <summary>
 /// 用户域名
 /// </summary>
 /// <returns></returns>
 public ActionResult Domain()
 {
     ViewBag.Title = "个性域名 - " + (ViewBag.SiteName);
     if (!HttpContext.User.Identity.IsAuthenticated || CurrentUser == null)
     {
         return(RedirectToAction("Login", "Account")); //去登录
     }
     Model.Members.UsersExpModel model = bllUE.GetUsersModel(CurrentUser.UserID);
     if (null != model)
     {
         return(View(model));
     }
     else
     {
         return(RedirectToAction("Login", "Account")); //去登录
     }
 }
Esempio n. 14
0
        public ActionResult Main(string viewName = "Main")
        {
            ViewBag.userName = string.IsNullOrWhiteSpace(CurrentUser.TrueName) ? CurrentUser.UserName : CurrentUser.TrueName;
            uModel           = uBll.GetUsersExpModel(CurrentUser.UserID);
            if (uModel != null)
            {
                ViewBag.lastLoginDate = uModel.LastLoginTime.ToString("yyyy-MM-dd HH:mm:ss");
            }
            else
            {
                ViewBag.lastLoginDate = CurrentUser.User_dateCreate.ToString("yyyy-MM-dd HH:mm:ss");
            }
            //剩余


            return(View(viewName));
        }
Esempio n. 15
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (!string.IsNullOrWhiteSpace(CurrentUser.TrueName))
                {
                    CurrentUserName = CurrentUser.TrueName;
                }
                else
                {
                    CurrentUserName = CurrentUser.UserName;
                }
                if (DateTime.Now.Hour > 6 && DateTime.Now.Hour < 12)
                {
                    GetDateTime = "早上好";
                }
                else if (DateTime.Now.Hour >= 12 && DateTime.Now.Hour < 18)
                {
                    GetDateTime = "下午好";
                }
                else
                {
                    GetDateTime = "晚上好";
                }
                uModel = uBll.GetUsersExpModel(CurrentUser.UserID);
                if (uModel != null)
                {
                    this.LitLastLoginTime.Text = uModel.LastLoginTime.ToString("yyyy-MM-dd HH:mm:ss");
                }
                else
                {
                    this.LitLastLoginTime.Text = CurrentUser.User_dateCreate.ToString("yyyy-MM-dd HH:mm:ss");
                }

                this.lblUrl.Text = "http://" + YSWL.Common.Globals.DomainFullName + "/wcapi.aspx";

                #region 系统信息
                litProductLine.Text      = MvcApplication.ProductInfo + " " + MvcApplication.Version;
                litOperatingSystem.Text  = YSWL.Common.SystemInfo.OperatingSystemSimple;
                litServerDomain.Text     = YSWL.Common.SystemInfo.ServerDomain;
                litDotNetVersion.Text    = YSWL.Common.SystemInfo.DotNetVersion.ToString();
                litWebServerVersion.Text = YSWL.Common.SystemInfo.WebServerVersion;
                #endregion
            }
        }
Esempio n. 16
0
        public ActionResult AjaxDeleTags(FormCollection fc)
        {
            string strTag = fc["tags"];

            if (currentUser != null && !string.IsNullOrEmpty(strTag))
            {
                Model.Members.UsersExpModel model     = bllUE.GetUsersModel(CurrentUser.UserID);
                IEnumerable <string>        TagsQuery =
                    from tags in model.Remark.Split(',')
                    where tags != strTag
                    select tags;
                model.Remark = string.Join(",", TagsQuery);
                if (bllUE.Update(model))
                {
                    return(Content("Ok"));
                }
            }
            return(new EmptyResult());
        }
Esempio n. 17
0
        /// <summary>
        /// 用户中心右边信息的分布试图
        /// </summary>
        /// <returns></returns>
        public PartialViewResult ProfileLeft(int?uid)
        {
            YSWL.MALL.BLL.SNS.UserShip            shipBll   = new YSWL.MALL.BLL.SNS.UserShip();
            YSWL.MALL.BLL.Members.UsersExp        userBll   = new BLL.Members.UsersExp();
            YSWL.MALL.Model.Members.UsersExpModel userModel = new Model.Members.UsersExpModel();
            YSWL.MALL.BLL.SNS.Groups groupBll = new YSWL.MALL.BLL.SNS.Groups();
            int UserId = uid.HasValue ? uid.Value : (currentUser != null ? currentUser.UserID : 0);
            List <YSWL.MALL.Model.SNS.UserShip> ListShip        = shipBll.GetToListByFansPage(UserId, "", 0, 9);
            List <YSWL.MALL.Model.SNS.Groups>   ListGroupJoin   = groupBll.GetUserJoinGroup(UserId, 9);
            List <YSWL.MALL.Model.SNS.Groups>   ListGroupCreate = groupBll.GetModelList("CreatedUserId=" + UserId + "");

            userModel             = userBll.GetUsersExpModel(UserId);
            ViewBag.FansCount     = userModel != null ? userModel.FansCount : 0;
            ViewBag.IsCurrentUser = uid.HasValue ? false : (currentUser != null ? true : false);
            ViewBag.UserId        = UserId;
            YSWL.MALL.ViewModel.SNS.ProfileLeft model = new MALL.ViewModel.SNS.ProfileLeft();
            model.joingroupList   = ListGroupJoin;
            model.shipList        = ListShip;
            model.creategroupList = ListGroupCreate;
            return(PartialView("_ProfileLeft", model));
        }
Esempio n. 18
0
        /// <summary>
        /// 个人中心右侧信息
        /// </summary>
        /// <returns></returns>
        public PartialViewResult SelfRight()
        {
            YSWL.MALL.BLL.Members.UsersExp        userBll   = new BLL.Members.UsersExp();
            YSWL.MALL.Model.Members.UsersExpModel userModel = new Model.Members.UsersExpModel();
            YSWL.MALL.BLL.SNS.Groups          groupBll      = new YSWL.MALL.BLL.SNS.Groups();
            YSWL.MALL.BLL.SNS.UserAlbums      bllAlbums     = new YSWL.MALL.BLL.SNS.UserAlbums();
            YSWL.MALL.ViewModel.SNS.SelfRight model         = new MALL.ViewModel.SNS.SelfRight();
            model.MyGroups = groupBll.GetUserJoinGroup(currentUser.UserID, 9);

            YSWL.MALL.BLL.Ms.Regions RegionBll  = new BLL.Ms.Regions();
            YSWL.MALL.BLL.SNS.Star   starManage = new YSWL.MALL.BLL.SNS.Star();


            model.UserInfo = GetUserModel(currentUser.UserID);
            string strAddress = RegionBll.GetRegionNameByRID(Common.Globals.SafeInt(model.UserInfo.Address, 0));

            if (strAddress.Contains("北京北京"))
            {
                strAddress = strAddress.Replace("北京北京", "北京");
            }
            else if (strAddress.Contains("上海上海"))
            {
                strAddress = strAddress.Replace("上海上海", "上海");
            }
            else if (strAddress.Contains("重庆重庆"))
            {
                strAddress = strAddress.Replace("重庆重庆", "重庆");
            }
            else if (strAddress.Contains("天津天津"))
            {
                strAddress = strAddress.Replace("天津天津", "天津");
            }
            model.UserInfo.Address = string.IsNullOrEmpty(model.UserInfo.Address) ? "暂未设置" : strAddress;
            YSWL.MALL.BLL.SNS.AlbumType AlbumTypeBLL = new YSWL.MALL.BLL.SNS.AlbumType();

            model.MyAlbum = bllAlbums.GetListByUserId(currentUser.UserID, UserAlbumDetailType);

            return(PartialView("_SelfRight", model));
        }
Esempio n. 19
0
 public ActionResult Logout()
 {
     if (Session[Globals.SESSIONKEY_SUPPLIER] != null)
     {
         User currentUser = (User)Session[Globals.SESSIONKEY_SUPPLIER];
         LogHelp.AddUserLog(currentUser.UserName, currentUser.UserType, "退出系统");
         #region 更新最新的登录时间
         ColoPay.BLL.Members.UsersExp uBll   = new BLL.Members.UsersExp();
         Model.Members.UsersExpModel  uModel = new Model.Members.UsersExpModel();
         uModel = uBll.GetUsersExpModel(currentUser.UserID);
         if (uModel != null)
         {
             uModel.LastAccessIP  = Request.UserHostAddress;
             uModel.LastLoginTime = DateTime.Now;
             uBll.Update(uModel);
         }
         #endregion
     }
     FormsAuthentication.SignOut();
     Session.Remove(Globals.SESSIONKEY_SUPPLIER);
     Session.Clear();
     Session.Abandon();
     return(RedirectToAction("Login", "Account"));
 }