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

📄 photosparticular.aspx.cs

📁 企业内部的短信交流管理平台。 设计详细
💻 CS
字号:
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;

namespace Com.SMS.SMSUI
{
	/// <summary>
	/// PhotosParticular 的摘要说明。
	/// </summary>
	public class PhotosParticular : System.Web.UI.Page
	{
		protected System.Web.UI.WebControls.Image Image1;
		protected System.Web.UI.WebControls.ImageButton imbtUP;
		protected System.Web.UI.WebControls.ImageButton imbtNext;
		protected System.Web.UI.WebControls.Label lbPhotoId;
		protected System.Web.UI.WebControls.Label lbAlbum;
		protected System.Web.UI.WebControls.TextBox txtDesc;

		Entity.Photo pt;
		int pId=0;
		static int abId=0;
	
		private void Page_Load(object sender, System.EventArgs e)
		{
			// 在此处放置用户代码以初始化页面
			if(Session["User"]==null)
			{
				Response.Write("<script>alert('对不起,你没有登录');location.href='Login.aspx';</script>");
			}
			JudgePopedom();
			
			if(Request["pId"]!=null)
			{
				pId=Convert.ToInt32(Request["pId"]);
			}

			if(!this.IsPostBack)
			{
				BindPhotos();
				BindAlbum();
				abId=pt.AbId;
				this.Image1.ImageUrl=pt.PPath;
				this.txtDesc.Text=pt.PDesc;
				this.lbPhotoId.Text=pId.ToString();
			}
		}

		void JudgePopedom()
		{
			Dal.PopedomMake pdm=new Com.SMS.Dal.PopedomMake();
			Dal.UserAndPopedomMake uapm=new Com.SMS.Dal.UserAndPopedomMake();
			Entity.Popedom pd=pdm.FindByPage("PhotosParticular.aspx");
			Entity.User us=(Entity.User)Session["User"];
			DataTable dt=uapm.FindByUser(us.UserId);
			string popedom="";

			try
			{
				popedom=dt.Rows[0][2].ToString();
			}
			catch(Exception)
			{
				Response.Redirect("SysMessages.aspx?message="+this.Server.UrlEncode("对不起,你权限不够!!!"), false);
			}
			
			if(popedom.IndexOf(pd.PdId.ToString())==-1)
			{
				Response.Redirect("SysMessages.aspx?message="+this.Server.UrlEncode("对不起,你权限不够!!!"), false);
			}
		}

		void BindPhotos()
		{
			Dal.PhotosMake pm=new Dal.PhotosMake();
			pt=pm.FindById(pId);
		}

		void BindAlbum()
		{
			Dal.AlbumMake am=new Dal.AlbumMake();
			Entity.Album aa=am.FindById(pt.AbId);
			this.lbAlbum.Text=aa.AlName;
		}

		#region Web 窗体设计器生成的代码
		override protected void OnInit(EventArgs e)
		{
			//
			// CODEGEN: 该调用是 ASP.NET Web 窗体设计器所必需的。
			//
			InitializeComponent();
			base.OnInit(e);
		}
		
		/// <summary>
		/// 设计器支持所需的方法 - 不要使用代码编辑器修改
		/// 此方法的内容。
		/// </summary>
		private void InitializeComponent()
		{    
			this.imbtUP.Click += new System.Web.UI.ImageClickEventHandler(this.imbtUP_Click);
			this.imbtNext.Click += new System.Web.UI.ImageClickEventHandler(this.imbtNext_Click);
			this.Load += new System.EventHandler(this.Page_Load);

		}
		#endregion

		private void imbtUP_Click(object sender, System.Web.UI.ImageClickEventArgs e)
		{
			Dal.PhotosMake pm=new Dal.PhotosMake();
			Entity.Photo piu=pm.FindByIdUp(Convert.ToInt32(this.lbPhotoId.Text),abId);

			if(piu.PId!=0)
			{		
				this.lbPhotoId.Text=piu.PId.ToString();

				Dal.AlbumMake am=new Dal.AlbumMake();
				Entity.Album aa=am.FindById(piu.AbId);
				this.lbAlbum.Text=aa.AlName;
				this.Image1.ImageUrl=piu.PPath;
				this.txtDesc.Text=piu.PDesc;
			}
		}

		private void imbtNext_Click(object sender, System.Web.UI.ImageClickEventArgs e)
		{
			Dal.PhotosMake pm=new Dal.PhotosMake();
			Entity.Photo piu=pm.FindByIdNext(Convert.ToInt32(this.lbPhotoId.Text),abId);

			if(piu.PId!=0)
			{	
				this.lbPhotoId.Text=piu.PId.ToString();

				Dal.AlbumMake am=new Dal.AlbumMake();
				Entity.Album aa=am.FindById(piu.AbId);
				this.lbAlbum.Text=aa.AlName;
				this.Image1.ImageUrl=piu.PPath;
				this.txtDesc.Text=piu.PDesc;
			}
		}
	}
}

⌨️ 快捷键说明

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