⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 photo.aspx.cs

📁 最好用的站点内容管理系统 全部源代码都有
💻 CS
字号:
//======================================================
//==     (c)2008 aspxcms inc by NeTCMS v1.0              ==
//==          Forum:bbs.aspxcms.com                   ==
//==         Website:www.aspxcms.com                  ==
//======================================================
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using NetCMS.Content;
using NetCMS.Model;

public partial class user_photo_photo : NetCMS.Web.UI.UserPage
{
    Photo pho = new Photo();
    Discuss dis = new Discuss();
    protected void Page_Load(object sender, EventArgs e)
    {
        Response.CacheControl = "no-cache";
        
        this.PageNavigator2.OnPageChange += new PageChangeHandler(PageNavigator2_PageChange);
        if (!Page.IsPostBack)
        {

            string PhotoID = Request.QueryString["PhotoID"];
            if (Request.QueryString["typeS"] != null && Request.QueryString["typeS"] != string.Empty)
            {
                if (pho.Delete(PhotoID.ToString()) == 0)
                {
                    PageError("删除失败!", "Photoalbumlist.aspx");
                }
                else
                {
                    PageRight("删除成功!", "Photoalbumlist.aspx");
                }
            }

            string PhotoalbumID = "";
            if (Request.QueryString["PhotoalbumID"] != null)
            {
                PhotoalbumID = Request.QueryString["PhotoalbumID"];
            }
            else 
            {
                PageError("参数传递错误", "Photoalbumlist.aspx");
            }
            DataTable dt_phopwd = pho.sel_getUserInfo(PhotoalbumID);
            int cut_phopwd = dt_phopwd.Rows.Count;
            if(cut_phopwd==0)
            {
                PageError("参数传递错误", "Photoalbumlist.aspx");
            
            }
            if (dt_phopwd.Rows[0][0].ToString() != "" && NetCMS.Global.Current.UserNum != dt_phopwd.Rows[0][1].ToString())
            {

                    this.Panel1.Visible = true;
                    this.Panel2.Visible = false;
            } 
            else
            {
                this.Panel1.Visible = false;
                this.Panel2.Visible = true;
            }
            Show_cjlist(1);
            if (this.Panel2.Visible == true)
            {
                sc.InnerHtml = Show_scs(PhotoalbumID);
            }
        }

    }
    protected void PageNavigator2_PageChange(object sender, int PageIndex2)
    {
        Show_cjlist(PageIndex2);
    }
    protected void Show_cjlist(int PageIndex2)
    {
        string PhotoalbumID=Request.QueryString["PhotoalbumID"];

        int ib, jb;
        SQLConditionInfo st = new SQLConditionInfo("@PhotoalbumID", PhotoalbumID);
        DataTable cjlistdts = NetCMS.Content.Pagination.GetPage(this.GetType().Name, PageIndex2, 18, out ib, out jb, st);

        this.PageNavigator2.PageCount = jb;
        this.PageNavigator2.PageIndex = PageIndex2;
        this.PageNavigator2.RecordCount = ib;

        if (cjlistdts.Rows.Count > 0)
        {
            cjlistdts.Columns.Add("UserNamess", typeof(string));
            cjlistdts.Columns.Add("PhotoalbumName", typeof(string));
            cjlistdts.Columns.Add("PhotoUrls", typeof(string));
            string dirDumm = NetCMS.Config.UIConfig.dirDumm;
            if (dirDumm.Trim() != "")
            {
                dirDumm = dirDumm + "/";
            }
            else 
            {
                dirDumm = "";
            }
            foreach (DataRow r in cjlistdts.Rows)
            {
                r["UserNamess"] = dis.sel_discussInfo(r["UserNum"].ToString(),0).Rows[0]["UserName"].ToString();
                r["PhotoalbumName"] = dis.sel_discussInfo(r["PhotoalbumID"].ToString(), 11).Rows[0]["PhotoalbumName"].ToString();
                r["PhotoUrls"] = r["PhotoUrl"].ToString().ToLower().Replace("{@userdirfile}", dirDumm + NetCMS.Config.UIConfig.UserdirFile);
            }
            DataList1.DataSource = cjlistdts;
            DataList1.DataBind();
        }
        else 
        {
            no.InnerHtml = Show_no();
            this.PageNavigator2.Visible = false;
        }
    }
    protected void open_Click(object sender, EventArgs e)
    {
        string PhotoalbumIDs = Request.QueryString["PhotoalbumID"];
        string pwd =Request.Form["pwd"].ToString();
        DataTable dt = pho.sel_getUserInfo(PhotoalbumIDs);
        if (dt.Rows[0][0].ToString() != NetCMS.Common.Input.MD5(pwd, true))
        {
            PageError("密码错误", "Photoalbumlist.aspx");
        }
        else
        {
            this.Panel1.Visible = false;
            this.Panel2.Visible = true;
        }
    }
    string Show_scs(string PhotoalbumIDs)
    {
        string scs = "<a href=\"photofilt.aspx?PhotoalbumID="+PhotoalbumIDs+"\" class=\"menulist\">幻灯播放</a>";
        return scs;
    }
    string Show_no()
    {
        string nos = "<table border=0 width='98%' cellpadding=\"5\" cellspacing=\"1\" class=\"table\" align=\"center\">";
        nos = nos + "<tr class='TR_BG_list'>";
        nos = nos + "<td class='navi_link'>没有数据</td>";
        nos = nos + "</tr>";
        nos = nos + "</table>";
        return nos;
    } 
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -