예제 #1
0
 public static void IsActive(int userId, int flag)
 {
     B_UserSpace space = new B_UserSpace();
     if ((space.GetUserSpaceById(userId) == null) && (flag == 1))
     {
         Function.ShowMsg(0, "<li>无法访问,该空间还未激活</li><li><a href='" + Param.ApplicationRootPath + "/user/space/RegSpace.aspx' target='ContentIframe' onclick='javascript:window.close();'>立即激活空间</a></li><li><a href='" + Param.ApplicationRootPath + "/user/welcome.aspx'>返回会员首页</a></li>");
     }
     else if ((space.GetUserSpaceById(userId) == null) && (flag == 2))
     {
         Function.ShowMsg(0, "<li>该空间不存在或尚未激活</li><li><a href='" + Param.ApplicationRootPath + "/user/space/RegSpace.aspx' target='ContentIframe' onclick='javascript:window.close();'>立即激活空间</a></li><li><a href='" + Param.ApplicationRootPath + "/index.aspx'>返回网站首页</a></li><li><a href='javascript:window.close()'>关闭窗口</a></li>");
     }
 }
예제 #2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!string.IsNullOrEmpty(Request.QueryString["UserName"]))
     {
         UserName = Request.QueryString["UserName"];
     }
     UserModel = UserBll.GetUser(UserName);
     if (UserModel == null)
         Function.ShowMsg(0, "<li>用户空间参数错误</li><li><a href='javascript:history.back();'>返回上一级</a></li>");
     B_UserSpace.IsActive(UserModel.UserID, 2);
     B_UserSpace spaceBll = new B_UserSpace();
     M_UserSpace spaceModel = spaceBll.GetUserSpaceById(UserModel.UserID);
     Page.Title = spaceModel.SpaceName + "--我的稿件列表";
     UserGroupModel = UserGroupBll.GetModel(UserModel.GroupID);
     if (!string.IsNullOrEmpty(Request.QueryString["ModelId"]))
     {
         ModelId = int.Parse(Request.QueryString["ModelId"]);
     }
     if (ModelId < 0)
         Function.ShowMsg(0, "<li>模型参数错误!</li><li><a href='javascript:history.back();'>返回上一级</a></li>");
     if (!IsPostBack)
     {
         repModelBind();
         if (ModelId > 0)
             repContentListBind(ModelId);
     }
 }
예제 #3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!string.IsNullOrEmpty(Request.QueryString["UserName"]))
        {
            UserName = Request.QueryString["UserName"];
        }
        UserModel = UserBll.GetUser(UserName);
        if (UserModel == null)
        {
            Function.ShowMsg(0, "<li>用户空间参数错误</li><li><a href='javascript:history.back();'>返回上一级</a>");
        }
        B_UserSpace.IsActive(UserModel.UserID, 2);
        B_UserSpace spaceBll = new B_UserSpace();
        M_UserSpace spaceModel = spaceBll.GetUserSpaceById(UserModel.UserID);
        Page.Title = spaceModel.SpaceName + "--我的好友列表";

        if (!IsPostBack)
        {
            repFriendBind();
        }
    }
예제 #4
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!string.IsNullOrEmpty(Request.QueryString["UId"]) && !string.IsNullOrEmpty(Request.QueryString["UserName"]))
        {
            UId = Convert.ToInt32(Request.QueryString["UId"]);
            UserName = Convert.ToString(Request.QueryString["UserName"]);
            if (UserBll.GetUser(UserName) != null && UserBll.GetUser(UId) != null)
            {
                if (UId != UserBll.GetUser(UserName).UserID)
                {
                    Function.ShowMsg(0, "<li>空间参数错误</li><li><a href='javascript:history.back();'>返回上一级</a></li>");
                }
                else
                    UIdflag = true;
            }
            else
            {
                if (UserBll.GetUser(UId) == null)
                    UNameflag = true;
                else if(UserBll.GetUser(UserName) == null)
                    UIdflag=true;
                else
                    Function.ShowMsg(0, "<li>空间参数错误</li><li><a href='javascript:history.back();'>返回上一级</a></li>");
            }
        }
        if (!string.IsNullOrEmpty(Request.QueryString["UId"]) && string.IsNullOrEmpty(Request.QueryString["UserName"]))
        {
            UId = Convert.ToInt32(Request.QueryString["UId"]);
            UIdflag = true;
        }
        else if (string.IsNullOrEmpty(Request.QueryString["UId"]) && !string.IsNullOrEmpty(Request.QueryString["UserName"]))
        {
            UserName = Convert.ToString(Request.QueryString["UserName"]);
            UNameflag = true;
        }

        if (UIdflag)
        {
            UserModel = UserBll.GetUser(UId);
            picPath = "../";
        }
        else if (UNameflag)
            UserModel = UserBll.GetUser(UserName);

        if (UserModel == null)
            Function.ShowMsg(0, "<li>空间参数错误</li><li><a href='javascript:history.back();'>返回上一级</a></li>");

        if (!string.IsNullOrEmpty(Request.QueryString["AlbumId"]))
        {
            AlbumId = Convert.ToInt32(Request.QueryString["AlbumId"]);
        }
        B_UserSpace.IsActive(UserModel.UserID, 2);
        B_UserSpace spaceBll = new B_UserSpace();
        M_UserSpace spaceModel = spaceBll.GetUserSpaceById(UserModel.UserID);
        Page.Title = spaceModel.SpaceName + "--相册/照片列表";
        if (!IsPostBack)
        {
            repAblumBind();
            if (AlbumId > 0)
            {
                AlbumModel = AlbumBll.GetAlbumById(AlbumId, UserModel.UserID);
                PwdStr = AlbumModel.AlbumPassword;
                if (AlbumModel == null)
                    Function.ShowMsg(0, "<li>用户相册参数错误</li><li><a href='javascript:history.back();'>返回上一级</a></li>");
                string whereStr = "KyUserFriend.UserId=" + UserModel.UserID.ToString() + " and FriendGroupId!=2";
                int total = 0;
                DataTable dt = UserBll.ListGroupMember(whereStr, 1000, 1, ref total);
                if (!UserBll.IsLogin())
                {
                    if (AlbumModel.IsOpened == 2)
                    {
                        IsFriend.Visible = true; divPage.Visible = false;
                    }
                    else if (AlbumModel.IsOpened == 0)
                    {
                        if (HttpContext.Current.Request.Cookies["AlbumPwd" + AlbumId.ToString()] != null)
                        {
                            if (HttpContext.Current.Request.Cookies["AlbumPwd" + AlbumId.ToString()].Value != AlbumId.ToString())
                            {
                                ShowPwd.Visible = true;
                                divPage.Visible = false;
                            }
                            else { repPhotoBind(); }
                        }
                        else
                        { ShowPwd.Visible = true; divPage.Visible = false; }
                    }
                    else
                    {
                        repPhotoBind();
                    }
                }
                else
                {
                    if (AlbumModel.IsOpened == 0 && UserBll.GetCookie().UserID != UserModel.UserID)
                    {
                        if (HttpContext.Current.Request.Cookies["AlbumPwd" + AlbumId.ToString()] != null)
                        {
                            if (HttpContext.Current.Request.Cookies["AlbumPwd" + AlbumId.ToString()].Value != AlbumId.ToString())
                            {
                                ShowPwd.Visible = true; divPage.Visible = false;
                            }
                            else { repPhotoBind(); }
                        }
                        else
                        { ShowPwd.Visible = true; divPage.Visible = false; }
                    }
                    else if (AlbumModel.IsOpened == 2 && UserBll.GetCookie().UserID != UserModel.UserID)
                    {
                        bool flag = false;
                        if (dt.Rows.Count <= 0)
                            flag = false;
                        else
                        {
                            for (int i = 0; i < dt.Rows.Count; i++)
                            {
                                if (UserBll.GetCookie().UserID == int.Parse(dt.Rows[i]["FriendId"].ToString()))
                                    flag = true;
                            }
                        }
                        if (!flag)
                        { IsFriend.Visible = true; divPage.Visible = false; }
                        else
                        { repPhotoBind(); ShowPwd.Visible = false; IsFriend.Visible = false; }
                    }
                    else { repPhotoBind(); }
                }

            }
        }

        AjaxPro.Utility.RegisterTypeForAjax(typeof(userspace_Album));
    }