company_deal.aspx.cs
资源名称:web.rar [点击查看]
上传用户:xrffrp
上传日期:2022-03-25
资源大小:22155k
文件大小:4k
源码类别:
OA系统
开发平台:
ASP/ASPX
- using System;
- using System.Data;
- using System.Data.SqlClient;
- 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;
- public partial class web_data_company_deal : System.Web.UI.Page
- {
- protected void Page_Load(object sender, EventArgs e)
- {
- string str = "";
- SqlConnection conn = dbConnection.getConnection();
- conn.Open();
- SqlCommand sqlcom = new SqlCommand("select is_check from OA_COMPANY_CHECK where form_id='" + Request.QueryString["form_id"] + "'", conn);
- SqlDataReader dr = sqlcom.ExecuteReader();
- if (dr.HasRows)
- {
- while (dr.Read())
- {
- str = dr["is_check"].ToString();
- }
- }
- if (str.Equals("N"))
- {
- MultiView2.ActiveViewIndex = 0;
- }
- else
- {
- MultiView2.ActiveViewIndex = -1;
- }
- SetTable();
- }
- public void SetTable()
- {
- SqlConnection conn = dbConnection.getConnection();
- conn.Open();
- SqlCommand sqlcom = new SqlCommand("select department_id,eq_type,eq_detail,content from OA_REPAIR_FORM_DETAIL where form_id='" + Request.QueryString["form_id"].ToString() + "'", conn);
- SqlDataReader dr = sqlcom.ExecuteReader();
- if (dr.HasRows)
- {
- while (dr.Read())
- {
- lb_no.Text = Request.QueryString["form_id"].ToString();
- lb_equipmet.Text = dr["eq_detail"].ToString();
- lb_type.Text = dr["eq_type"].ToString();
- lbcomment.Text = dr["content"].ToString();
- SqlConnection sqlcon = dbConnection.getConnection();
- sqlcon.Open();
- SqlCommand sqlcom1 = new SqlCommand("select name,tel from OA_DEPARTMENT where id='" + dr["department_id"].ToString() + "'", sqlcon);
- SqlDataReader dr1 = sqlcom1.ExecuteReader();
- if (dr1.HasRows)
- {
- while (dr1.Read())
- {
- lb_deparetment.Text = dr1["name"].ToString();
- lb_tel.Text = dr1["tel"].ToString();
- }
- }
- dr1.Close();
- SqlCommand sqlcom2 = new SqlCommand("select f.emp_name as name from OA_EMPLOYEE as f,OA_REPAIR_FORM as g where f.id=g.emp_id and g.form_id='" + Request.QueryString["form_id"] + "'", sqlcon);
- SqlDataReader dr2 = sqlcom2.ExecuteReader();
- if (dr2.HasRows)
- {
- while (dr2.Read())
- {
- lb_person.Text = dr2["name"].ToString();
- }
- }
- }
- }
- }
- protected void RbAgree_SelectedIndexChanged(object sender, EventArgs e)
- {
- if (TxtComment.Text.Equals("已处理") || TxtComment.Text.Equals("未处理"))
- {
- if (RbAgree.SelectedValue.Equals("Y"))
- {
- TxtComment.Text = "已处理";
- }
- else
- {
- TxtComment.Text = "未处理";
- }
- }
- }
- protected void ShowMessageBox(string strMessage)
- {
- Response.Write(string.Format("<script>alert('{0}')</script>", strMessage));
- }
- protected void BtnOk_Click(object sender, EventArgs e)
- {
- string time = "";
- SqlConnection conn = dbConnection.getConnection();
- conn.Open();
- DateMgr mgr = new DateMgr();
- SqlCommand sqlcom = new SqlCommand("update OA_COMPANY_CHECK set is_check='Y',is_agree='" + RbAgree.SelectedValue.ToString() + "',check_time='" + mgr.getTime().ToString() + "',comment='" + TxtComment.Text.Replace("n", "<br>") + "' where form_id='" + Request.QueryString["form_id"].ToString() + "'", conn);
- sqlcom.ExecuteNonQuery();
- conn.Close();
- Response.Redirect("company.aspx");
- }
- }