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

📄 documentorder.aspx.cs

📁 很不错的公文流转系统
💻 CS
字号:
/*
作者:蒲丰. 
创建日期:2003-12-12
修改者:
修改日期:
修改部分:
类功能:  公文催办
 */
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 System.Data .SqlClient ;
using ZHENGYI;
namespace OI.ReFileOperate
{
	/// <summary>
	/// documentorder 的摘要说明。
	/// </summary>
	public class documentorder : OI.PageBase 
	{
		protected System.Web.UI.WebControls.LinkButton LinkOrder;
		protected System.Web.UI.WebControls.DataGrid dg;
		protected DataSet ds;
		protected  OI.DatabaseOper.DatabaseConnect Dbc=new OI.DatabaseOper.DatabaseConnect ();
		protected  DataGridNavigation divage ;
		private void Page_Load(object sender, System.EventArgs e)
		{
			// 在此处放置用户代码以初始化页面
			SetDivePage();
			if (Session["userid"]==null)
			{
				Response.Write ("<script>alert('超时,请重新登录');top.location.href='../userpass.aspx';</script>");
				return ;
			}
			if (!Page.IsPostBack )
			{
				dataBind();
			}
		}
		private void CreateDataSource()
		{
			string sql=" select dt.userid,dt.transactid,dt.documentid,dt.TransactSign ,";
				   sql+=" exigencedegreename,secretgreadname,documenttypename,title, ";
                   sql +=" au.username ";
                   sql +=" from documenttransact dt, view_document vd ,accounts_users au ";
			       sql += " where dt.documentid=vd.documentid ";
			       sql += " and vd.CompleteSign=0 and au.userid=dt.userid  and dt.transactsign =3  order by dt.TransactSign";
			ds=new DataSet ();
			ds=Dbc.getBinding (sql,"t");

		}
		private void SetDivePage()
		{
			dg.AllowPaging =true; 
			dg.PageSize =15; 
			
			ZHENGYI.BindDataDelegate f =new ZHENGYI.BindDataDelegate (dataBind);//修改这个dataBind,让f 指向你的方法。 
			divage.SetTarget(dg,f,15);
		}
		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.dg.ItemDataBound += new System.Web.UI.WebControls.DataGridItemEventHandler(this.dg_ItemDataBound);
			this.LinkOrder.Click += new System.EventHandler(this.LinkOrder_Click);
			this.Load += new System.EventHandler(this.Page_Load);

		}
		#endregion

		private void LinkOrder_Click(object sender, System.EventArgs e)
		{
			for (int i=0;i<dg.Items.Count ;i++)
			{
				CheckBox cb=(CheckBox)dg.Items[i].FindControl ("Ckboxcy");
				if (cb.Checked) 
				{
					SendMessage (dg.Items[i].Cells [1].Text,dg.Items[i].Cells[2].Text,dg.Items[i].Cells[3].Text ) ;
				}
			}
			Page.RegisterStartupScript ("","<script>alert('己成功完成催办');window.location.href='documentorder.aspx' ;</script>");
		}
		private void SendMessage(string documentid, string accuserid,string title)
		{
          string sql="insert message values('"+System.DateTime.Now  +"','',"+Session["userid"].ToString()+",";
			     sql +=accuserid +","+documentid+",'Document','现有"+title +"文件等待你的处理,请及时办理',0)";
          Dbc.ExecuteSQL (sql);

          //现有XXX文件等待你的处理,请及时办理,
		}

		private void dg_ItemDataBound(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e)
		{
			if(e.Item.ItemType ==ListItemType.Item  ||e.Item.ItemType ==ListItemType.AlternatingItem )
			{
				if(e.Item.Cells[3].Text =="4"  )
				{
					CheckBox cb=(CheckBox)e.Item.FindControl ("Ckboxcy");
					cb.Visible =true;
				}
				else
				{
					//e.Item.Style.Add ("color", "red");
					e.Item .Cells [9].Text ="<font color=red>"+e.Item .Cells [9].Text +"</font>";
				}
			
			if(e.Item .Cells[5].Text.Length >20)
			{
				e.Item .Cells[5].Text ="<a href=\"documentdetail.aspx?documentid="+e.Item .Cells [1].Text +"\">"+e.Item .Cells[5].Text.Substring (0,20) +"...</a>";

			}
			else
			{
				e.Item .Cells[5].Text ="<a href=\"documentdetail.aspx?documentid="+e.Item .Cells [1].Text +"\">"+e.Item .Cells[5].Text  +"</a>";
			}
	}
		}
	}
}

⌨️ 快捷键说明

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