コード例 #1
0
ファイル: PreSpecial.aspx.cs プロジェクト: suizhikuo/KYCMS
    protected void Page_Load(object sender, EventArgs e)
    {
        AdminBll.CheckMulitLogin();
        if (!string.IsNullOrEmpty(Request.QueryString["SpId"]))
        {
            try
            {
                SpId = int.Parse(Request.QueryString["SpId"]);
            }
            catch { }
        }
        if (!string.IsNullOrEmpty(Request.QueryString["P"]))
        {
            try
            {
                PageIndex = int.Parse(Request.QueryString["P"]);
            }
            catch { }
        }
        M_Special specialModel = SpId <= 0 ? null : SpecialBll.GetSpecial(SpId);

        if (specialModel == null || specialModel.IsDeleted)
        {
            Function.ShowSysMsg(0, "<li>对不起,你所访问的页面不存在</li>");
            return;
        }
        if (specialModel.IsLock)
        {
            Function.ShowSysMsg(0, "<li>该专题已被管理员锁定</li>");
        }
        AdminGroupBll.Power_Judge(3);
        B_Create bll = new B_Create();
        Response.Write(bll.GetSpecialPage(SpId, PageIndex));
    }
コード例 #2
0
ファイル: PreColumn.aspx.cs プロジェクト: suizhikuo/KYCMS
    protected void Page_Load(object sender, EventArgs e)
    {
        AdminBll.CheckMulitLogin();

        if (!string.IsNullOrEmpty(Request.QueryString["ColId"]))
        {
            try
            {
                ColId = int.Parse(Request.QueryString["ColId"]);
            }
            catch { }
        }
        if (!string.IsNullOrEmpty(Request.QueryString["P"]))
        {
            try
            {
                P = int.Parse(Request.QueryString["P"]);
            }
            catch { }
        }
        M_Column columnModel = ColumnBll.GetColumn(ColId);
        if (columnModel == null || columnModel.IsDeleted)
        {
            Function.ShowSysMsg(0, "<li>对不起,你所访问的页面不存在</li>");
            return;
        }
        AdmimGroupBll.Power_Judge(36);
        B_Create bll = new B_Create();
        Response.Write(bll.GetColumnPage(ColId, P));
    }
コード例 #3
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());
            BSinglePage.Delete(id);

            DataBaseList();
        }

        if (e.CommandName == "Create")
        {
            B_Create bcreatebll = new B_Create();
            int id = int.Parse(e.CommandArgument.ToString());

            if (bcreatebll.CreateSinglePage(id))
            {
                Response.Redirect("../Msg.aspx?Flag=1&Code=" + Function.UrlEncode("<li>生成单页信息成功!</li><li><a href='info/SinglePageList.aspx'>返回单页列表</a></li>") + "");
                Response.End();
            }
            else
            {
                Response.Redirect("../Msg.aspx?Flag=0&Code=" + Function.UrlEncode("<li>生成单页信息失败!</li><li><a href='info/SinglePageList.aspx'>返回单页列表</a></li>") + "");
                Response.End();
            }
        }
    }
コード例 #4
0
ファイル: Top.aspx.cs プロジェクト: suizhikuo/KYCMS
 public void ClearCache(string str)
 {
     B_Create createBll = new B_Create();
     B_Channel channelBll = new B_Channel();
     B_Column columnBll = new B_Column();
     channelBll.ClearCache();
     columnBll.ClearCache();
     createBll.ClearHashTable();
     GC.Collect();
 }
コード例 #5
0
ファイル: SignOut.aspx.cs プロジェクト: suizhikuo/KYCMS
    protected void Page_Load(object sender, EventArgs e)
    {
        Response.Cache.SetNoStore();
        B_User user = new B_User();

        user.ExpireCookie();

        B_Create createBll = new B_Create();
        Response.Write("<script>history.back();</script>");
    }
コード例 #6
0
ファイル: Index.aspx.cs プロジェクト: suizhikuo/KYCMS
 protected void Page_Load(object sender, EventArgs e)
 {
     B_Create bll = new B_Create();
     string url = bll.GetIndexUrl();
     if (url.ToLower().Trim().IndexOf(".htm") != -1 || url.ToLower().Trim().IndexOf(".html") != -1 || url.ToLower().Trim().IndexOf(".shtml") != -1)
     {
         Response.Redirect(url);
         return;
     }
     Response.Write(bll.GetIndexPage());
 }
コード例 #7
0
ファイル: Channel.aspx.cs プロジェクト: suizhikuo/KYCMS
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!string.IsNullOrEmpty(Request.QueryString["ChId"]))
        {
            try
            {
                ChId = int.Parse(Request.QueryString["ChId"]);
            }
            catch { }
        }
        M_Channel channelModel = ChannelBll.GetChannel(ChId);
        if (channelModel == null||channelModel.IsDeleted)
        {
            Function.ShowMsg(0,"<li>对不起,你所访问的页面不存在或已经被删除</li>");
            return;
        }
        bool isChDisabled = channelModel.IsDisabled;
        if (isChDisabled)
        {
            Function.ShowMsg(0,"<li>该频道已经被管理员禁用</li>");
            return;
        }

        B_Create bll = new B_Create();
        string url = bll.GetChannelUrl(ChId);
        if (url.ToLower().Trim().IndexOf(".htm") != -1 || url.ToLower().Trim().IndexOf(".html") != -1 || url.ToLower().Trim().IndexOf(".shtml") != -1)
        {
            Response.Redirect(url);
            return;
        }

        if (channelModel.IsOpened)
        {
            Response.Write(bll.GetChannelPage(ChId));
        }
        else
        {
            M_User logModel = UserBll.GetCookie();
            M_User userModel = UserBll.GetUser(logModel.LogName);
            M_UserGroup groupModel = GroupBll.GetModel(userModel.GroupID);
            if (GroupBll.Power_ColumnPower(ChId, 0, groupModel.ColumnPower, 2))
            {
                Response.Write(bll.GetChannelPage(ChId));
            }
            else
            {

                Function.ShowMsg(0,"<li>您所在的用户组无法访问该内容,请联系系统管理员</li>");
                return;

            }
        }
    }
コード例 #8
0
ファイル: SinglePage.aspx.cs プロジェクト: suizhikuo/KYCMS
    //保存并生成
    protected void Button2_Click(object sender, EventArgs e)
    {
        MsinglePage.Name = txtName.Text;
        MsinglePage.FolderPath = "/"+txtFolderPath.Text;
        MsinglePage.FileName = txtFileName.Text;
        MsinglePage.FileExtend = txtFileExtend.Text;
        MsinglePage.TemplatePath = txtTemplatePath.Text;
        MsinglePage.Content = txtContent.Text;
        MsinglePage.AddTime = DateTime.Now;

        if (SingleId != 0)
        {
            MsinglePage.SingleId = SingleId;
            BSinglePage.Update(MsinglePage);

            //生成
            B_Create bcreatebll = new B_Create();
            if (bcreatebll.CreateSinglePage(SingleId))
            {
                Function.ShowSysMsg(1, "<li>修改并生成单页信息成功!</li><li><a href='info/SinglePage.aspx?SingleId=" + SingleId + "'>重新修改</a> <a href='info/SinglePage.aspx'>继续添加</a> <a href='info/SinglePageList.aspx'>单页列表</a></li>");
            }
            else
            {
                Function.ShowSysMsg(0, "<li>修改并生成单页信息失败!</li><li><a href='info/SinglePage.aspx?SingleId=" + SingleId + "'>重新修改</a> <a href='info/SinglePage.aspx'>继续添加</a> <a href='info/SinglePageList.aspx'>单页列表</a></li>");
            }
        }
        else
        {
            SingleId = BSinglePage.Add(MsinglePage);

            //生成
            B_Create bcreatebll = new B_Create();
            if (bcreatebll.CreateSinglePage(SingleId))
            {
                Function.ShowSysMsg(1, "<li>添加并生成单页信息成功!</li><li><a href='info/SinglePage.aspx'>继续添加</a> <a href='info/SinglePageList.aspx'>单页列表</a></li>");
            }
            else
            {
                Function.ShowSysMsg(0, "<li>添加并生成单页信息失败!</li><li><a href='info/SinglePage.aspx'>继续添加</a> <a href='info/SinglePageList.aspx'>单页列表</a></li>");
            }
        }
    }
コード例 #9
0
ファイル: PreChannel.aspx.cs プロジェクト: suizhikuo/KYCMS
 protected void Page_Load(object sender, EventArgs e)
 {
     AdminBll.CheckMulitLogin();
     if (!string.IsNullOrEmpty(Request.QueryString["ChId"]))
     {
         try
         {
             ChId = int.Parse(Request.QueryString["ChId"]);
         }
         catch { }
     }
     M_Channel channelModel = ChannelBll.GetChannel(ChId);
     if (channelModel == null)
     {
         Function.ShowSysMsg(0, "<li>对不起,你所访问的页面不存在</li>");
         return;
     }
     GroupBll.Power_Judge(36);
     B_Create bll = new B_Create();
     Response.Write(bll.GetChannelPage(ChId));
 }
コード例 #10
0
ファイル: SignOut.aspx.cs プロジェクト: suizhikuo/KYCMS
    protected void Page_Load(object sender, EventArgs e)
    {
        //更新在线状态(最好是放到 Session_End 里面去执行)
        Response.Cache.SetNoStore();
        B_User user = new B_User();
        M_User userModel = user.GetCookie();

        B_Create createBll = new B_Create();
        bbsUserBll.LoginOut(userModel.LogName);

        user.ExpireCookie();
        bbsUserBll.ClearUserCookie();
         if (!string.IsNullOrEmpty(Request.QueryString["returnurl"]))
        {
            returnUrl = Request.QueryString["returnurl"];
        }
        if (returnUrl != string.Empty)
        {
            Response.Redirect(returnUrl);
        }
        Response.Redirect(createBll.GetIndexUrl());
    }
コード例 #11
0
ファイル: Special.aspx.cs プロジェクト: suizhikuo/KYCMS
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!string.IsNullOrEmpty(Request.QueryString["SpId"]))
     {
         try
         {
             SpId = int.Parse(Request.QueryString["SpId"]);
         }
         catch { }
     }
     if (!string.IsNullOrEmpty(Request.QueryString["P"]))
     {
         try
         {
             PageIndex = int.Parse(Request.QueryString["P"]);
         }
         catch { }
     }
     M_Special specialModel = SpId <= 0 ? null : SpecialBll.GetSpecial(SpId);
     if (specialModel == null || specialModel.IsDeleted)
     {
         Function.ShowMsg(0, "<li>对不起,你所访问的内容不存在或已经被删除</li>");
     }
     if (specialModel.IsLock)
     {
         Function.ShowMsg(0, "<li>该专题已被管理员锁定</li>");
     }
     B_Create bll = new B_Create();
     string url = bll.GetSpecialUrl(SpId, PageIndex);
     if (url.ToLower().Trim().IndexOf(".htm") != -1 || url.ToLower().Trim().IndexOf(".html") != -1 || url.ToLower().Trim().IndexOf(".shtml") != -1)
     {
         Response.Redirect(url);
         return;
     }
     Response.Write(bll.GetSpecialPage(SpId, PageIndex));
 }
コード例 #12
0
ファイル: Createing.aspx.cs プロジェクト: suizhikuo/KYCMS
    protected void CreateLastInfoRecord(int modelId)
    {
        M_InfoModel infoModelM = InfoModelBll.GetModel(modelId);                                                       //取得对应Id的模板信息
        string tableName = infoModelM.TableName;                                                                                        //取得模型的表名

        int newRecord = int.Parse(Request.QueryString["newsrecordcount"].ToString());
        B_Create CreateBll = new B_Create();

        B_SiteInfo bllSite = new B_SiteInfo();
        M_InfoSite mInfoSite = bllSite.GetInfoModel();
        int pageSize = mInfoSite.InfoCreateNum;
        int pageIndex = 1;
        int recordCount = CreateBll.LastInfoCount(tableName, newRecord);
        int pageTotl = 0;

        pageTotl = (recordCount - 1) / pageSize + 1;
        Response.Write("<script>SetTotal(" + recordCount + ")</script>\r\n");
        Response.Flush();
        string currentPer = "0.0";
        for (int crti = 1; crti <= pageTotl; crti++)
        {
            pageIndex = crti;
            DataTable dt = CreateBll.GetNewRecordNum(tableName, newRecord, pageIndex, pageSize);
            for (int i = 1; i <= dt.Rows.Count; i++)
            {
                int currIndex = pageSize * (crti - 1) + i;
                string per = ((double)currIndex * 100 / (double)recordCount).ToString("F1");
                CreateBll.CreateInfo(dt.Rows[i - 1]);
                if (currentPer != per)
                {
                    currentPer = per;
                    Response.Write("<script>SetPr('" + per + "%'," + currIndex + ")</script>\r\n");
                    Response.Flush();
                }
            }
            dt.Dispose();
        }

        Response.Write("<script>SetPr('100.0%'," + recordCount + ")</script>");
        Response.Write("<script>document.getElementById('finallytd').innerText = '生成完毕'</script>");
        Response.Flush();
        CreateBll.ClearHashTable();
    }
コード例 #13
0
ファイル: Createing.aspx.cs プロジェクト: suizhikuo/KYCMS
    protected void CreateInfoId(int modelIdNum)
    {
        M_InfoModel infoModelM = InfoModelBll.GetModel(modelIdNum);                                                       //取得对应Id的模板信息
        string tableName = infoModelM.TableName;                                                                                        //取得模型的表名

        int startId = int.Parse(Request.QueryString["startid"].ToString());
        int endId = int.Parse(Request.QueryString["endid"].ToString());
        B_Create CreateBll = new B_Create();
        B_SiteInfo bllSite = new B_SiteInfo();
        M_InfoSite mInfoSite = bllSite.GetInfoModel();
        int pageSize = mInfoSite.InfoCreateNum;
        int pageIndex = 1;
        int recordCount = 0;
        int pageTotl = 0;

        string wheStr = " and i.id in(select id from " + tableName + " where id>=" + startId + " and id<=" + endId + ") ";

        CreateBll.InfoRecordCount(tableName, wheStr, ref recordCount);

        pageTotl = (recordCount - 1) / pageSize + 1;
        Response.Write("<script>SetTotal(" + recordCount + ")</script>\r\n");
        Response.Flush();
        string currentPer = "0.0";
        for (int crti = 1; crti <= pageTotl; crti++)
        {
            pageIndex = crti;

            DataTable dt = CreateBll.GetIdRange(tableName, startId, endId, pageIndex, pageSize);
            for (int i = 1; i <= dt.Rows.Count; i++)
            {
                int currIndex = pageSize * (crti - 1) + i;
                string per = ((double)currIndex * 100 / (double)recordCount).ToString("F1");
                CreateBll.CreateInfo(dt.Rows[i - 1]);
                if (currentPer != per)
                {
                    currentPer = per;
                    Response.Write("<script>SetPr('" + per + "%'," + currIndex + ")</script>\r\n");
                    Response.Flush();
                }
            }
            dt.Dispose();
        }

        Response.Write("<script>SetPr('100.0%'," + recordCount + ")</script>");
        Response.Write("<script>document.getElementById('finallytd').innerText = '生成完毕'</script>");
        Response.Flush();
        CreateBll.ClearHashTable();
    }
コード例 #14
0
ファイル: Createing.aspx.cs プロジェクト: suizhikuo/KYCMS
    protected void CreateInfoColumn(int modelId)
    {
        M_InfoModel infoModelM = InfoModelBll.GetModel(modelId);                                                       //取得对应Id的模板信息
        string tableName = infoModelM.TableName;

        B_Create CreateBll = new B_Create();

        B_SiteInfo bllSite = new B_SiteInfo();
        M_InfoSite mInfoSite = bllSite.GetInfoModel();
        int pageSize = mInfoSite.InfoCreateNum;
        int pageIndex = 1;
        int recordCount = 0;
        int pageTotl = 0;

        string infoColId = Session["newscolumnid"].ToString();
        string wheStr = " and i.colid in(" + infoColId + ")";
        CreateBll.InfoRecordCount(tableName, wheStr,ref recordCount);

        pageTotl = (recordCount - 1) / pageSize + 1;
        Response.Write("<script>SetTotal(" + recordCount + ")</script>\r\n");
        Response.Flush();
        string currentPer = "0.0";
        for (int crti = 1; crti <= pageTotl; crti++)
        {
            pageIndex = crti;
            DataTable dt = CreateBll.GetColumnAll(tableName, infoColId,pageIndex, pageSize);
            for (int i = 1; i <= dt.Rows.Count; i++)
            {
                int currIndex = pageSize * (crti - 1) + i;
                string per = ((double)currIndex * 100 / (double)recordCount).ToString("F1");
                CreateBll.CreateInfo(dt.Rows[i - 1]);
                if (currentPer != per)
                {
                    currentPer = per;
                    Response.Write("<script>SetPr('" + per + "%'," + currIndex + ")</script>\r\n");
                    Response.Flush();
                }
            }
            dt.Dispose();
        }

        Response.Write("<script>SetPr('100.0%'," + recordCount + ")</script>");
        Response.Write("<script>document.getElementById('finallytd').innerText = '生成完毕'</script>");
        Response.Flush();
        CreateBll.ClearHashTable();
    }
コード例 #15
0
ファイル: Createing.aspx.cs プロジェクト: suizhikuo/KYCMS
    protected void CreateInfo(int modelIdNum)
    {
        M_InfoModel infoModelM = InfoModelBll.GetModel(modelIdNum);                                                       //取得对应Id的模板信息
        string tableName = infoModelM.TableName;                                                                          //取得模型的表名
        string modelName = infoModelM.ModelName;

        B_SiteInfo bllSite = new B_SiteInfo();
        M_InfoSite mInfoSite = bllSite.GetInfoModel();
        int pageSize = mInfoSite.InfoCreateNum;

        int pageIndex = 1;                                                                                                //初始化页的索引号
        int recordCount = 0;                                                                                              //统计要生成新闻的条数
        int pageTotl = 0;                                                                                                 //统计总页数

        B_Create createBll = new B_Create();
        createBll.InfoRecordCount(tableName, "", ref recordCount);

        pageTotl = (recordCount - 1) / pageSize + 1;
        Response.Write("<script>SetTotal(" + recordCount + ")</script>\r\n");
         Response.Flush();
        string currentPer = "0.0";
        for (int crti = 1; crti <= pageTotl; crti++)
        {
            pageIndex = crti;

            DataTable dt = createBll.GetInfo(tableName, pageIndex, pageSize);
            for (int i = 1; i <= dt.Rows.Count; i++)
            {
                int currIndex = pageSize * (crti - 1) + i;
                string per = ((double)currIndex * 100 / (double)recordCount).ToString("F1");
                CreateBll.CreateInfo(dt.Rows[i - 1]);
                if (currentPer != per)
                {
                    currentPer = per;
                    Response.Write("<script>SetPr('" + per + "%'," + currIndex + ")</script>\r\n");
                    Response.Flush();
                }
            }
            dt.Dispose();
        }

        Response.Write("<script>SetPr('100.0%'," + recordCount + ")</script>");
        Response.Write("<script>document.getElementById('finallytd').innerText = '生成完毕'</script>");
        Response.Flush();
        CreateBll.ClearHashTable();
    }
コード例 #16
0
ファイル: CreateNews.aspx.cs プロジェクト: suizhikuo/KYCMS
    protected void btnCreateColumn_Click(object sender, EventArgs e)
    {
        if (!SiteModel.IsStaticType)
        {
            Function.ShowSysMsg(0, "<li>全站参数设置没有开启生成静态页面功能</li><li><a href='javascript:history.back()'>返回上一页</a></li>");
        }

        string chid = ddlCh.SelectedValue;
        M_Channel channelModel = ChannelBll.GetChannel(int.Parse(chid));
        if (channelModel == null || !channelModel.IsStaticType)
        {
            Function.ShowSysMsg(0, "<li>所属频道没有开启生成静态页面功能</li><li><a href='javascript:history.back()'>返回上一页</a></li>");
        }
        string colIdStr = "";
        B_Create bll = new B_Create();
        colIdStr = Request.Form["lbColumn"].ToString();
        Session["createcolid"] = colIdStr;
        Response.Redirect("Createing.aspx?type=column");
    }
コード例 #17
0
ファイル: CreateNews.aspx.cs プロジェクト: suizhikuo/KYCMS
 protected void btnCreateChannel_Click(object sender, EventArgs e)
 {
     if (!SiteModel.IsStaticType)
     {
         Function.ShowSysMsg(0, "<li>全站参数设置没有开启生成静态页面功能</li><li><a href='javascript:history.back()'>返回上一页</a></li>");
     }
     string chIdStr = "";
     B_Create bll = new B_Create();
     for (int i = 0; i < lbChannel.Items.Count;i++ )
     {
         if(lbChannel.Items[i].Selected)
         {
             string chid = lbChannel.Items[i].Value;
             M_Channel channelModel = ChannelBll.GetChannel(int.Parse(chid));
             if (channelModel != null && channelModel.IsStaticType)
             {
                 chIdStr = chIdStr + chid + ",";
             }
         }
     }
     if (chIdStr == string.Empty)
     {
         Function.ShowSysMsg(0, "<li>所属频道没有开启生成静态页面功能</li><li><a href='javascript:history.back()'>返回上一页</a></li>");
     }
     chIdStr = chIdStr.Substring(0, (chIdStr.Length - 1));
     Session["createchid"] = chIdStr;
     Response.Redirect("Createing.aspx?type=channel&modelId="+modelId);
 }