employee_where.aspx.cs
资源名称:web.rar [点击查看]
上传用户:xrffrp
上传日期:2022-03-25
资源大小:22155k
文件大小:5k
源码类别:
OA系统
开发平台:
ASP/ASPX
- 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 web_personnel_curricula_vitae_employee_where : System.Web.UI.Page
- {
- protected void Page_Load(object sender, EventArgs e)
- {
- if (!IsPostBack)
- {
- if (Request.QueryString["e_id"] != null)
- {
- this.SetTable(Request.QueryString["e_id"]);
- }
- }
- }
- protected void SetTable(string id)
- {
- SqlConnection conn = dbConnection.getConnection();
- conn.Open();
- int flag = 0;
- SqlCommand cmd = new SqlCommand("select f.form_id, f.vacation_begin, f.vacation_end, "+
- "f.business_begin, f.business_end, t.name type, f.vacation_place from OA_TW_APPROVEL_FORM f "+
- "inner join OA_TW_OFF_TYPE t on f.off_type=t.id where emp_id="+id+" order by form_id desc", conn);
- SqlDataReader dr = cmd.ExecuteReader();
- while (dr.Read())
- {
- flag = 1;
- TableRow tr = new TableRow();
- TableCell td = new TableCell();
- td.BorderWidth = Unit.Pixel(1);
- td.Text = dr["form_id"].ToString();
- tr.Cells.Add(td);
- td = new TableCell();
- td.BorderWidth = Unit.Pixel(1);
- td.Text = dr["type"].ToString();
- tr.Cells.Add(td);
- if (dr["type"].ToString().Equals("出差"))
- {
- td = new TableCell();
- td.BorderWidth = Unit.Pixel(1);
- td.Text = dr["business_begin"].ToString();
- tr.Cells.Add(td);
- td = new TableCell();
- td.BorderWidth = Unit.Pixel(1);
- td.Text = dr["business_end"].ToString();
- tr.Cells.Add(td);
- }
- else
- {
- td = new TableCell();
- td.BorderWidth = Unit.Pixel(1);
- td.Text = dr["vacation_begin"].ToString();
- tr.Cells.Add(td);
- td = new TableCell();
- td.BorderWidth = Unit.Pixel(1);
- td.Text = dr["vacation_end"].ToString();
- tr.Cells.Add(td);
- }
- TblForm.Rows.Add(tr);
- }
- dr.Close();
- if (flag == 0)
- {
- cmd = new SqlCommand("select form_id, begin_time, end_time from OA_CH_BUSINESS_FORM " +
- "where emp_id=" + id + " order by form_id desc", conn);
- dr = cmd.ExecuteReader();
- while (dr.Read())
- {
- flag = 1;
- TableRow tr = new TableRow();
- TableCell td = new TableCell();
- td.BorderWidth = Unit.Pixel(1);
- td.Text = dr["form_id"].ToString();
- tr.Cells.Add(td);
- td = new TableCell();
- td.BorderWidth = Unit.Pixel(1);
- td.Text = "出差";
- tr.Cells.Add(td);
- td = new TableCell();
- td.BorderWidth = Unit.Pixel(1);
- td.Text = dr["begin_time"].ToString();
- tr.Cells.Add(td);
- td = new TableCell();
- td.BorderWidth = Unit.Pixel(1);
- td.Text = dr["end_time"].ToString();
- tr.Cells.Add(td);
- TblForm.Rows.Add(tr);
- }
- dr.Close();
- cmd = new SqlCommand("select f.form_id, t.name type, f.begin_time, f.end_time from "+
- "OA_CH_OFF_FORM f inner join OA_CH_OFF_TYPE t on f.off_type=t.id where emp_id="+id+
- " order by f.form_id", conn);
- dr = cmd.ExecuteReader();
- while (dr.Read())
- {
- flag = 1;
- TableRow tr = new TableRow();
- TableCell td = new TableCell();
- td.BorderWidth = Unit.Pixel(1);
- td.Text = dr["form_id"].ToString();
- tr.Cells.Add(td);
- td = new TableCell();
- td.BorderWidth = Unit.Pixel(1);
- td.Text = dr["type"].ToString();
- tr.Cells.Add(td);
- td = new TableCell();
- td.BorderWidth = Unit.Pixel(1);
- td.Text = dr["begin_time"].ToString();
- tr.Cells.Add(td);
- td = new TableCell();
- td.BorderWidth = Unit.Pixel(1);
- td.Text = dr["end_time"].ToString();
- tr.Cells.Add(td);
- TblForm.Rows.Add(tr);
- }
- dr.Close();
- }
- if (flag == 0)
- {
- TblForm.Visible = false;
- Table1.Visible = true;
- }
- conn.Close();
- }
- }