📄 photo_up.aspx.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;
public partial class user_photo_up : NetCMS.Web.UI.UserPage
{
Photo pho = new Photo();
public string dirPic = NetCMS.Config.UIConfig.UserdirFile;
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
if (NetCMS.Config.UIConfig.dirDumm.Trim() != "")
{
dirPic = NetCMS.Config.UIConfig.dirDumm + "/" + NetCMS.Config.UIConfig.UserdirFile;
}
string UserNum = NetCMS.Global.Current.UserNum;
string PhotoID = Request.QueryString["PhotoID"];
DataTable dt_photo = pho.sel_getUserPhoto(PhotoID);
DataTable dts1 = pho.sel_getPhotoInfo(UserNum);
this.Photoalbum.DataSource = dts1;
this.Photoalbum.DataTextField = "PhotoalbumName";
this.Photoalbum.DataValueField = "PhotoalbumID";
this.Photoalbum.DataBind();
this.PhotoName.Text = dt_photo.Rows[0]["PhotoName"].ToString();
this.PhotoContent.Text = dt_photo.Rows[0]["PhotoContent"].ToString();
if (pho.sel_getUserInfo(dt_photo.Rows[0]["PhotoalbumID"].ToString()).Rows[0]["PhotoalbumName"].ToString() != "")
{
for (int s = 0; s < this.Photoalbum.Items.Count; s++)
{
if (this.Photoalbum.Items[s].Text == pho.sel_getUserInfo(dt_photo.Rows[0]["PhotoalbumID"].ToString()).Rows[0]["PhotoalbumName"].ToString())
{
this.Photoalbum.Items[s].Selected = true;
}
}
}
pic_p_1url.Value = dt_photo.Rows[0]["PhotoUrl"].ToString();
no.InnerHtml = Show_no(dt_photo.Rows[0]["PhotoUrl"].ToString().ToLower().Replace("{@userdirfile}", dirPic));
}
}
protected void server_Click(object sender, EventArgs e)
{
if (Page.IsValid)
{
string PhotoIDs = Request.QueryString["PhotoID"];
string PhotoUrl1 = "";
PhotoUrl1 = this.pic_p_1url.Value;
string PhotoName = Request.Form["PhotoName"].ToString();
string PhotoalbumID = this.Photoalbum.SelectedValue;
string PhotoContent = Request.Form["PhotoContent"].ToString();
DateTime PhotoTime = DateTime.Now;
if (Photoalbum.SelectedValue != "")
{
if (PhotoName == null)
PhotoName = "";
if (PhotoContent == null)
PhotoContent = "";
if (PhotoUrl1 == null)
PhotoUrl1 = "";
if (pho.Update(PhotoName, PhotoTime, PhotoalbumID, PhotoContent, PhotoUrl1, PhotoIDs) < 1)
{
PageError("修改图片错误<br>", "Photoalbumlist.aspx");
}
else
{
PageRight("修改图片成功!<br>", "Photoalbumlist.aspx");
}
}
PageError("修改图片错误图片分类不能为空<br>", "");
}
}
string Show_no(string pURL)
{
string nos = "<td class=\"list_link\" ><img src=\"" + pURL + "\" width=\"90\" height=\"90\" id=\"pic_p_1\" /></td>";
return nos;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -