Task.aspx.cs
资源名称:yjal.rar [点击查看]
上传用户:shjujing
上传日期:2022-07-28
资源大小:11244k
文件大小:5k
源码类别:
Email客户端
开发平台:
Visual C++
- 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 System.Data.SqlClient;
- public partial class Module_Employee_ProRes_DeptTask : System.Web.UI.Page
- {
- protected void Page_Load(object sender, EventArgs e)
- {
- if (Session["UserName"] != null)
- {
- if (Session["Popedom"].ToString() == "0")
- {
- this.lnkbtnAdd.Visible = true;
- }
- }
- else
- {
- Response.Write("<script language=javascript>top.location.href='../../Index.aspx'</script>");
- }
- SqlData da = new SqlData();
- if (!IsPostBack)
- {
- string cmdtxt1 = "select Distinct Name from tb_User";
- string cmdtxt2 = "select Distinct DepName from tb_Department";
- SqlCommand Com1 = new SqlCommand(cmdtxt1, da.ExceCon());
- SqlDataReader dr1 = Com1.ExecuteReader();
- while (dr1.Read())
- {
- this.dropRePro.Items.Add(dr1["Name"].ToString());
- }
- dr1.Close();
- SqlCommand Com2 = new SqlCommand(cmdtxt2, da.ExceCon());
- SqlDataReader dr2 = Com2.ExecuteReader();
- while (dr2.Read())
- {
- this.dropAcceptPro.Items.Add(dr2["DepName"].ToString());
- }
- dr2.Close();
- }
- string cmdtxt3 = "select * from tb_DepTask";
- da.BindData(this.GridView1, cmdtxt3, "tb_DepTask");
- }
- protected void btnOK_Click(object sender, EventArgs e)
- {
- SqlData da = new SqlData();
- string cmdtxt = "INSERT INTO tb_DepTask(TaskDescription,DepName,ReleaseTime,StartTime,EndTime,IsMain,ReleasePerson,CompletePitch)";
- cmdtxt += " VALUES('"+this.txtDescription.Text+"','"+this.dropAcceptPro.SelectedValue+"','"+DateTime.Now+"','"+this.txtStartTime.Text+"'";
- cmdtxt += ",'" + this.txtEndTime.Text + "','" + this.dropImport.SelectedValue + "','" + this.dropRePro.SelectedValue + "','" + this.txtComPitch.Text + "')";
- if (da.ExceSQL(cmdtxt))
- {
- Response.Write("<script language=javascript>alert('操作成功!');location='Task.aspx'</script>");
- CommonClass.WriteNote(this.txtDescription.Text, 0, Session["UserName"].ToString());
- }
- else
- {
- Response.Write("<script language=javascript>alert('操作失败!')</script>");
- }
- }
- protected void btnFind_Click(object sender, EventArgs e)
- {
- if (this.txtKeyWord.Text == "")
- {
- Response.Write("<script language=javascript>alert('关键字不能为空!');location='Task.aspx'</script>");
- return;
- }
- SqlData da = new SqlData();
- string search = this.dropClass.SelectedValue;
- switch (search)
- {
- case "任务ID":
- da.BindData(this.GridView1, "Select * From tb_DepTask Where ID Like '%" + this.txtKeyWord.Text + "%'", "tb_DepTask");
- break;
- case "接受者":
- da.BindData(this.GridView1, "Select * From tb_DepTask Where DepName Like '%" + this.txtKeyWord.Text + "%'", "tb_DepTask");
- break;
- case "下达者":
- da.BindData(this.GridView1, "Select * From tb_DepTask Where ReleasePerson Like '%" + this.txtKeyWord.Text + "%'", "tb_DepTask");
- break;
- default:
- Response.Write("<script lanuage=javascript>alert('出错拉!');location='TaskAllInfo.aspx'</script>");
- break;
- }
- }
- protected void lnkbtnAdd_Click1(object sender, EventArgs e)
- {
- this.Panel1.Visible = false;
- this.Panel2.Visible = true;
- }
- protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)
- {
- this.GridView1.PageIndex = e.NewPageIndex;
- SqlData da = new SqlData();
- string search = this.dropClass.SelectedValue;
- switch (search)
- {
- case "任务ID":
- da.BindData(this.GridView1, "Select * From tb_DepTask Where ID Like '%" + this.txtKeyWord.Text + "%'", "tb_DepTask");
- break;
- case "接受者":
- da.BindData(this.GridView1, "Select * From tb_DepTask Where DepName Like '%" + this.txtKeyWord.Text + "%'", "tb_DepTask");
- break;
- case "下达者":
- da.BindData(this.GridView1, "Select * From tb_DepTask Where ReleasePerson Like '%" + this.txtKeyWord.Text + "%'", "tb_DepTask");
- break;
- default:
- Response.Write("<script lanuage=javascript>alert('出错拉!');location='Task.aspx'</script>");
- break;
- }
- }
- protected void btnBack_Click(object sender, EventArgs e)
- {
- Response.Write("<script>this.parent.rightFrame.location='Task.aspx'</script>");
- }
- }