my_list.aspx.cs
资源名称:web.rar [点击查看]
上传用户:xrffrp
上传日期:2022-03-25
资源大小:22155k
文件大小:4k
源码类别:
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_computer_my_list : System.Web.UI.Page
- {
- protected void Page_Load(object sender, EventArgs e)
- {
- if (!IsPostBack)
- {
- LoginDAO.CheckLogin(Session, Response, "../", 2);
- FairList.DataKeyNames = new string[] { "id" };
- if (Request.QueryString["f_id"] != null)
- {
- this.SetForm(Request.QueryString["f_id"]);
- Panform.Visible = true;
- PnlFlow.Visible = true;
- FlowList.DataKeyNames = new string[] { "id" };
- }
- }
- }
- protected void FairList_RowDataBound(object sender, GridViewRowEventArgs e)
- {
- if (e.Row.RowType == DataControlRowType.DataRow)
- {
- e.Row.Attributes.Add("onmouseover", "this.style.cursor='pointer';");
- e.Row.Attributes.Add("onclick", "location.href='my_list.aspx?f_id=" + FairList.DataKeys[e.Row.RowIndex].Value.ToString() + "'");
- }
- }
- protected void SetForm(string id)
- {
- SqlConnection conn = dbConnection.getConnection();
- conn.Open();
- SqlCommand cmd = new SqlCommand("select * from oa_computer_form where id=" + id+" order by date1 desc", conn);
- SqlDataReader dr = cmd.ExecuteReader();
- if (dr.Read())
- {
- form_no.Text = dr["form_id"].ToString();
- emp_no.Text = dr["emp_no"].ToString();
- emp_name.Text = dr["emp_name"].ToString();
- emp_dept.Text = dr["emp_dept"].ToString();
- emp_position.Text = dr["emp_position"].ToString();
- date1.Text = dr["date1"].ToString();
- f_item.Text = dr["item1"].ToString();
- Enddate.Text = dr["enddate"].ToString();
- content.Text = dr["content"].ToString();
- }
- dr.Close();
- conn.Close();
- }
- protected void FlowList_RowCreated(object sender, GridViewRowEventArgs e)
- {
- if (e.Row.RowType == DataControlRowType.DataRow)
- {
- SqlConnection conn = dbConnection.getConnection();
- conn.Open();
- SqlCommand cmd = new SqlCommand("select apply_type, is_check, is_agree, comment from " +
- "OA_computer_FORM_FLOW where id=" + FlowList.DataKeys[e.Row.RowIndex].Value.ToString(), conn);
- SqlDataReader dr = cmd.ExecuteReader();
- if (dr.Read())
- {
- Label label = (Label)e.Row.FindControl("LblApplyType");
- if (dr["apply_type"].ToString().Equals("1"))
- {
- label.Text = "會簽";
- }
- else
- {
- label.Text = "審批";
- }
- label = (Label)e.Row.FindControl("LblIsCheck");
- if (dr["is_check"].ToString().Equals("N"))
- {
- label.Text = "未處理";
- }
- else
- {
- label.Text = "已處理";
- label = (Label)e.Row.FindControl("LblIsAgree");
- if (dr["is_agree"].ToString().Equals("Y"))
- {
- label.Text = "已同意";
- }
- else
- {
- label.Text = "不同意";
- }
- }
- label = (Label)e.Row.FindControl("LblComment");
- label.Text = dr["comment"].ToString();
- }
- dr.Close();
- conn.Close();
- }
- }
- }