boguCms/App_Admin/news/NewsColInfo.aspx.cs

(开头部分) 3KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.OleDb;
using AccessDal;
using Model;
using System.IO;

public partial class App_Admin_news_NewsColInfo : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            GetPage();
        }
    }

    private void GetPage()
    {
        AspNetPager1.RecordCount = NewsColInfoOpe.GetCount();
        int StartRecord = AspNetPager1.PageSize * (AspNetPager1.CurrentPageIndex - 1);
        int MaxRecord = AspNetPager1.PageSize;
        gridIma.DataSource = NewsColInfoOpe.NewsColInfoList(StartRecord, MaxRecord);
        gridIma.DataBind();

        for (int i = 0; i < gridIma.Rows.Count; i++)
        {
            Label lblcount = (Label)gridIma.Rows[i].FindControl("lblcount");
            lblcount.Text = NewsInfoOpe.GetCountByCid(Convert.ToInt32(gridIma.DataKeys[i].Value)).ToString();
        }
    }
    protected void AspNetPager1_PageChanging(object src, Wuqi.Webdiyer.PageChangingEventArgs e)
    {
        AspNetPager1.CurrentPageIndex = e.NewPageIndex;
        GetPage();
    }
    protected void gridIma_RowDeleting(object sender, GridViewDeleteEventArgs e)
    {

        int id = Convert.ToInt32(gridIma.DataKeys[e.RowIndex].Value);
        if (NewsInfoOpe.GetCountByCid(id) != 0)
        {
            Page.RegisterStartupScript("script", "<script>alert('此新闻类内有新闻,不可删除,请删除新闻后再删除此类别')</script>");
        }
        else
        {
            for (int i = 0; i < gridIma.Rows.Count; i++)
            {
                Image imagUrl = (Image)gridIma.Rows[i].FindControl("cimg");
                NewsColInfo ni = NewsColInfoOpe.NewsColInfoItem(id);
                if (ni.CImg != "")
                {
                    NewsColInfoOpe.DeleteNewsColInfo(id);
                    File.Delete(Server.MapPath(imagUrl.ImageUrl));
                    GetPage();
                }
                else
后面还有 35 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。