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

📄 convocationwatchtower.aspx.cs

📁 很不错的公文流转系统
💻 CS
字号:
/**************************************************************************************
作者:蒲丰. 
创建日期:2003-11-14
修改者:
修改日期:
修改部分:
类功能: 会议管理的显示,查寻
****************************/
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;
using ZHENGYI;
namespace OI.convocation
{
	/// <summary>
	/// convocationwatchtower_ 的摘要说明。
	/// </summary>
	public class convocationwatchtower : OI.PageBase
		{
		protected System.Web.UI.WebControls.DataGrid dg;
		protected System.Web.UI.WebControls.Label LabelTitle;
		protected DataGridNavigation  divepage ;
		protected DataSet ds;
		protected System.Web.UI.HtmlControls.HtmlInputHidden findcontrol;
		protected System.Web.UI.HtmlControls.HtmlInputHidden delid;
		protected System.Web.UI.WebControls.ImageButton ImageButtonadd;
		protected System.Web.UI.HtmlControls.HtmlForm Form1;
		protected OI.DatabaseOper.DatabaseConnect Dbc=new OI.DatabaseOper.DatabaseConnect ();
		 
		
		private void Page_Load(object sender, System.EventArgs e)
		{
			if (Session["userid"]==null)
			{
				Response.Write ("<script>alert('超时,请重新登录');top.location.href='../userpass.aspx';</script>");
				return ;
			}
			 SetDivePage();
			if(Page.IsPostBack )
			{
				del();
				if (ViewState["findcontrol"].ToString () !=findcontrol.Value )
				{
					ViewState["findcontrol"]=findcontrol.Value;	
					dataBind();
				}
			}
			else
			{
		//	this.ModuleID="8F44E2FE-8091-4242-8C25-EA77C7A44978";//会议纪要编号
				ViewState["class"]=Request.QueryString ["class"].ToString ();
				//ViewState["class"]="jy";
                ViewState["findcontrol"]=findcontrol.Value ;
				title();  
				dataBind();

			}
		
		}
		private void del()
		{
			if  (delid.Value.Trim () =="")
			{
			}
			else
			{
				string sql="delete  from meetrecord where TalkID="+delid.Value.Trim ();
				Dbc.ExecuteSQL (sql);
				Page.RegisterStartupScript ("","<script>alert('己经成功删除');window.location.href='convocationwatchtower.aspx?class="+ViewState["class"].ToString ()+ "';</script>");
			
			}

          
		}
		private void title()
		{
			if (ViewState["class"].ToString()=="jy")
			{
				LabelTitle.Text ="会议纪要管理";
			}
			else if (ViewState["class"].ToString()=="jl")
			{
				LabelTitle.Text ="会议纪录管理";
			}
			else
			{
				//Page.RegisterStartupScript ("","<script>alert('')</script>");
				return ;
			}
		}
		private void CreateDataSource()
		{
			string str=" select * from meetrecord " ;
			       str +=" where MeetingTypeName='"+ ViewState["class"].ToString ()+"'";
			if( findcontrol.Value !="")
			{
				str += findcontrol.Value;
			}
			
		  
			ds=new DataSet ();
			ds=Dbc.getBinding(str,"t");
			DataColumn dc=new DataColumn ("modify",typeof(String));
            dc.Expression ="'<a href=\"convocationwatchtowerModify.aspx?id='+TalkID+'&class="+ViewState["class"].ToString ()+"\"><img src=../images/edit.gif border=0></a>'";
            ds.Tables[0].Columns .Add (dc);
			//del
			DataColumn del=new DataColumn ("del",typeof(String));
			del.Expression ="'<a href=\"#\" onclick=\"del('+TalkID+')\"><img src=../images/delete.gif border=0></a>'";
			ds.Tables[0].Columns .Add (del);
			//title
//			DataColumn title=new DataColumn ("titles",typeof(String));
//			title.Expression  ="'<a href=\"convocationwatchtowerView.aspx?id='+TalkID+'&class="+ViewState["class"].ToString ()+"\">图片</a>'";
//			ds.Tables[0].Columns .Add (title);

		}
		private void SetDivePage()
		{
			dg.AllowPaging =true; 
			dg.PageSize =5; 
			
			ZHENGYI.BindDataDelegate f =new ZHENGYI.BindDataDelegate (dataBind);//修改这个dataBind,让f 指向你的方法。 
			divepage.SetTarget(dg,f,5);
			
		}
		private void dataBind()
		{
			CreateDataSource();
			dg.DataSource =ds.Tables[0];
			dg.DataBind ();
		}

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

		}
		#endregion

		private void dg_ItemCommand(object source, System.Web.UI.WebControls.DataGridCommandEventArgs e)
		{
		    //if (e.CommandName =		

		}

		private void dg_ItemDataBound(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e)
		{
			if(e.Item .ItemType !=ListItemType.Footer && e.Item .ItemType !=ListItemType.Header )//
			{
				string s=e.Item .Cells[1].Text ;
				if(e.Item .Cells[1].Text.Length >8)
				{
					e.Item .Cells[1].Text ="<a href=convocationwatchtowerView.aspx?id="+e.Item .Cells[0].Text+" title="+s+">"+s.Substring (0,8)+ "...</a>";
				}
				else
				{
					e.Item .Cells[1].Text ="<a href=convocationwatchtowerView.aspx?id="+e.Item .Cells[0].Text +">" +s+"</a>";
				}
			}
		}

		private void ImageButton1_Click(object sender, System.Web.UI.ImageClickEventArgs e)
		{
			Response.Redirect ("convocationwatchtowerAdd.aspx?class="+ViewState["class"].ToString ());
		}

		private void dg_ItemDataBound_1(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e)
		{
		
		}

		private void ImageButtonadd_Click(object sender, System.Web.UI.ImageClickEventArgs e)
		{
			Response.Redirect ("convocationwatchtowerAdd.aspx?class="+ViewState["class"].ToString ());
		}
	}
}

⌨️ 快捷键说明

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