Пример #1
0
 public M_UserGroup GetModel(int UserGroupId)
 {
     SqlParameter[] commandParameters = new SqlParameter[] { new SqlParameter("@UserGroupId", SqlDbType.Int, 4), new SqlParameter("@Up_Id", SqlDbType.Int, 4) };
     commandParameters[0].Value = UserGroupId;
     commandParameters[1].Value = 4;
     M_UserGroup group = new M_UserGroup();
     DataSet set = SqlHelper.ExecuteDataSet(SqlHelper.ConnectionStringKy, CommandType.StoredProcedure, "Up_UserGroup", commandParameters);
     group.UserGroupId = UserGroupId;
     if (set.Tables[0].Rows.Count > 0)
     {
         group.UserGroupName = set.Tables[0].Rows[0]["UserGroupName"].ToString();
         group.UserGroupContent = set.Tables[0].Rows[0]["UserGroupContent"].ToString();
         if (set.Tables[0].Rows[0]["TypeId"].ToString() != "")
         {
             group.TypeId = int.Parse(set.Tables[0].Rows[0]["TypeId"].ToString());
         }
         group.GroupPower = set.Tables[0].Rows[0]["GroupPower"].ToString();
         group.ColumnPower = set.Tables[0].Rows[0]["ColumnPower"].ToString();
         if (set.Tables[0].Rows[0]["IsSystem"].ToString() != "")
         {
             group.IsSystem = int.Parse(set.Tables[0].Rows[0]["IsSystem"].ToString());
         }
         if (set.Tables[0].Rows[0]["AddDate"].ToString() != "")
         {
             group.AddDate = DateTime.Parse(set.Tables[0].Rows[0]["AddDate"].ToString());
         }
         return group;
     }
     return null;
 }
Пример #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 (!Page.IsPostBack)
        {
            string sURL = Request.QueryString["URL"];
            string sTitle = Request.QueryString["Title"];

            if (!(buser.IsLogin()))
            {
                Tab1.Visible = false;
                Tab2.Visible = true;

                Label1.Text = "请登陆后使用!";
                return;
            }

            M_User muser1 = buser.GetCookie();
            musergroup = busergroup.GetModel(buser.GetUser(muser1.LogName).GroupID);

            string Power=musergroup.GroupPower;

            //权限判断
            string CollectionValue=busergroup.Power_UserGroup("Collection", 0, Power);

            if (CollectionValue== "0")
            {
                Tab1.Visible = false;
                Tab2.Visible = true;
                Label1.Text = "您所在的用户组无权收藏信息!";
                return;
            }

            //获取该用户已经收录信息的条数
            DataSet ds = buserfavorite.GetList(1, 1, " where UserId=" + muser1.UserID + "");

            if (int.Parse(CollectionValue) <= int.Parse(ds.Tables[1].Rows[0][0].ToString()))
            {
                Tab1.Visible = false;
                Tab2.Visible = true;
                Label1.Text = "您收藏的信息条数已经满足所在用户组设置的最大值!";
                return;
            }

            //一切通过
            Tab1.Visible = true;
            Tab2.Visible = false;

            Url.Text = sURL;
            Title.Text = sTitle;

            ds.Clear();
            ds.Dispose();
        }
    }
Пример #4
0
 public void Update(M_UserGroup model)
 {
     SqlParameter[] commandParameters = new SqlParameter[] { new SqlParameter("@UserGroupId", SqlDbType.Int, 4), new SqlParameter("@UserGroupName", SqlDbType.NVarChar), new SqlParameter("@UserGroupContent", SqlDbType.NVarChar), new SqlParameter("@GroupPower", SqlDbType.NText), new SqlParameter("@ColumnPower", SqlDbType.NText), new SqlParameter("@IsSystem", SqlDbType.Int, 4), new SqlParameter("@AddDate", SqlDbType.DateTime), new SqlParameter("@Up_Id", SqlDbType.Int, 4) };
     commandParameters[0].Value = model.UserGroupId;
     commandParameters[1].Value = model.UserGroupName;
     commandParameters[2].Value = model.UserGroupContent;
     commandParameters[3].Value = model.GroupPower;
     commandParameters[4].Value = model.ColumnPower;
     commandParameters[5].Value = model.IsSystem;
     commandParameters[6].Value = model.AddDate;
     commandParameters[7].Value = 2;
     SqlHelper.ExecuteNonQuery(SqlHelper.ConnectionStringKy, CommandType.StoredProcedure, "Up_UserGroup", commandParameters);
 }
Пример #5
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Response.Cache.SetNoStore();
        SiteIndex = CreateBll.GetIndexUrl();
        userModel = UserBll.GetUser(UserBll.GetCookie().UserID);
        MUserGroup = BUserGroup.GetModel(userModel.GroupID);
        if (userModel != null)
        {
            MyProfile = "SetUser.aspx";
        }

        dr = UserBll.GetUserAllInfo(userModel.UserID);

        if (!IsPostBack)
        {
            BindData();
        }
    }
Пример #6
0
 public void Add(M_UserGroup model)
 {
     this.dal.Add(model);
 }
Пример #7
0
 public void Update(M_UserGroup model)
 {
     this.dal.Update(model);
 }
Пример #8
0
    protected void Page_Load(object sender, EventArgs e)
    {
        lbMessageBox.Text = "";
        UserBll.CheckIsLogin();
        LoginModel = UserBll.GetCookie();
        UserModel = UserBll.GetUser(LoginModel.UserID);
        UserGroupModel = UserGroupBll.GetModel(UserModel.GroupID);
        if (!string.IsNullOrEmpty(Request.QueryString["ChId"]))
        {
            try
            {
                ChId = int.Parse(Request.QueryString["ChId"]);
            }
            catch { }
        }
        ChannelModel = ChannelBll.GetChannel(ChId);
        if (ChannelModel == null)
        {
            return;
        }
        InfoModel = InfoModelBll.GetModel(ChannelModel.ModelType);
        if (InfoModel == null)
        {
            return;
        }
        hylnkSetInfo.Text = "添加" + ChannelModel.TypeName;
        switch (InfoModel.ModelId)
        {
            default:
                hylnkSetInfo.NavigateUrl = "AddInfo.aspx?ChId=" + ChId;
                break;
            case 1:
                hylnkSetInfo.NavigateUrl = "SetArticle.aspx?ChId=" + ChId;
                break;
            case 2:
                hylnkSetInfo.NavigateUrl = "SetImage.aspx?ChId=" + ChId;
                break;
            case 3:
                hylnkSetInfo.NavigateUrl = "SetDownLoad.aspx?ChId=" + ChId;
                break;
        }
        if (!string.IsNullOrEmpty(Request.QueryString["Status"]))
        {
            string statusText = Request.QueryString["Status"].ToLower();
            if (statusText == "all" || statusText == string.Empty)
            {
                Status = "-99";
            }
            else if (statusText == "rec")
            {
                Status = "-1";
            }
            else if (statusText == "wait")
            {
                Status = "0,1,2";
            }
            else if (statusText == "yes")
            {
                Status = "3";
            }
            else if (statusText == "no")
            {
                Status = "-2";
            }
        }

        if (!string.IsNullOrEmpty(Request.QueryString["UserCateId"]))
        {
            try
            {
                UserCateId = int.Parse(Request.QueryString["UserCateId"]);
            }
            catch { }
        }

        #region 获取搜索字段
        if (!string.IsNullOrEmpty(Request.QueryString["FieldName"]))
        {
            FieldName = Request.QueryString["FieldName"];
        }
        if (!string.IsNullOrEmpty(Request.QueryString["Keyword"]))
        {
            Keyword = Request.QueryString["Keyword"].Trim();
            if (!IsPostBack)
            {
                txtKeyword.Text = Keyword;
            }
        }
        #endregion

        if (!IsPostBack)
        {
            InitProperty();
            Bind();
            BindUserCate();
            ddlsortName.Items[0].Text = ChannelModel.TypeName + "标题";
            if (gvInfoList.Rows.Count > 0)
                gvInfoList.HeaderRow.Cells[2].Text = ChannelModel.TypeName + "标题";
        }
    }
Пример #9
0
    protected void Page_Load(object sender, EventArgs e)
    {
        //AdminBll.CheckMulitLogin();
        //AdminModel = AdminBll.GetLoginModel();
        //AdminUserModel = AdminBll.GetModel(AdminModel.UserId);

        UserBll.CheckIsLogin();
        UserModel = UserBll.GetUser(UserBll.GetCookie().LogName);
        UserGroupModel = UserGroupBll.GetModel(UserModel.GroupID);

        if (!string.IsNullOrEmpty(Request.QueryString["ChId"]))
        {
            try
            {
                ChannelId = int.Parse(Request.QueryString["ChId"]);
            }
            catch { }
        }

        ChannelModel = ChannelId <= 0 ? null : ChannelBll.GetChannel(ChannelId);
        MInfoModel = BInfoModel.GetModel(ChannelModel.ModelType);

        if (!Page.IsPostBack)
        {
            txtTemplatePath.Attributes.Add("readonly", "");

            if (!ColumnBll.ChkHasColumnByChId(ChannelId))
            {
                Function.ShowMsg(0, "<li>本频道下没有栏目,不能添加信息!请联系站点管理员</li><li><a href='javascript:window.history.back()'>返回上一步</a></li>");
            }

            if (!string.IsNullOrEmpty(Request.QueryString["ColId"]))
            {
                try
                {
                    ColumnId = int.Parse(Request.QueryString["ColId"]);
                }
                catch { }
            }

            //litNav.Text = ChannelModel.TypeName + " 管理 &gt;&gt; <a href='InfoList.aspx?ChId=" + ChannelId + "'>站点" + ChannelModel.TypeName + "列表</a> &gt;&gt; 设置" + ChannelModel.TypeName;

            //绑定自定义字段
            ModelHtml.Text = MInfoModel.ModelHtml;

            FilePicPath.Text = MInfoModel.UploadPath + "|" + MInfoModel.UploadSize.ToString();

            TableName = MInfoModel.TableName;

            BindSpeacil();
            BindGroup();
            UserCateBound();
        }
    }
Пример #10
0
    //显示数据
    private void ShowDateList()
    {
        string TypeId = Request.QueryString["TypeId"];
        string UserGroupId = Request.QueryString["id"];

        if (UserGroupId == "" || UserGroupId == null)
        {
            Response.Redirect("GroupList.aspx");
            Response.End();
        }

        MUserGroup = BUserGroup.GetModel(int.Parse(UserGroupId));
        string GroupPower = MUserGroup.GroupPower;

        UserGroupName.Text = MUserGroup.UserGroupName;
        UserGroupContent.Text = MUserGroup.UserGroupContent;

        #region 投稿
        Contribute_0.Text = BUserGroup.Power_UserGroup("Contribute", 0, GroupPower);
        #endregion

        Status.SelectedValue = BUserGroup.Power_UserGroup("Status", 0, GroupPower);

        //收藏
        Collection.Text = BUserGroup.Power_UserGroup("Collection", 0, GroupPower);

        //邀请
        Invite.Text = BUserGroup.Power_UserGroup("Invite", 0, GroupPower);

        //发布稿件
        IssueManuscript.Text = BUserGroup.Power_UserGroup("IssueManuscript", 0, GroupPower);

        //计费方式
        ChargingType.SelectedValue = BUserGroup.Power_UserGroup("ChargingType", 0, GroupPower);

        #region 扣费方式
        SmashMoney.Text = BUserGroup.Power_UserGroup("SmashMoney", 0, GroupPower);
        #endregion
    }
Пример #11
0
    /// <summary>
    /// 根据条件返回 checkbox
    /// </summary>
    /// <param name="ChId"></param>
    /// <param name="ColId"></param>
    /// <param name="TableNum"></param>
    /// <param name="ColNum"></param>
    /// <returns></returns>
    public string GetTextBoxHtml(int ChId, int ColId, int TableNum, int ColNum)
    {
        string UserGroupId = Request.QueryString["id"];

        if (UserGroupId == "" || UserGroupId == null)
        {
            Response.Redirect("GroupList.aspx");
            Response.End();
        }

        MUserGroup = BUserGroup.GetModel(int.Parse(UserGroupId));
        string ColumnPower = MUserGroup.ColumnPower;

        #region 返选频道
        string MyTextBox = "<input type='checkbox' name='ChIdColumnId_" + TableNum + "_" + ColNum + "' value='1' onclick='SelectCancelUser(" + ColNum + "," + TableNum + ")'>";

        if (BUserGroup.Power_ColumnPower(ChId, ColId, ColumnPower, ColNum))
        {
            MyTextBox = "<input type='checkbox' name='ChIdColumnId_" + TableNum + "_" + ColNum + "' value='1' onclick='SelectCancelUser(" + ColNum + "," + TableNum + ")' checked>";
        }

        return MyTextBox;
        #endregion
    }
Пример #12
0
    protected void Page_Load(object sender, EventArgs e)
    {
        //判断用户信息是否合法
        LoginModel = UserBll.GetCookie();
        UserModel = UserBll.GetUser(LoginModel.UserID);
        if (UserModel == null)
        { Response.Redirect("Login.aspx"); }

        UserGroupModel = UserGroupBll.GetModel(UserModel.GroupID);
        int UserId = UserModel.UserID;
        //say hello
        int time = DateTime.Now.ToLocalTime().Hour;
        string prefix = "";
        if (time > 0 && time <= 5)
        { prefix = "凌晨"; }
        else if (time > 5 && time <= 12)
        { prefix = "上午"; }
        else if (time > 12 && time <= 18)
        { prefix = "下午"; }
        else if (time > 18 && time <= 24)
        { prefix = "晚上"; }
        lbHello.Text = prefix+"好,"+UserModel.LogName;
        //是否显示密码保护提示
        if (string.IsNullOrEmpty(UserModel.Question))
        {
            lbRed.Text = "<li>&nbsp;您尚未设置密码保护&nbsp;<a href=\"changeQA.aspx\" target=\"ContentIframe\">[设置]</a></li>";
            redInfo.Visible = true;
        }
        //获取未读短消息
        int msgNum = Convert.ToInt32(MessageBll.GetList(1, 100000, "where IsSend=1 and ReceiverDel=0 and IsRead=0 and ReceiverId='" + UserModel.UserID + "'").Tables[1].Rows[0][0]);
        if (msgNum > 0)
        {
            lbBlue.Text += "<li>&nbsp;您有 " + msgNum + " 条未读短消息&nbsp;<a href=\"Message/MessageList.aspx?TypeId=1\" target=\"ContentIframe\">[读取]</a></li>";
        }
        int feedNum = Convert.ToInt32(FeedBll.GetList(1000000, 1, "author='"+UserModel.LogName+"' and [EndDate]<=getDate() and state=0").Tables[1].Rows[0][0]);
        if (feedNum > 0)
        {
            lbBlue.Text += "<li>&nbsp;您有 " + feedNum + " 条到期问答&nbsp;<a href=\"MyFeedback.aspx\" target=\"ContentIframe\">[查看]</a></li>";
        }
        //显示提示框
        if (lbBlue.Text != "")
        { blueInfo.Visible = true; }
        if (!IsPostBack)
        {
            GroupName.Text = UserGroupModel.UserGroupName;
            lbLoingTime.Text = UserModel.LastLoginTime.ToShortDateString();
            lbLoginIp.Text = UserModel.LastLoginIP;
            YellowBoy.Text = UserModel.YellowBoy.ToString();
            Integral.Text = UserModel.Integral.ToString();
            Label3.Text = BReview.ReviewList(0, 0, "where UserNum=" + UserId + "").Tables[1].Rows[0][0].ToString();
            Label4.Text = BReview.ReviewList(0, 0, "where UserNum=" + UserId + " and IsCheck=0").Tables[1].Rows[0][0].ToString();
            int publishInfoSumCount = 0;
            int waitInfoSumCount = 0;
            DataTable modelDt = InfoModelBll.GetList();
            foreach (DataRow dr in modelDt.Rows)
            {
                int waitInfoCount = 0;
                int publishInfoCount = 0;
                string tableName = dr["TableName"].ToString();
                InfoOperBll.GetUserInfoList(tableName, UserId, "", "", 0, "0", "-2,0,1,2,3", "", "", "", -1, 1, 5, ref publishInfoCount);
                InfoOperBll.GetUserInfoList(tableName, UserId, "", "", 0, "0", "0", "", "", "", -1, 1, 0, ref waitInfoCount);
                publishInfoSumCount += publishInfoCount;
                waitInfoSumCount += waitInfoCount;
            }
            Label1.Text = publishInfoSumCount.ToString();
            Label2.Text = waitInfoSumCount.ToString();
        }
    }
Пример #13
0
    /// <summary>
    /// 删除单一记录
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void Repeater1_ItemCommand(object sender, RepeaterCommandEventArgs e)
    {
        if (e.CommandName == "Delete")
        {
            int id = int.Parse(e.CommandArgument.ToString());
            BUserGroup.Delete(id);

            DataBaseList();
        }

        if (e.CommandName == "DefaultGroup")
        {
            int id = int.Parse(e.CommandArgument.ToString());
            MUserGroup = BUserGroup.GetModel(id);

            M_UserGroupModel model = BUserGroupModel.GetModel(MUserGroup.TypeId);

            BUserGroupModel.UpdateUserGroupId(MUserGroup.TypeId, id);

            Function.ShowSysMsg(1, "<li>成功设置默认注册组</li><li><a href='javascript:window.history.back(-1)'>返回上一步</a> <a href='user/GroupList.aspx'>返回模型管理列表</a></li>");
        }
    }
Пример #14
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Response.Cache.SetNoStore();
        if (!string.IsNullOrEmpty(Request.QueryString["ColorId"]))
        {
            ColorId = Convert.ToInt32(Request.QueryString["ColorId"]);
        }
        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>");
        }
        UserInfoDr = UserBll.GetUserAllInfo(UserModel.UserID);
        if(UserInfoDr==null)
        {
            Function.ShowMsg(0, "<li>用户空间参数错误</li><li><a href='javascript:history.back();'>返回上一级</a></li>");
        }
        int spaceTypeId = int.Parse(UserInfoDr["spacetypeid"].ToString());
        if (spaceTypeId != 1)
            Function.ShowMsg(0, "<li>用户空间参数错误</li><li><a href='javascript:history.back();'>返回上一级</a></li>");
        B_UserSpace.IsActive(UserModel.UserID, 2);
        UserGroupModel = UserGroupBll.GetModel(UserModel.GroupID);
        GroupName = UserGroupModel.UserGroupName;
        if (Request.Cookies["SpacePwd"] != null)
        {
            if (Request.Cookies["SpacePwd"]["UserId"] != UserModel.UserID.ToString())
            {
                Response.Cookies["SpacePwd"].Expires = DateTime.Now.AddDays(-1);
            }
        }
        SpaceModel = SpaceBll.GetUserSpaceById(UserModel.UserID);
        if (SpaceModel.TemplateId >= 18 && SpaceModel.TemplateId <= 24)
            StyleCss = "<link rel='stylesheet' type='text/css' href='skin/Space" + SpaceModel.TemplateId + ".css' />";
        else
            StyleCss = "<link rel='stylesheet' type='text/css' href='skin/Space18.css' />";
        SpaceName = SpaceModel.SpaceName;
        if (!IsPostBack)
        {
            SpacePrevPower();
            B_SiteInfo siteInfo = new B_SiteInfo();
            M_Site siteModel = siteInfo.GetSiteModel();
            lbCopyRight.Text = siteModel.CopyRight;
            repMyInfoBind();
            repMessageBind();
            repFriendBind();
            repAlbum();

        }

        AjaxPro.Utility.RegisterTypeForAjax(typeof(userspace_SpaceTemplate));
    }
Пример #15
0
    protected void Page_Load(object sender, EventArgs e)
    {
        //AdminBll.CheckMulitLogin();
        //AdminModel = AdminBll.GetLoginModel();
        //AdminUserModel = AdminBll.GetModel(AdminModel.UserId);
        AjaxPro.Utility.RegisterTypeForAjax(typeof(user_info_UpdateInfo));

        UserBll.CheckIsLogin();
        UserModel = UserBll.GetUser(UserBll.GetCookie().LogName);
        UserGroupModel = UserGroupBll.GetModel(UserModel.GroupID);

        if (!string.IsNullOrEmpty(Request.QueryString["ChId"]))
        {
            try
            {
                ChannelId = int.Parse(Request.QueryString["ChId"]);
            }
            catch { }
        }

        ChannelModel = ChannelId <= 0 ? null : ChannelBll.GetChannel(ChannelId);
        MInfoModel = BInfoModel.GetModel(ChannelModel.ModelType);

        Id = int.Parse(Request.QueryString["Id"]);
        drInfo = BInfoOper.GetInfo(MInfoModel.TableName, Id);

        if (!Page.IsPostBack)
        {
            txtTemplatePath.Attributes.Add("readonly", "");

            if (!ColumnBll.ChkHasColumnByChId(ChannelId))
            {
                Function.ShowMsg(0, "<li>本频道下没有栏目,不能添加信息!</li><li>建议您先添加栏目</li><li><a href='info/SetColumn.aspx?ChId=" + ChannelId + "'>添加栏目</a> <a href='info/ColumnList.aspx?ChId=" + ChannelId + "'>栏目管理</a></li>");
            }

            if (!string.IsNullOrEmpty(Request.QueryString["ColId"]))
            {
                try
                {
                    ColumnId = int.Parse(Request.QueryString["ColId"]);
                }
                catch { }
            }

            //litNav.Text = ChannelModel.TypeName + " 管理 &gt;&gt; <a href='InfoList.aspx?ChId=" + ChannelId + "'>站点" + ChannelModel.TypeName + "列表</a> &gt;&gt; 设置" + ChannelModel.TypeName;

            //绑定自定义字段
            ModelHtml.Text = MInfoModel.ModelHtml;

            FilePicPath.Text = MInfoModel.UploadPath + "|" + MInfoModel.UploadSize.ToString();

            TableName = MInfoModel.TableName;

            BindSpeacil();
            BindGroup();
            UserCateBound();

            //赋值
            GetShow();
        }
    }
Пример #16
0
 protected void Page_Load(object sender, EventArgs e)
 {
     litMsg.Text = "";
     UserBll.CheckIsLogin();
     UserModel = UserBll.GetUser(UserBll.GetCookie().LogName);
     UserGroupModel = UserGroupBll.GetModel(UserModel.GroupID);
     SiteModel = SiteBll.GetSiteModel();
     if (SiteModel == null)
         Function.ShowMsg(0, "<li>全站参数获取错误</li><li><a href='javascript:history.back()'>返回上一级</a></li>");
     if (!string.IsNullOrEmpty(Request.QueryString["Id"]))
     {
         try
         {
             Id = Convert.ToInt32(Request.QueryString["Id"]);
         }
         catch { }
     }
     if (!string.IsNullOrEmpty(Request.QueryString["ChId"]))
     {
         ChId = int.Parse(Request.QueryString["ChId"]);
     }
     ChannelModel = ChId <= 0 ? null : ChannelBll.GetChannel(ChId);
     if (ChannelModel == null || ChId < 0)
         Function.ShowMsg(0, "<li>频道参数错误</li><li><a href='javascript:history.back()'>返回上一级</a></li>");
     if (!UserGroupBll.Power_ColumnPower(ChId, 0, UserGroupModel.ColumnPower, 3))
         Function.ShowMsg(0, "<li>本频道没有添加" + ChannelModel.TypeName + "的权限</li><li><a href='javascript:history.back()'>返回上一级</a></li>");
     if (!ColumnBll.ChkHasColumnByChId(ChId))
         Function.ShowMsg(0, "<li>本频道下没有栏目,不能添加" + ChannelModel.TypeName + "</li><li><a href='javascript:history.back()'>返回上一级</a></li>");
     if (!string.IsNullOrEmpty(Request.QueryString["ColId"]))
         ColId = Convert.ToInt32(Request.QueryString["ColId"]);
     ColumnModel = ColId <= 0 ? null : ColumnBll.GetColumn(ColId);
     if (ColId > 0 && ColumnModel == null)
         Function.ShowMsg(0, "<li>所选栏目不存在或已经被删除</li><li><a href='javascript:history.back()'>返回上一级</a></li>");
     B_InfoModel infoModelBll = new B_InfoModel();
     M_InfoModel infoModel = infoModelBll.GetModel(ChannelModel.ModelType);
     FilePicPath.Text = infoModel.UploadPath + "|" + infoModel.UploadSize.ToString();
     if (!IsPostBack)
     {
         UserCateBound();
         ddlBind();
         if (Id > 0)
             ShowInfo(Id);
     }
 }
Пример #17
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            //登陆
            MUser = BUser.GetCookie();
            //系统公告
            rptNotice.DataSource = BNotice.GetTop(5);
            rptNotice.DataBind();

            M_User UserModel = new M_User();
            UserModel = BUser.GetUser(MUser.UserID);

            int UserId = UserModel.UserID;
            int GroupId = UserModel.GroupID;

            MUserGroup = BUserGroup.GetModel(GroupId);
            MyProfile ="SetUser.aspx";

            //系统参数
            MSite = BSiteInfo.GetSiteModel();

            int publishInfoSumCount = 0;
            int waitInfoSumCount = 0;
            DataTable dtInfo = new DataTable();
            dtInfo.Columns.Add("RowIndex", typeof(int));
            dtInfo.Columns.Add("Title", typeof(string));
            dtInfo.Columns.Add("Id", typeof(int));
            dtInfo.Columns.Add("AddTime", typeof(DateTime));
            DataTable modelDt = InfoModelBll.GetList();

            int rowIndex = 0;
            foreach (DataRow dr in modelDt.Rows)
            {
                int publishInfoCount = 0;
                int waitInfoCount = 0;
                string tableName = dr["TableName"].ToString();
                DataTable dt = InfoOperBll.GetUserInfoList(tableName, UserId, "", "", 0, "0", "-2,0,1,2,3", "", "", "", -1, 1, 5, ref publishInfoCount);
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    DataRow dr2 = dt.Rows[i];
                    DataRow tempdr2 = dtInfo.NewRow();
                    tempdr2["RowIndex"] = rowIndex;
                    rowIndex++;
                    tempdr2["Title"] = dr2["Title"];
                    tempdr2["Id"] = dr2["Id"];
                    tempdr2["AddTime"] = dr2["AddTime"];
                    dtInfo.Rows.Add(tempdr2);
                }
                dt.Dispose();
                publishInfoSumCount += publishInfoCount;
                dt = InfoOperBll.GetUserInfoList(tableName, UserId, "", "", 0, "0", "0", "", "", "", -1, 1, 0, ref waitInfoCount);
                dt.Dispose();
                waitInfoSumCount += waitInfoCount;

            }

            DataView dv = new DataView(dtInfo);
            dv.Sort = "AddTime Desc";
            dv.RowFilter = "RowIndex<5";
            Repeater2.DataSource = dv;
            Repeater2.DataBind();
            dv.Dispose();

            //好友
            int total = 0;
            Repeater4.DataSource = BUser.ListGroupMember("KyUserFriend.UserId=" + UserId + " and FriendGroupId!=2", 5, 1, ref total);
            Repeater4.DataBind();

            DataTable cdt = new DataTable();
            cdt = BCustomForm.GetAll();

            cdt.DefaultView.RowFilter = "ShowForm=1";
            Rep_CustomForm.DataSource = cdt;
            Rep_CustomForm.DataBind();

            cdt.Clear();
            cdt.Dispose();

            //留言
            int recordCount = 0;
            DataTable mdt = UserMessageBll.GetMessageByUserId(UserModel.UserID, 1, 100000, ref recordCount);
            rptMsg.DataSource = mdt;
            rptMsg.DataBind();

            //投稿
            SetUserInfoNav();

        }
    }