SelectProject.aspx.cs
资源名称:OAJP.rar [点击查看]
上传用户:jdb8708888
上传日期:2013-05-29
资源大小:19971k
文件大小:3k
源码类别:
WEB源码(ASP,PHP,...)
开发平台:
C#
- 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 UDS.Components;
- using System.Data.SqlClient;
- namespace UDS.SubModule.UnitiveDocument.DocumentFlow
- {
- /// <summary>
- /// SelectProject 的摘要说明。
- /// </summary>
- public class SelectProject : System.Web.UI.Page
- {
- protected System.Web.UI.WebControls.Label Label1;
- protected System.Web.UI.WebControls.ListBox lbProject;
- protected System.Web.UI.WebControls.Button cmdOK;
- protected System.Web.UI.WebControls.Button cmdCancel;
- private string UserName;
- private long DocID;
- private long DefineID;
- private void Page_Load(object sender, System.EventArgs e)
- {
- // 在此处放置用户代码以初始化页面
- UserName = Request.Cookies["UserName"].Value.ToString();
- DocID =Int32.Parse( Request["DocID"].ToString());
- DefineID =Int32.Parse( Request["DefineID"].ToString());
- if(!Page.IsPostBack)
- Bingding();
- }
- #region Web Form Designer generated code
- override protected void OnInit(EventArgs e)
- {
- //
- // CODEGEN:该调用是 ASP.NET Web 窗体设计器所必需的。
- //
- InitializeComponent();
- base.OnInit(e);
- }
- /// <summary>
- /// 设计器支持所需的方法 - 不要使用代码编辑器修改
- /// 此方法的内容。
- /// </summary>
- private void InitializeComponent()
- {
- this.cmdOK.Click += new System.EventHandler(this.cmdOK_Click);
- this.cmdCancel.Click += new System.EventHandler(this.cmdCancel_Click);
- this.Load += new System.EventHandler(this.Page_Load);
- }
- #endregion
- private void Bingding()
- {
- SqlDataReader dr;
- Database mySQL = new Database();
- SqlParameter[] p2 = {
- mySQL.MakeInParam("@StaffName",SqlDbType.VarChar,300,UserName)
- };
- mySQL.RunProc("sp_Flow_GetParentProject",p2,out dr);
- lbProject.Items.Clear();
- while(dr.Read())
- {
- lbProject.Items.Add(new ListItem(dr["ClassName"].ToString(),dr["ClassID"].ToString()));
- }
- dr.Close();
- mySQL.Close();
- }
- private void cmdCancel_Click(object sender, System.EventArgs e)
- {
- UDS.Components.DocumentFlow df = new UDS.Components.DocumentFlow();
- df.DeleteDocument(DocID);
- df =null;
- Server.Transfer("Listview.aspx");
- }
- private void cmdOK_Click(object sender, System.EventArgs e)
- {
- if(lbProject.SelectedIndex>=0)
- {
- long ProjectID =Int32.Parse(lbProject.Items[lbProject.SelectedIndex].Value.ToString());
- UDS.Components.DocumentFlow df = new UDS.Components.DocumentFlow();
- // df.DoMessage(df.PostDocument(UserName,DocID,DefineID,ProjectID),DocID);
- df = null;
- Server.Transfer("ListDocument.aspx?DisplayType=1");
- }
- else
- {
- Response.Write("<script language='javascript'>alert('请选择一个项目!');</script>");
- }
- }
- }
- }