select_index.aspx.cs
资源名称:web.rar [点击查看]
上传用户:xrffrp
上传日期:2022-03-25
资源大小:22155k
文件大小:91k
源码类别:
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_repair_select_select_index : System.Web.UI.Page
- {
- protected void Page_Load(object sender, EventArgs e)
- {
- SqlConnection conn = dbConnection.getConnection();
- conn.Open();
- if (!IsPostBack)
- {
- dl_company.Items.Clear();
- dl_company.Items.Add("所有厂商");
- SqlCommand sqlcom1 = new SqlCommand("select company from OA_COMPANY order by id", conn);
- SqlDataReader dr1 = sqlcom1.ExecuteReader();
- if (dr1.HasRows)
- {
- while (dr1.Read())
- {
- dl_company.Items.Add(dr1["company"].ToString());
- }
- }
- dr1.Close();
- dl_department.Items.Clear();
- dl_department.Items.Add("所有门店");
- SqlCommand sqlcom2 = new SqlCommand("select name FROM OA_DEPARTMENT WHERE (CHARINDEX('店', name) > 0)", conn);
- SqlDataReader dr2 = sqlcom2.ExecuteReader();
- if (dr2.HasRows)
- {
- while (dr2.Read())
- {
- dl_department.Items.Add(dr2["name"].ToString());
- }
- }
- dr2.Close();
- dl_type.Items.Clear();
- dl_type.Items.Add("所有类型");
- SqlCommand sqlcom3 = new SqlCommand("select type from OA_UNIT_TYPE order by id", conn);
- SqlDataReader dr3 = sqlcom3.ExecuteReader();
- if (dr3.HasRows)
- {
- while (dr3.Read())
- {
- dl_type.Items.Add(dr3["type"].ToString());
- }
- }
- dr3.Close();
- dl_name.Items.Clear();
- dl_name.Items.Add("所有设备");
- SqlCommand sqlcom = new SqlCommand("select eq_name from OA_UNIT_DETAIL where eq_type='" + dl_type.SelectedValue.ToString() + "'", conn);
- SqlDataReader dr = sqlcom.ExecuteReader();
- if (dr.HasRows)
- {
- while (dr.Read())
- {
- dl_name.Items.Add(dr["eq_name"].ToString());
- }
- }
- dr.Close();
- }
- conn.Close();
- }
- protected void Begindate_SelectionChanged(object sender, EventArgs e)
- {
- Begindate.Visible = false;
- string year = Begindate.SelectedDate.Year.ToString();
- string month = Begindate.SelectedDate.Month.ToString();
- if (month.Length == 1)
- {
- month = "0" + month;
- }
- string day = Begindate.SelectedDate.Day.ToString();
- if (day.Length == 1)
- {
- day = "0" + day;
- }
- b_time.Text = year + month + day + "000000";
- b_time.Focus();
- }
- protected void Enddate_SelectionChanged(object sender, EventArgs e)
- {
- Enddate.Visible = false;
- string year = Enddate.SelectedDate.Year.ToString();
- string month = Enddate.SelectedDate.Month.ToString();
- if (month.Length == 1)
- {
- month = "0" + month;
- }
- string day = Enddate.SelectedDate.Day.ToString();
- if (day.Length == 1)
- {
- day = "0" + day;
- }
- e_time.Text = year + month + day + "000000";
- e_time.Focus();
- }
- protected void ImageButton2_Click(object sender, ImageClickEventArgs e)
- {
- if (Enddate.Visible == true)
- {
- Enddate.Visible = false;
- Enddate.Focus();
- }
- else
- {
- Enddate.Visible = true;
- Enddate.Focus();
- }
- }
- protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
- {
- if (Begindate.Visible == true)
- {
- Begindate.Visible = false;
- Begindate.Focus();
- }
- else
- {
- Begindate.Visible = true;
- Begindate.Focus();
- }
- }
- protected void btn_ok_Click(object sender, EventArgs e)
- {
- string str = DropDownList2.SelectedItem.ToString();
- if (str.Equals("按厂商查询"))
- {
- MultiView2.ActiveViewIndex = 0;
- bind1();
- }
- else if (str.Equals("按门店查询"))
- {
- MultiView2.ActiveViewIndex = 1;
- bind2();
- }
- else if (str.Equals("按设备-厂商查询"))
- {
- MultiView2.ActiveViewIndex = 2;
- bind3();
- }
- else if (str.Equals("按设备-门店查询"))
- {
- MultiView2.ActiveViewIndex = 3;
- bind4();
- }
- else
- {
- }
- }
- public string SetTime(string s)
- {
- string year = "";
- string month = "";
- string day = "";
- string hour = "";
- string minite = "";
- string second = "";
- if (s.Length == 14)
- {
- year = s.Substring(0, 4).ToString();
- month = s.Substring(4, 2).ToString();
- day = s.Substring(6, 2).ToString();
- hour = s.Substring(8, 2).ToString();
- minite = s.Substring(10, 2).ToString();
- second = s.Substring(12, 2).ToString();
- return year + "-" + month + "-" + day + " " + hour + ":" + minite + ":" + second;
- }
- else
- {
- return s;
- }
- }
- protected void dl_type_SelectedIndexChanged(object sender, EventArgs e)
- {
- SqlConnection conn = dbConnection.getConnection();
- conn.Open();
- dl_name.Items.Clear();
- dl_name.Items.Add("所有设备");
- SqlCommand sqlcom = new SqlCommand("select eq_name from OA_UNIT_DETAIL where eq_type='" + dl_type.SelectedItem.ToString() + "'", conn);
- SqlDataReader dr = sqlcom.ExecuteReader();
- if (dr.HasRows)
- {
- while (dr.Read())
- {
- dl_name.Items.Add(dr["eq_name"].ToString());
- }
- }
- dr.Close();
- conn.Close();
- }
- protected void ShowMessageBox(string strMessage)
- {
- Response.Write(string.Format("<script>alert('{0}')</script>", strMessage));
- }
- protected void bind1()
- {
- string str = dl_company.SelectedItem.ToString();
- string str_department = dl_department.SelectedItem.ToString();
- string str_type = dl_type.SelectedItem.ToString();
- string str_name = dl_name.SelectedItem.ToString();
- string str_b_time = b_time.Text.ToString();
- string str_e_time = e_time.ToString();
- string sqlstr = "select id,company from OA_COMPANY where company='" + str + "'";
- SqlConnection conn = dbConnection.getConnection();
- conn.Open();
- DataSet ds = new DataSet();
- DataTable dt = new DataTable();
- dt.Columns.Add("id", typeof(Int32));
- dt.Columns.Add("company", typeof(string));
- dt.Columns.Add("num", typeof(Int32));
- if (str.Equals("所有厂商"))
- {
- sqlstr = "select id,company from OA_COMPANY order by id";
- }
- SqlCommand sqlcom = new SqlCommand(sqlstr, conn);
- SqlDataReader dr = sqlcom.ExecuteReader();
- if (dr.HasRows)
- {
- while (dr.Read())
- {
- SqlConnection conn1 = dbConnection.getConnection();
- conn1.Open();
- string sqlstr1 = "select count(*) as num from OA_REPAIR_FORM_DETAIL where company='" + dr["company"].ToString() + "'";
- if (!(str_department.Equals("所有门店")))
- {
- SqlCommand sqlcom2 = new SqlCommand("select id from OA_DEPARTMENT where name='" + str_department + "'", conn1);
- SqlDataReader dr2 = sqlcom2.ExecuteReader();
- if (dr2.HasRows)
- {
- while (dr2.Read())
- {
- sqlstr1 = sqlstr1 + " and department_id=" + Convert.ToInt32(dr2["id"]);
- }
- }
- dr2.Close();
- }
- if (!(str_type.Equals("所有类型")))
- {
- sqlstr1 = sqlstr1 + " and eq_type='" + str_type + "'";
- }
- if (!(str_name.Equals("所有设备")))
- {
- sqlstr1 = sqlstr1 + " and eq_detail='" + str_name + "'";
- }
- if ((!(str_b_time.Equals(""))) && (!(str_e_time.Equals(""))))
- {
- sqlstr1 = sqlstr1 + " and (form_id between'" + str_b_time + "' and '" + str_e_time + "')";
- }
- SqlCommand sqlcom1 = new SqlCommand(sqlstr1, conn1);
- SqlDataReader dr1 = sqlcom1.ExecuteReader();
- if (dr1.HasRows)
- {
- while (dr1.Read())
- {
- if (Convert.ToInt32(dr1["num"]) > 0)
- {
- DataRow row = dt.NewRow();
- row["id"] = Convert.ToInt32(dr["id"]);
- row["company"] = dr["company"].ToString();
- row["num"] = Convert.ToInt32(dr1["num"]);
- dt.Rows.Add(row);
- }
- }
- }
- dr1.Close();
- conn1.Close();
- }
- }
- dr.Close();
- conn.Close();
- ds.Tables.Add(dt);
- gvParent.DataSource = ds;
- gvParent.DataBind();
- gvParent.DataKeyNames = new string[] { "company" };
- }
- protected void gvParent_RowDataBound(object sender, GridViewRowEventArgs e)
- {
- if (e.Row.RowType == DataControlRowType.DataRow)
- {
- GridView oGridView = (GridView)e.Row.FindControl("gvChild");
- if (oGridView != null)
- {
- string str_company = dl_company.SelectedItem.ToString();
- string str_department = dl_department.SelectedItem.ToString();
- string str_type = dl_type.SelectedItem.ToString();
- string str_name = dl_name.SelectedItem.ToString();
- string str_b_time = b_time.Text.ToString();
- string str_e_time = e_time.ToString();
- string sqlstr = "select id,type from OA_UNIT_TYPE where type='" + str_type + "'";
- if (str_type.Equals("所有类型"))
- {
- sqlstr = "select id,type from OA_UNIT_TYPE";
- }
- Label lblID = (Label)e.Row.FindControl("lb1_ID");
- SqlConnection conn = dbConnection.getConnection();
- conn.Open();
- DataSet ds = new DataSet();
- DataTable dt = new DataTable();
- dt.Columns.Add("id", typeof(Int32));
- dt.Columns.Add("type", typeof(string));
- dt.Columns.Add("num", typeof(Int32));
- dt.Columns.Add("company", typeof(string));
- SqlCommand sqlcom = new SqlCommand(sqlstr, conn);
- SqlDataReader dr = sqlcom.ExecuteReader();
- if (dr.HasRows)
- {
- while (dr.Read())
- {
- SqlConnection conn1 = dbConnection.getConnection();
- conn1.Open();
- string sqlstr1 = "select count(*) as num from OA_REPAIR_FORM_DETAIL where company='" + lblID.Text + "' and eq_type='" + dr["type"].ToString() + "'";
- if (!(str_department.Equals("所有门店")))
- {
- SqlCommand sqlcom2 = new SqlCommand("select id from OA_DEPARTMENT where name='" + str_department + "'", conn1);
- SqlDataReader dr2 = sqlcom2.ExecuteReader();
- if (dr2.HasRows)
- {
- while (dr2.Read())
- {
- sqlstr1 = sqlstr1 + " and department_id=" + Convert.ToInt32(dr2["id"]);
- }
- }
- dr2.Close();
- }
- if (!(str_name.Equals("所有设备")))
- {
- sqlstr1 = sqlstr1 + " and eq_detail='" + str_name + "'";
- }
- if ((!(str_b_time.Equals(""))) && (!(str_e_time.Equals(""))))
- {
- sqlstr1 = sqlstr1 + " and (form_id between'" + str_b_time + "' and '" + str_e_time + "')";
- }
- SqlCommand sqlcom1 = new SqlCommand(sqlstr1, conn1);
- SqlDataReader dr1 = sqlcom1.ExecuteReader();
- if (dr1.HasRows)
- {
- while (dr1.Read())
- {
- if ((Convert.ToInt32(dr1["num"])) != 0)
- {
- DataRow row = dt.NewRow();
- row["id"] = Convert.ToInt32(dr["id"]);
- row["type"] = dr["type"].ToString();
- row["num"] = Convert.ToInt32(dr1["num"]);
- row["company"] = lblID.Text;
- dt.Rows.Add(row);
- }
- }
- }
- dr1.Close();
- conn1.Close();
- }
- }
- ds.Tables.Add(dt);
- dr.Close();
- conn.Close();
- oGridView.DataSource = ds;
- oGridView.DataBind();
- oGridView.DataKeyNames = new string[] { "type", "company" };
- }
- }
- }
- protected void gvChild_RowDataBound(object sender, GridViewRowEventArgs e)
- {
- if (e.Row.RowType == DataControlRowType.DataRow)
- {
- GridView oGridView = (GridView)e.Row.FindControl("gvthird");
- if (oGridView != null)
- {
- Label lbltype = (Label)e.Row.FindControl("lb2_type");
- Label lblcompany = (Label)e.Row.FindControl("lb2_company");
- string str_company = dl_company.SelectedItem.ToString();
- string str_department = dl_department.SelectedItem.ToString();
- string str_type = dl_type.SelectedItem.ToString();
- string str_name = dl_name.SelectedItem.ToString();
- string str_b_time = b_time.Text.ToString();
- string str_e_time = e_time.ToString();
- string sqlstr = "select id,eq_name from OA_UNIT_DETAIL where eq_name='" + str_name + "' and eq_type='" + lbltype.Text.ToString() + "'";
- if (dl_name.SelectedItem.ToString().Equals("所有设备"))
- {
- sqlstr = "select id, eq_name from OA_UNIT_DETAIL where eq_type='" + lbltype.Text + "'";
- }
- else if (dl_type.SelectedItem.ToString().Equals("所有类型"))
- {
- sqlstr = "select id,eq_name from OA_UNIT_DETAIL where eq_type='" + lbltype.Text + "'";
- }
- else
- {
- }
- SqlConnection conn = dbConnection.getConnection();
- conn.Open();
- DataSet ds = new DataSet();
- DataTable dt = new DataTable();
- dt.Columns.Add("id", typeof(Int32));
- dt.Columns.Add("eq_detail", typeof(string));
- dt.Columns.Add("num", typeof(string));
- dt.Columns.Add("type", typeof(string));
- dt.Columns.Add("company", typeof(string));
- SqlCommand sqlcom = new SqlCommand(sqlstr, conn);
- SqlDataReader dr = sqlcom.ExecuteReader();
- if (dr.HasRows)
- {
- while (dr.Read())
- {
- SqlConnection conn1 = dbConnection.getConnection();
- conn1.Open();
- string sqlstr1 = "select count(*) as num from OA_REPAIR_FORM_DETAIL where eq_type='" + lbltype.Text + "'and eq_detail='" + dr["eq_name"].ToString() + "'and company='" + lblcompany.Text + "'";
- if (!(str_department.Equals("所有门店")))
- {
- SqlCommand sqlcom2 = new SqlCommand("select id from OA_DEPARTMENT where name='" + str_department + "'", conn1);
- SqlDataReader dr2 = sqlcom2.ExecuteReader();
- if (dr2.HasRows)
- {
- while (dr2.Read())
- {
- sqlstr1 = sqlstr1 + " and department_id=" + Convert.ToInt32(dr2["id"]);
- }
- }
- dr2.Close();
- }
- if ((!(str_b_time.Equals(""))) && (!(str_e_time.Equals(""))))
- {
- sqlstr1 = sqlstr1 + " and (form_id between'" + str_b_time + "' and '" + str_e_time + "')";
- }
- SqlCommand sqlcom1 = new SqlCommand(sqlstr1, conn1);
- SqlDataReader dr1 = sqlcom1.ExecuteReader();
- if (dr1.HasRows)
- {
- while (dr1.Read())
- {
- if (Convert.ToInt32(dr1["num"]) != 0)
- {
- DataRow row = dt.NewRow();
- row["type"] = lbltype.Text;
- row["company"] = lblcompany.Text;
- row["id"] = Convert.ToInt32(dr["id"]);
- row["eq_detail"] = dr["eq_name"].ToString();
- row["num"] = Convert.ToInt32(dr1["num"]);
- dt.Rows.Add(row);
- }
- }
- }
- dr1.Close();
- conn1.Close();
- }
- }
- ds.Tables.Add(dt);
- dr.Close();
- conn.Close();
- oGridView.DataSource = ds;
- oGridView.DataBind();
- }
- }
- }
- protected void gvthird_RowDataBound(object sender, GridViewRowEventArgs e)
- {
- if (e.Row.RowType == DataControlRowType.DataRow)
- {
- GridView oGridView = (GridView)e.Row.FindControl("gvfourth");
- if (oGridView != null)
- {
- Label lblname = (Label)e.Row.FindControl("lb3_detail");
- Label lbltype = (Label)e.Row.FindControl("lb3_type");
- Label lblcompany = (Label)e.Row.FindControl("lb3_company");
- string str_b_time = b_time.Text.ToString();
- string str_e_time = e_time.ToString();
- string str = dl_department.SelectedItem.ToString();
- string sqlstr = "select id,name from OA_DEPARTMENT WHERE name='" + str + "'";
- if (str.Equals("所有门店"))
- {
- sqlstr = "SELECT id, name FROM OA_DEPARTMENT WHERE (CHARINDEX('店', name) > 0)";
- }
- SqlConnection conn = dbConnection.getConnection();
- conn.Open();
- DataSet ds = new DataSet();
- DataTable dt = new DataTable();
- dt.Columns.Add("id", typeof(Int32));
- dt.Columns.Add("name", typeof(string));
- dt.Columns.Add("eq_detail", typeof(string));
- dt.Columns.Add("eq_type", typeof(string));
- dt.Columns.Add("eq_company", typeof(string));
- dt.Columns.Add("num", typeof(Int32));
- SqlCommand sqlcom = new SqlCommand(sqlstr, conn);
- SqlDataReader dr = sqlcom.ExecuteReader();
- if (dr.HasRows)
- {
- while (dr.Read())
- {
- SqlConnection conn1 = dbConnection.getConnection();
- conn1.Open();
- string sqlstr1 = "select count(*) as num from OA_REPAIR_FORM_DETAIL where department_id=" + Convert.ToInt32(dr["id"]) + " and eq_type='" + lbltype.Text + "'and eq_detail='" + lblname.Text + "'and company='" + lblcompany.Text + "'";
- if ((!(str_b_time.Equals(""))) && (!(str_e_time.Equals(""))))
- {
- sqlstr1 = sqlstr1 + " and (form_id between'" + str_b_time + "' and '" + str_e_time + "')";
- }
- SqlCommand sqlcom1 = new SqlCommand(sqlstr1, conn1);
- SqlDataReader dr1 = sqlcom1.ExecuteReader();
- if (dr1.HasRows)
- {
- while (dr1.Read())
- {
- if ((Convert.ToInt32(dr1["num"])) != 0)
- {
- DataRow row = dt.NewRow();
- row["id"] = Convert.ToInt32(dr["id"]);
- row["name"] = dr["name"].ToString();
- row["eq_detail"] = lblname.Text;
- row["eq_type"] = lbltype.Text;
- row["eq_company"] = lblcompany.Text;
- row["num"] = Convert.ToInt32(dr1["num"]);
- dt.Rows.Add(row);
- }
- }
- }
- dr1.Close();
- conn1.Close();
- }
- }
- ds.Tables.Add(dt);
- dr.Close();
- conn.Close();
- oGridView.DataSource = ds;
- oGridView.DataBind();
- }
- }
- }
- protected void gvfourth_RowDataBound(object sender, GridViewRowEventArgs e)
- {
- if (e.Row.RowType == DataControlRowType.DataRow)
- {
- GridView oGridView = (GridView)e.Row.FindControl("gvdetail");
- if (oGridView != null)
- {
- Label lblname = (Label)e.Row.FindControl("lb4_detail");
- Label lbltype = (Label)e.Row.FindControl("lb4_type");
- Label lblcompany = (Label)e.Row.FindControl("lb4_company");
- Label lblid = (Label)e.Row.FindControl("lb4_id");
- string str_b_time = b_time.Text.ToString();
- string str_e_time = e_time.ToString();
- int step = 1;
- DataSet ds = new DataSet();
- DataTable dt = new DataTable();
- dt.Columns.Add(new DataColumn("form_id", typeof(string)));
- dt.Columns.Add(new DataColumn("department", typeof(string)));
- dt.Columns.Add(new DataColumn("apply_time", typeof(string)));
- dt.Columns.Add(new DataColumn("emp_name", typeof(string)));
- dt.Columns.Add(new DataColumn("eq_type", typeof(string)));
- dt.Columns.Add(new DataColumn("eq_detail", typeof(string)));
- dt.Columns.Add(new DataColumn("company", typeof(string)));
- dt.Columns.Add(new DataColumn("content", typeof(string)));
- dt.Columns.Add(new DataColumn("check_md", typeof(string)));
- dt.Columns.Add(new DataColumn("check_company", typeof(string)));
- dt.Columns.Add(new DataColumn("comment", typeof(string)));
- dt.Columns.Add(new DataColumn("check_time", typeof(string)));
- SqlConnection conn = dbConnection.getConnection();
- conn.Open();
- string sqlstr = "select a.form_id as form_id,c.emp_name as emp_name,a.eq_type as eq_type,a.eq_detail as eq_detail,a.company as company,a.content as content from OA_REPAIR_FORM_DETAIL as a,OA_REPAIR_FORM as b,OA_EMPLOYEE as c where b.form_id=a.form_id and b.emp_id=c.id and a.department_id='" + lblid.Text + "' and a.eq_type='" + lbltype.Text + "' and a.eq_detail='" + lblname.Text + "' and a.company='" + lblcompany.Text + "'";
- if ((!(str_b_time.Equals(""))) && (!(str_e_time.Equals(""))))
- {
- sqlstr = sqlstr + " and (a.form_id between'" + str_b_time + "' and '" + str_e_time + "')";
- }
- SqlCommand sqlcom = new SqlCommand(sqlstr, conn);
- SqlDataReader dr1 = sqlcom.ExecuteReader();
- if (dr1.HasRows)
- {
- while (dr1.Read())
- {
- DataRow row = dt.NewRow();
- row["form_id"] = dr1["form_id"].ToString();
- row["emp_name"] = dr1["emp_name"].ToString();
- row["eq_type"] = dr1["eq_type"].ToString();
- row["eq_detail"] = dr1["eq_detail"].ToString();
- row["company"] = dr1["company"].ToString();
- row["content"] = dr1["content"].ToString();
- row["apply_time"] = SetTime(dr1["form_id"].ToString());
- SqlConnection conn1 = dbConnection.getConnection();
- conn1.Open();
- SqlCommand sqlcom5 = new SqlCommand("select name from OA_DEPARTMENT where id='" + lblid.Text + "'", conn1);
- SqlDataReader dr5 = sqlcom5.ExecuteReader();
- if (dr5.HasRows)
- {
- while (dr5.Read())
- {
- row["department"] = dr5["name"].ToString();
- }
- }
- dr5.Close();
- SqlCommand sqlcom1 = new SqlCommand("select max(step) as step from OA_REPAIR_FLOW where form_id='" + dr1["form_id"].ToString() + "'", conn1);
- SqlDataReader dr4 = sqlcom1.ExecuteReader();
- if (dr4.HasRows)
- {
- while (dr4.Read())
- {
- if (!(dr4["step"].ToString().Equals("")))
- {
- step = Convert.ToInt32(dr4["step"]);
- }
- }
- }
- dr4.Close();
- SqlCommand sqlcom2 = new SqlCommand("select is_agree from OA_REPAIR_FLOW where form_id='" + dr1["form_id"].ToString() + "'and step=" + step, conn1);
- SqlDataReader dr2 = sqlcom2.ExecuteReader();
- if (dr2.HasRows)
- {
- while (dr2.Read())
- {
- if (dr2["is_agree"].ToString().Equals("Y"))
- {
- row["check_md"] = "已完工";
- }
- else if (dr2["is_agree"].ToString().Equals("N"))
- {
- row["check_md"] = "未处理";
- }
- else
- {
- row["check_md"] = "";
- }
- }
- }
- dr2.Close();
- SqlCommand sqlcom3 = new SqlCommand("select is_agree,comment,check_time from OA_COMPANY_CHECK where form_id='" + dr1["form_id"].ToString() + "' and company='" + dr1["company"].ToString() + "'", conn1);
- SqlDataReader dr3 = sqlcom3.ExecuteReader();
- if (dr3.HasRows)
- {
- while (dr3.Read())
- {
- if (dr3["is_agree"].ToString().Equals("Y"))
- {
- row["check_company"] = "已完工";
- }
- else if (dr3["is_agree"].ToString().Equals("N"))
- {
- row["check_company"] = "未处理";
- }
- else
- {
- row["check_company"] = "";
- }
- row["comment"] = dr3["comment"].ToString().Replace("/n", "<br>").ToString();
- row["check_time"] = SetTime(dr3["check_time"].ToString());
- }
- }
- dr3.Close();
- conn1.Close();
- dt.Rows.Add(row);
- }
- }
- ds.Tables.Add(dt);
- oGridView.DataSource = ds;
- oGridView.DataBind();
- dr1.Close();
- conn.Close();
- }
- }
- }
- protected void bind2()
- {
- string str_company = dl_company.SelectedItem.ToString();
- string str_department = dl_department.SelectedItem.ToString();
- string str_type = dl_type.SelectedItem.ToString();
- string str_name = dl_name.SelectedItem.ToString();
- string str_b_time = b_time.Text.ToString();
- string str_e_time = e_time.ToString();
- SqlConnection conn = dbConnection.getConnection();
- conn.Open();
- DataSet ds = new DataSet();
- DataTable dt = new DataTable();
- dt.Columns.Add("id", typeof(Int32));
- dt.Columns.Add("department", typeof(string));
- dt.Columns.Add("num", typeof(Int32));
- string sqlstr = "select id,name from OA_DEPARTMENT where name='" + str_department + "'";
- if (str_department.Equals("所有门店"))
- {
- sqlstr = "SELECT id, name FROM OA_DEPARTMENT WHERE (CHARINDEX('店', name) > 0)";
- }
- SqlCommand sqlcom = new SqlCommand(sqlstr, conn);
- SqlDataReader dr = sqlcom.ExecuteReader();
- if (dr.HasRows)
- {
- while (dr.Read())
- {
- SqlConnection conn1 = dbConnection.getConnection();
- conn1.Open();
- string sqlstr1 = "select count(*) as num from OA_REPAIR_FORM_DETAIL where department_id=" + Convert.ToInt32(dr["id"]);
- if (!(str_company.Equals("所有厂商")))
- {
- sqlstr1 = sqlstr1 + " and company='" + str_company + "'";
- }
- if (!(str_type.Equals("所有类型")))
- {
- sqlstr1 = sqlstr1 + " and eq_type='" + str_type + "'";
- }
- if (!(str_name.Equals("所有设备")))
- {
- sqlstr1 = sqlstr1 + " and eq_detail='" + str_name + "'";
- }
- if ((!(str_b_time.Equals(""))) && (!(str_e_time.Equals(""))))
- {
- sqlstr1 = sqlstr1 + " and (form_id between'" + str_b_time + "' and '" + str_e_time + "')";
- }
- SqlCommand sqlcom1 = new SqlCommand(sqlstr1, conn1);
- SqlDataReader dr1 = sqlcom1.ExecuteReader();
- if (dr1.HasRows)
- {
- while (dr1.Read())
- {
- if (Convert.ToInt32(dr1["num"]) > 0)
- {
- DataRow row = dt.NewRow();
- row["id"] = Convert.ToInt32(dr["id"]);
- row["department"] = dr["name"].ToString();
- row["num"] = Convert.ToInt32(dr1["num"]);
- dt.Rows.Add(row);
- }
- }
- }
- dr1.Close();
- conn1.Close();
- }
- }
- ds.Tables.Add(dt);
- dr.Close();
- conn.Close();
- gvParent1.DataSource = ds;
- gvParent1.DataBind();
- }
- protected void gvParent1_RowDataBound(object sender, GridViewRowEventArgs e)
- {
- if (e.Row.RowType == DataControlRowType.DataRow)
- {
- GridView oGridView = (GridView)e.Row.FindControl("gvChild1");
- if (oGridView != null)
- {
- string str_company = dl_company.SelectedItem.ToString();
- string str_department = dl_department.SelectedItem.ToString();
- string str_type = dl_type.SelectedItem.ToString();
- string str_name = dl_name.SelectedItem.ToString();
- string str_b_time = b_time.Text.ToString();
- string str_e_time = e_time.ToString();
- string sqlstr = "select id,type from OA_UNIT_TYPE where type='" + str_type + "'";
- if (str_type.Equals("所有类型"))
- {
- sqlstr = "select id,type from OA_UNIT_TYPE";
- }
- Label lblID = (Label)e.Row.FindControl("lbl1_ID");
- SqlConnection conn = dbConnection.getConnection();
- conn.Open();
- DataSet ds = new DataSet();
- DataTable dt = new DataTable();
- dt.Columns.Add("id", typeof(Int32));
- dt.Columns.Add("type", typeof(string));
- dt.Columns.Add("num", typeof(Int32));
- dt.Columns.Add("department", typeof(string));
- SqlCommand sqlcom = new SqlCommand(sqlstr, conn);
- SqlDataReader dr = sqlcom.ExecuteReader();
- if (dr.HasRows)
- {
- while (dr.Read())
- {
- SqlConnection conn1 = dbConnection.getConnection();
- conn1.Open();
- string sqlstr1 = "select count(*) as num from OA_REPAIR_FORM_DETAIL where department_id='" + lblID.Text + "' and eq_type='" + dr["type"].ToString() + "'";
- if (!(str_name.Equals("所有设备")))
- {
- sqlstr1 = sqlstr1 + " and eq_detail='" + str_name + "'";
- }
- if ((!(str_b_time.Equals(""))) && (!(str_e_time.Equals(""))))
- {
- sqlstr1 = sqlstr1 + " and (form_id between'" + str_b_time + "' and '" + str_e_time + "')";
- }
- if (!(str_company.Equals("所有厂商")))
- {
- sqlstr1 = sqlstr1 + " and company='" + str_company + "'";
- }
- SqlCommand sqlcom1 = new SqlCommand(sqlstr1, conn1);
- SqlDataReader dr1 = sqlcom1.ExecuteReader();
- if (dr1.HasRows)
- {
- while (dr1.Read())
- {
- if ((Convert.ToInt32(dr1["num"])) != 0)
- {
- DataRow row = dt.NewRow();
- row["id"] = Convert.ToInt32(dr["id"]);
- row["type"] = dr["type"].ToString();
- row["num"] = Convert.ToInt32(dr1["num"]);
- row["department"] = lblID.Text;
- dt.Rows.Add(row);
- }
- }
- }
- dr1.Close();
- conn1.Close();
- }
- }
- ds.Tables.Add(dt);
- dr.Close();
- conn.Close();
- oGridView.DataSource = ds;
- oGridView.DataBind();
- }
- }
- }
- protected void gvChild1_RowDataBound(object sender, GridViewRowEventArgs e)
- {
- if (e.Row.RowType == DataControlRowType.DataRow)
- {
- GridView oGridView = (GridView)e.Row.FindControl("gvthird1");
- if (oGridView != null)
- {
- Label lbltype = (Label)e.Row.FindControl("lbl2_type");
- Label lblid = (Label)e.Row.FindControl("lbl2_department");
- string str_company = dl_company.SelectedItem.ToString();
- string str_department = dl_department.SelectedItem.ToString();
- string str_type = dl_type.SelectedItem.ToString();
- string str_name = dl_name.SelectedItem.ToString();
- string str_b_time = b_time.Text.ToString();
- string str_e_time = e_time.ToString();
- string sqlstr = "select id,eq_name from OA_UNIT_DETAIL where eq_name='" + str_name + "' and eq_type='" + lbltype.Text.ToString() + "'";
- if (dl_name.SelectedItem.ToString().Equals("所有设备"))
- {
- sqlstr = "select id, eq_name from OA_UNIT_DETAIL where eq_type='" + lbltype.Text + "'";
- }
- else if (dl_type.SelectedItem.ToString().Equals("所有类型"))
- {
- sqlstr = "select id,eq_name from OA_UNIT_DETAIL where eq_type='" + lbltype.Text + "'";
- }
- else
- {
- }
- SqlConnection conn = dbConnection.getConnection();
- conn.Open();
- DataSet ds = new DataSet();
- DataTable dt = new DataTable();
- dt.Columns.Add("id", typeof(Int32));
- dt.Columns.Add("eq_detail", typeof(string));
- dt.Columns.Add("num", typeof(string));
- dt.Columns.Add("type", typeof(string));
- dt.Columns.Add("department", typeof(string));
- SqlCommand sqlcom = new SqlCommand(sqlstr, conn);
- SqlDataReader dr = sqlcom.ExecuteReader();
- if (dr.HasRows)
- {
- while (dr.Read())
- {
- SqlConnection conn1 = dbConnection.getConnection();
- conn1.Open();
- string sqlstr1 = "select count(*) as num from OA_REPAIR_FORM_DETAIL where eq_type='" + lbltype.Text + "'and eq_detail='" + dr["eq_name"].ToString() + "'and department_id='" + lblid.Text + "'";
- if (!(str_company.Equals("所有厂商")))
- {
- sqlstr1 = sqlstr1 + " and company='" + str_company + "'";
- }
- if ((!(str_b_time.Equals(""))) && (!(str_e_time.Equals(""))))
- {
- sqlstr1 = sqlstr1 + " and (form_id between'" + str_b_time + "' and '" + str_e_time + "')";
- }
- SqlCommand sqlcom1 = new SqlCommand(sqlstr1, conn1);
- SqlDataReader dr1 = sqlcom1.ExecuteReader();
- if (dr1.HasRows)
- {
- while (dr1.Read())
- {
- if (Convert.ToInt32(dr1["num"]) != 0)
- {
- DataRow row = dt.NewRow();
- row["type"] = lbltype.Text;
- row["department"] = lblid.Text;
- row["id"] = Convert.ToInt32(dr["id"]);
- row["eq_detail"] = dr["eq_name"].ToString();
- row["num"] = Convert.ToInt32(dr1["num"]);
- dt.Rows.Add(row);
- }
- }
- }
- dr1.Close();
- conn1.Close();
- }
- }
- ds.Tables.Add(dt);
- dr.Close();
- conn.Close();
- oGridView.DataSource = ds;
- oGridView.DataBind();
- }
- }
- }
- protected void gvthird1_RowDataBound(object sender, GridViewRowEventArgs e)
- {
- if (e.Row.RowType == DataControlRowType.DataRow)
- {
- GridView oGridView = (GridView)e.Row.FindControl("gvfourth1");
- if (oGridView != null)
- {
- Label lblname = (Label)e.Row.FindControl("lbl3_detail");
- Label lbltype = (Label)e.Row.FindControl("lbl3_type");
- Label lblid = (Label)e.Row.FindControl("lbl3_department");
- string str_b_time = b_time.Text.ToString();
- string str_e_time = e_time.ToString();
- string str_company = dl_company.SelectedItem.ToString();
- string str_department = dl_department.SelectedItem.ToString();
- string str_type = dl_type.SelectedItem.ToString();
- string str_name = dl_name.SelectedItem.ToString();
- string sqlstr = "select id,company from OA_COMPANY WHERE company='" + str_company + "'";
- if (str_company.Equals("所有厂商"))
- {
- sqlstr = "select id,company from OA_COMPANY";
- }
- SqlConnection conn = dbConnection.getConnection();
- conn.Open();
- DataSet ds = new DataSet();
- DataTable dt = new DataTable();
- dt.Columns.Add("id", typeof(Int32));
- dt.Columns.Add("department", typeof(string));
- dt.Columns.Add("eq_detail", typeof(string));
- dt.Columns.Add("eq_type", typeof(string));
- dt.Columns.Add("eq_company", typeof(string));
- dt.Columns.Add("num", typeof(Int32));
- SqlCommand sqlcom = new SqlCommand(sqlstr, conn);
- SqlDataReader dr = sqlcom.ExecuteReader();
- if (dr.HasRows)
- {
- while (dr.Read())
- {
- SqlConnection conn1 = dbConnection.getConnection();
- conn1.Open();
- string sqlstr1 = "select count(*) as num from OA_REPAIR_FORM_DETAIL where company='" + dr["company"].ToString() + "' and eq_type='" + lbltype.Text + "'and eq_detail='" + lblname.Text + "'and department_id='" + lblid.Text + "'";
- if ((!(str_b_time.Equals(""))) && (!(str_e_time.Equals(""))))
- {
- sqlstr1 = sqlstr1 + " and (form_id between'" + str_b_time + "' and '" + str_e_time + "')";
- }
- SqlCommand sqlcom1 = new SqlCommand(sqlstr1, conn1);
- SqlDataReader dr1 = sqlcom1.ExecuteReader();
- if (dr1.HasRows)
- {
- while (dr1.Read())
- {
- if ((Convert.ToInt32(dr1["num"])) != 0)
- {
- DataRow row = dt.NewRow();
- row["id"] = Convert.ToInt32(dr["id"]);
- row["department"] = lblid.Text;
- row["eq_detail"] = lblname.Text;
- row["eq_type"] = lbltype.Text;
- row["eq_company"] = dr["company"].ToString();
- row["num"] = Convert.ToInt32(dr1["num"]);
- dt.Rows.Add(row);
- }
- }
- }
- dr1.Close();
- conn1.Close();
- }
- }
- ds.Tables.Add(dt);
- dr.Close();
- conn.Close();
- oGridView.DataSource = ds;
- oGridView.DataBind();
- }
- }
- }
- protected void gvfourth1_RowDataBound(object sender, GridViewRowEventArgs e)
- {
- if (e.Row.RowType == DataControlRowType.DataRow)
- {
- GridView oGridView = (GridView)e.Row.FindControl("gvdetail1");
- if (oGridView != null)
- {
- Label lblname = (Label)e.Row.FindControl("lbl4_detail");
- Label lbltype = (Label)e.Row.FindControl("lbl4_type");
- Label lblid = (Label)e.Row.FindControl("lbl4_department");
- Label lblcompany = (Label)e.Row.FindControl("lbl4_company");
- string str_b_time = b_time.Text.ToString();
- string str_e_time = e_time.ToString();
- int step = 1;
- DataSet ds = new DataSet();
- DataTable dt = new DataTable();
- dt.Columns.Add(new DataColumn("form_id", typeof(string)));
- dt.Columns.Add(new DataColumn("department", typeof(string)));
- dt.Columns.Add(new DataColumn("apply_time", typeof(string)));
- dt.Columns.Add(new DataColumn("emp_name", typeof(string)));
- dt.Columns.Add(new DataColumn("eq_type", typeof(string)));
- dt.Columns.Add(new DataColumn("eq_detail", typeof(string)));
- dt.Columns.Add(new DataColumn("company", typeof(string)));
- dt.Columns.Add(new DataColumn("content", typeof(string)));
- dt.Columns.Add(new DataColumn("check_md", typeof(string)));
- dt.Columns.Add(new DataColumn("check_company", typeof(string)));
- dt.Columns.Add(new DataColumn("comment", typeof(string)));
- dt.Columns.Add(new DataColumn("check_time", typeof(string)));
- SqlConnection conn = dbConnection.getConnection();
- conn.Open();
- string sqlstr = "select a.form_id as form_id,c.emp_name as emp_name,a.eq_type as eq_type,a.eq_detail as eq_detail,a.company as company,a.content as content from OA_REPAIR_FORM_DETAIL as a,OA_REPAIR_FORM as b,OA_EMPLOYEE as c where b.form_id=a.form_id and b.emp_id=c.id and a.department_id='" + lblid.Text + "' and a.eq_type='" + lbltype.Text + "' and a.eq_detail='" + lblname.Text + "' and a.company='" + lblcompany.Text + "'";
- if ((!(str_b_time.Equals(""))) && (!(str_e_time.Equals(""))))
- {
- sqlstr = sqlstr + " and (a.form_id between'" + str_b_time + "' and '" + str_e_time + "')";
- }
- SqlCommand sqlcom = new SqlCommand(sqlstr, conn);
- SqlDataReader dr1 = sqlcom.ExecuteReader();
- if (dr1.HasRows)
- {
- while (dr1.Read())
- {
- DataRow row = dt.NewRow();
- row["form_id"] = dr1["form_id"].ToString();
- row["emp_name"] = dr1["emp_name"].ToString();
- row["eq_type"] = dr1["eq_type"].ToString();
- row["eq_detail"] = dr1["eq_detail"].ToString();
- row["company"] = dr1["company"].ToString();
- row["content"] = dr1["content"].ToString();
- row["apply_time"] = SetTime(dr1["form_id"].ToString());
- SqlConnection conn1 = dbConnection.getConnection();
- conn1.Open();
- SqlCommand sqlcom5 = new SqlCommand("select name from OA_DEPARTMENT where id='" + lblid.Text + "'", conn1);
- SqlDataReader dr5 = sqlcom5.ExecuteReader();
- if (dr5.HasRows)
- {
- while (dr5.Read())
- {
- row["department"] = dr5["name"].ToString();
- }
- }
- dr5.Close();
- SqlCommand sqlcom1 = new SqlCommand("select max(step) as step from OA_REPAIR_FLOW where form_id='" + dr1["form_id"].ToString() + "'", conn1);
- SqlDataReader dr4 = sqlcom1.ExecuteReader();
- if (dr4.HasRows)
- {
- while (dr4.Read())
- {
- if (!(dr4["step"].ToString().Equals("")))
- {
- step = Convert.ToInt32(dr4["step"]);
- }
- }
- }
- dr4.Close();
- SqlCommand sqlcom2 = new SqlCommand("select is_agree from OA_REPAIR_FLOW where form_id='" + dr1["form_id"].ToString() + "'and step=" + step, conn1);
- SqlDataReader dr2 = sqlcom2.ExecuteReader();
- if (dr2.HasRows)
- {
- while (dr2.Read())
- {
- if (dr2["is_agree"].ToString().Equals("Y"))
- {
- row["check_md"] = "已完工";
- }
- else if (dr2["is_agree"].ToString().Equals("N"))
- {
- row["check_md"] = "未处理";
- }
- else
- {
- row["check_md"] = "";
- }
- }
- }
- dr2.Close();
- SqlCommand sqlcom3 = new SqlCommand("select is_agree,comment,check_time from OA_COMPANY_CHECK where form_id='" + dr1["form_id"].ToString() + "' and company='" + dr1["company"].ToString() + "'", conn1);
- SqlDataReader dr3 = sqlcom3.ExecuteReader();
- if (dr3.HasRows)
- {
- while (dr3.Read())
- {
- if (dr3["is_agree"].ToString().Equals("Y"))
- {
- row["check_company"] = "已完工";
- }
- else if (dr3["is_agree"].ToString().Equals("N"))
- {
- row["check_company"] = "未处理";
- }
- else
- {
- row["check_company"] = "";
- }
- row["comment"] = dr3["comment"].ToString().Replace("/n", "<br>").ToString();
- row["check_time"] = SetTime(dr3["check_time"].ToString());
- }
- }
- dr3.Close();
- conn1.Close();
- dt.Rows.Add(row);
- }
- }
- ds.Tables.Add(dt);
- oGridView.DataSource = ds;
- oGridView.DataBind();
- dr1.Close();
- conn.Close();
- }
- }
- }
- protected void bind3()
- {
- string str_company = dl_company.SelectedItem.ToString();
- string str_department = dl_department.SelectedItem.ToString();
- string str_type = dl_type.SelectedItem.ToString();
- string str_name = dl_name.SelectedItem.ToString();
- string str_b_time = b_time.Text.ToString();
- string str_e_time = e_time.ToString();
- SqlConnection conn = dbConnection.getConnection();
- conn.Open();
- DataSet ds = new DataSet();
- DataTable dt = new DataTable();
- dt.Columns.Add("id", typeof(Int32));
- dt.Columns.Add("type", typeof(string));
- dt.Columns.Add("num", typeof(Int32));
- string str = "select id,type from OA_UNIT_TYPE where type='" + str_type + "'";
- if(str_type.Equals("所有类型"))
- {
- str = "select id,type from OA_UNIT_TYPE order by id";
- }
- SqlCommand sqlcom = new SqlCommand(str,conn);
- SqlDataReader dr = sqlcom.ExecuteReader();
- if (dr.HasRows)
- {
- while (dr.Read())
- {
- SqlConnection conn1 = dbConnection.getConnection();
- conn1.Open();
- string sqlstr = "select count(*) as num from OA_REPAIR_FORM_DETAIL where eq_type='" + dr["type"] + "'";
- if (!(str_name.Equals("所有设备")))
- {
- sqlstr = sqlstr + " and eq_detail='" + str_name + "'";
- }
- if (!(str_company.Equals("所有厂商")))
- {
- sqlstr = sqlstr + " and company='" + str_company + "'";
- }
- if (!(str_department.Equals("所有门店")))
- {
- SqlCommand sqlcom2 = new SqlCommand("select id from OA_DEPARTMENT where name='" + str_department + "'", conn1);
- SqlDataReader dr2 = sqlcom2.ExecuteReader();
- if (dr2.HasRows)
- {
- while (dr2.Read())
- {
- sqlstr = sqlstr + " and department_id=" + Convert.ToInt32(dr2["id"]);
- }
- }
- dr2.Close();
- }
- if ((!(str_b_time.Equals(""))) && (!(str_e_time.Equals(""))))
- {
- sqlstr = sqlstr + " and (form_id between'" + str_b_time + "' and '" + str_e_time + "')";
- }
- SqlCommand sqlcom1 = new SqlCommand(sqlstr,conn1);
- SqlDataReader dr1 = sqlcom1.ExecuteReader();
- if (dr1.HasRows)
- {
- while (dr1.Read())
- {
- if (Convert.ToInt32(dr1["num"]) > 0)
- {
- DataRow row = dt.NewRow();
- row["id"] = Convert.ToInt32(dr["id"]);
- row["type"] = dr["type"].ToString();
- row["num"] = Convert.ToInt32(dr1["num"]);
- dt.Rows.Add(row);
- }
- }
- }
- dr1.Close();
- conn1.Close();
- }
- }
- dr.Close();
- conn.Close();
- ds.Tables.Add(dt);
- gvParent2.DataSource = ds;
- gvParent2.DataBind();
- }
- protected void gvParent2_RowDataBound(object sender, GridViewRowEventArgs e)
- {
- if (e.Row.RowType == DataControlRowType.DataRow)
- {
- GridView oGridView = (GridView)e.Row.FindControl("gvChild2");
- if (oGridView != null)
- {
- string str_company = dl_company.SelectedItem.ToString();
- string str_department = dl_department.SelectedItem.ToString();
- string str_type = dl_type.SelectedItem.ToString();
- string str_name = dl_name.SelectedItem.ToString();
- string str_b_time = b_time.Text.ToString();
- string str_e_time = e_time.ToString();
- Label lblID = (Label)e.Row.FindControl("lbll1_ID");
- string str = "select id,eq_name from OA_UNIT_DETAIL where eq_type='" + lblID.Text + "' and eq_name='" + str_name + "'";
- if (str_name.Equals("所有设备"))
- {
- str = "select id,eq_name from OA_UNIT_DETAIL where eq_type='" + lblID.Text + "'";
- }
- SqlConnection conn = dbConnection.getConnection();
- conn.Open();
- DataSet ds = new DataSet();
- DataTable dt = new DataTable();
- dt.Columns.Add("id", typeof(Int32));
- dt.Columns.Add("name", typeof(string));
- dt.Columns.Add("type", typeof(string));
- dt.Columns.Add("num", typeof(Int32));
- SqlCommand sqlcom = new SqlCommand(str,conn);
- SqlDataReader dr = sqlcom.ExecuteReader();
- if (dr.HasRows)
- {
- while (dr.Read())
- {
- SqlConnection conn1 = dbConnection.getConnection();
- conn1.Open();
- string sqlstr = "select count(*) as num from OA_REPAIR_FORM_DETAIL where eq_type='" + lblID.Text + "' and eq_detail='" + dr["eq_name"].ToString() + "'";
- if(!(str_company.Equals("所有厂商")))
- {
- sqlstr = sqlstr + " and company='" + str_company + "'";
- }
- if (!(str_department.Equals("所有门店")))
- {
- SqlCommand sqlcom2 = new SqlCommand("select id from OA_DEPARTMENT where name='" + str_department + "'", conn1);
- SqlDataReader dr2 = sqlcom2.ExecuteReader();
- if (dr2.HasRows)
- {
- while (dr2.Read())
- {
- sqlstr = sqlstr + " and department_id=" + Convert.ToInt32(dr2["id"]);
- }
- }
- dr2.Close();
- }
- if ((!(str_b_time.Equals(""))) && (!(str_e_time.Equals(""))))
- {
- sqlstr = sqlstr + " and (form_id between'" + str_b_time + "' and '" + str_e_time + "')";
- }
- SqlCommand sqlcom1 = new SqlCommand(sqlstr,conn1);
- SqlDataReader dr1 = sqlcom1.ExecuteReader();
- if (dr1.HasRows)
- {
- while (dr1.Read())
- {
- if (Convert.ToInt32(dr1["num"]) > 0)
- {
- DataRow row = dt.NewRow();
- row["id"] = Convert.ToInt32(dr["id"]);
- row["name"] = dr["eq_name"].ToString();
- row["num"] = Convert.ToInt32(dr1["num"]);
- row["type"] = lblID.Text.ToString();
- dt.Rows.Add(row);
- }
- }
- }
- dr1.Close();
- conn1.Close();
- }
- }
- dr.Close();
- conn.Close();
- ds.Tables.Add(dt);
- oGridView.DataSource = ds;
- oGridView.DataBind();
- }
- }
- }
- protected void gvChild2_RowDataBound(object sender, GridViewRowEventArgs e)
- {
- if (e.Row.RowType == DataControlRowType.DataRow)
- {
- GridView oGridView = (GridView)e.Row.FindControl("gvthird2");
- if (oGridView != null)
- {
- string str_company = dl_company.SelectedItem.ToString();
- string str_department = dl_department.SelectedItem.ToString();
- string str_type = dl_type.SelectedItem.ToString();
- string str_name = dl_name.SelectedItem.ToString();
- string str_b_time = b_time.Text.ToString();
- string str_e_time = e_time.ToString();
- Label lbltype = (Label)e.Row.FindControl("lbll2_type");
- Label lblid = (Label)e.Row.FindControl("lbll2_name");
- string str = "select id,company from OA_COMPANY where company='" + str_company + "'";
- if (str_company.Equals("所有厂商"))
- {
- str = "select id,company from OA_COMPANY";
- }
- SqlConnection conn = dbConnection.getConnection();
- conn.Open();
- DataSet ds = new DataSet();
- DataTable dt = new DataTable();
- dt.Columns.Add("id", typeof(Int32));
- dt.Columns.Add("company", typeof(string));
- dt.Columns.Add("num", typeof(Int32));
- dt.Columns.Add("type", typeof(string));
- dt.Columns.Add("name", typeof(string));
- SqlCommand sqlcom = new SqlCommand(str,conn);
- SqlDataReader dr = sqlcom.ExecuteReader();
- if (dr.HasRows)
- {
- while (dr.Read())
- {
- SqlConnection conn1 = dbConnection.getConnection();
- conn1.Open();
- string sqlstr = "select count(*) as num from OA_REPAIR_FORM_DETAIL where eq_type='" + lbltype.Text + "' and eq_detail='" + lblid.Text + "' and company='" + dr["company"].ToString() + "'";
- if (!(str_department.Equals("所有门店")))
- {
- SqlCommand sqlcom2 = new SqlCommand("select id from OA_DEPARTMENT where name='" + str_department + "'", conn1);
- SqlDataReader dr2 = sqlcom2.ExecuteReader();
- if (dr2.HasRows)
- {
- while (dr2.Read())
- {
- sqlstr = sqlstr + " and department_id=" + Convert.ToInt32(dr2["id"]);
- }
- }
- dr2.Close();
- }
- if ((!(str_b_time.Equals(""))) && (!(str_e_time.Equals(""))))
- {
- sqlstr = sqlstr + " and (form_id between'" + str_b_time + "' and '" + str_e_time + "')";
- }
- SqlCommand sqlcom1 = new SqlCommand(sqlstr, conn1);
- SqlDataReader dr1 = sqlcom1.ExecuteReader();
- if (dr1.HasRows)
- {
- while (dr1.Read())
- {
- if (Convert.ToInt32(dr1["num"]) > 0)
- {
- DataRow row = dt.NewRow();
- row["type"] = lbltype.Text;
- row["name"] = lblid.Text;
- row["id"] = Convert.ToInt32(dr["id"]);
- row["company"] = dr["company"].ToString();
- row["num"] = Convert.ToInt32(dr1["num"]);
- dt.Rows.Add(row);
- }
- }
- }
- dr1.Close();
- conn1.Close();
- }
- }
- dr.Close();
- conn.Close();
- ds.Tables.Add(dt);
- oGridView.DataSource = ds;
- oGridView.DataBind();
- }
- }
- }
- protected void gvthird2_RowDataBound(object sender, GridViewRowEventArgs e)
- {
- if (e.Row.RowType == DataControlRowType.DataRow)
- {
- GridView oGridView = (GridView)e.Row.FindControl("gvdetail2");
- if (oGridView != null)
- {
- Label lblname = (Label)e.Row.FindControl("lbll3_detail");
- Label lbltype = (Label)e.Row.FindControl("lbll3_type");
- Label lblcompany = (Label)e.Row.FindControl("lbll3_company");
- string str_department = dl_department.SelectedItem.ToString();
- string str_b_time = b_time.Text.ToString();
- string str_e_time = e_time.ToString();
- int step = 1;
- DataSet ds = new DataSet();
- DataTable dt = new DataTable();
- dt.Columns.Add(new DataColumn("form_id", typeof(string)));
- dt.Columns.Add(new DataColumn("department", typeof(string)));
- dt.Columns.Add(new DataColumn("apply_time", typeof(string)));
- dt.Columns.Add(new DataColumn("emp_name", typeof(string)));
- dt.Columns.Add(new DataColumn("eq_type", typeof(string)));
- dt.Columns.Add(new DataColumn("eq_detail", typeof(string)));
- dt.Columns.Add(new DataColumn("company", typeof(string)));
- dt.Columns.Add(new DataColumn("content", typeof(string)));
- dt.Columns.Add(new DataColumn("check_md", typeof(string)));
- dt.Columns.Add(new DataColumn("check_company", typeof(string)));
- dt.Columns.Add(new DataColumn("comment", typeof(string)));
- dt.Columns.Add(new DataColumn("check_time", typeof(string)));
- SqlConnection conn = dbConnection.getConnection();
- conn.Open();
- string sqlstr = "select a.department_id as department_id,a.form_id as form_id,c.emp_name as emp_name,a.eq_type as eq_type,a.eq_detail as eq_detail,a.company as company,a.content as content from OA_REPAIR_FORM_DETAIL as a,OA_REPAIR_FORM as b,OA_EMPLOYEE as c where b.form_id=a.form_id and b.emp_id=c.id and a.eq_type='" + lbltype.Text + "' and a.eq_detail='" + lblname.Text + "' and a.company='" + lblcompany.Text + "'";
- if ((!(str_b_time.Equals(""))) && (!(str_e_time.Equals(""))))
- {
- sqlstr = sqlstr + " and (a.form_id between'" + str_b_time + "' and '" + str_e_time + "')";
- }
- if (!(str_department.Equals("所有门店")))
- {
- SqlCommand sqlcom6 = new SqlCommand("select id from OA_DEPARTMENT where name='" + str_department + "'", conn);
- SqlDataReader dr6 = sqlcom6.ExecuteReader();
- if (dr6.HasRows)
- {
- while (dr6.Read())
- {
- sqlstr = sqlstr + " and a.department_id=" + Convert.ToInt32(dr6["id"]);
- }
- }
- dr6.Close();
- }
- SqlCommand sqlcom = new SqlCommand(sqlstr, conn);
- SqlDataReader dr1 = sqlcom.ExecuteReader();
- if (dr1.HasRows)
- {
- while (dr1.Read())
- {
- DataRow row = dt.NewRow();
- row["form_id"] = dr1["form_id"].ToString();
- row["emp_name"] = dr1["emp_name"].ToString();
- row["eq_type"] = dr1["eq_type"].ToString();
- row["eq_detail"] = dr1["eq_detail"].ToString();
- row["company"] = dr1["company"].ToString();
- row["content"] = dr1["content"].ToString();
- row["apply_time"] = SetTime(dr1["form_id"].ToString());
- SqlConnection conn1 = dbConnection.getConnection();
- conn1.Open();
- SqlCommand sqlcom5 = new SqlCommand("select name from OA_DEPARTMENT where id='" + dr1["department_id"].ToString() + "'", conn1);
- SqlDataReader dr5 = sqlcom5.ExecuteReader();
- if (dr5.HasRows)
- {
- while (dr5.Read())
- {
- row["department"] = dr5["name"].ToString();
- }
- }
- dr5.Close();
- SqlCommand sqlcom1 = new SqlCommand("select max(step) as step from OA_REPAIR_FLOW where form_id='" + dr1["form_id"].ToString() + "'", conn1);
- SqlDataReader dr4 = sqlcom1.ExecuteReader();
- if (dr4.HasRows)
- {
- while (dr4.Read())
- {
- if (!(dr4["step"].ToString().Equals("")))
- {
- step = Convert.ToInt32(dr4["step"]);
- }
- }
- }
- dr4.Close();
- SqlCommand sqlcom2 = new SqlCommand("select is_agree from OA_REPAIR_FLOW where form_id='" + dr1["form_id"].ToString() + "'and step=" + step, conn1);
- SqlDataReader dr2 = sqlcom2.ExecuteReader();
- if (dr2.HasRows)
- {
- while (dr2.Read())
- {
- if (dr2["is_agree"].ToString().Equals("Y"))
- {
- row["check_md"] = "已完工";
- }
- else if (dr2["is_agree"].ToString().Equals("N"))
- {
- row["check_md"] = "未处理";
- }
- else
- {
- row["check_md"] = "";
- }
- }
- }
- dr2.Close();
- SqlCommand sqlcom3 = new SqlCommand("select is_agree,comment,check_time from OA_COMPANY_CHECK where form_id='" + dr1["form_id"].ToString() + "' and company='" + dr1["company"].ToString() + "'", conn1);
- SqlDataReader dr3 = sqlcom3.ExecuteReader();
- if (dr3.HasRows)
- {
- while (dr3.Read())
- {
- if (dr3["is_agree"].ToString().Equals("Y"))
- {
- row["check_company"] = "已完工";
- }
- else if (dr3["is_agree"].ToString().Equals("N"))
- {
- row["check_company"] = "未处理";
- }
- else
- {
- row["check_company"] = "";
- }
- row["comment"] = dr3["comment"].ToString().Replace("/n", "<br>").ToString();
- row["check_time"] = SetTime(dr3["check_time"].ToString());
- }
- }
- dr3.Close();
- conn1.Close();
- dt.Rows.Add(row);
- }
- }
- ds.Tables.Add(dt);
- oGridView.DataSource = ds;
- oGridView.DataBind();
- dr1.Close();
- conn.Close();
- }
- }
- }
- protected void bind4()
- {
- string str_company = dl_company.SelectedItem.ToString();
- string str_department = dl_department.SelectedItem.ToString();
- string str_type = dl_type.SelectedItem.ToString();
- string str_name = dl_name.SelectedItem.ToString();
- string str_b_time = b_time.Text.ToString();
- string str_e_time = e_time.ToString();
- SqlConnection conn = dbConnection.getConnection();
- conn.Open();
- DataSet ds = new DataSet();
- DataTable dt = new DataTable();
- dt.Columns.Add("id", typeof(Int32));
- dt.Columns.Add("type", typeof(string));
- dt.Columns.Add("num", typeof(Int32));
- string str = "select id,type from OA_UNIT_TYPE where type='" + str_type + "'";
- if (str_type.Equals("所有类型"))
- {
- str = "select id,type from OA_UNIT_TYPE order by id";
- }
- SqlCommand sqlcom = new SqlCommand(str, conn);
- SqlDataReader dr = sqlcom.ExecuteReader();
- if (dr.HasRows)
- {
- while (dr.Read())
- {
- SqlConnection conn1 = dbConnection.getConnection();
- conn1.Open();
- string sqlstr = "select count(*) as num from OA_REPAIR_FORM_DETAIL where eq_type='" + dr["type"].ToString() + "'";
- if (!(str_name.Equals("所有设备")))
- {
- sqlstr = sqlstr + " and eq_detail='" + str_name + "'";
- }
- if (!(str_company.Equals("所有厂商")))
- {
- sqlstr = sqlstr + " and company='" + str_company + "'";
- }
- if (!(str_department.Equals("所有门店")))
- {
- SqlCommand sqlcom2 = new SqlCommand("select id from OA_DEPARTMENT where name='" + str_department + "'", conn1);
- SqlDataReader dr2 = sqlcom2.ExecuteReader();
- if (dr2.HasRows)
- {
- while (dr2.Read())
- {
- sqlstr = sqlstr + " and department_id=" + Convert.ToInt32(dr2["id"]);
- }
- }
- dr2.Close();
- }
- if ((!(str_b_time.Equals(""))) && (!(str_e_time.Equals(""))))
- {
- sqlstr = sqlstr + " and (form_id between'" + str_b_time + "' and '" + str_e_time + "')";
- }
- SqlCommand sqlcom1 = new SqlCommand(sqlstr, conn1);
- SqlDataReader dr1 = sqlcom1.ExecuteReader();
- if (dr1.HasRows)
- {
- while (dr1.Read())
- {
- if (Convert.ToInt32(dr1["num"]) > 0)
- {
- DataRow row = dt.NewRow();
- row["id"] = Convert.ToInt32(dr["id"]);
- row["type"] = dr["type"].ToString();
- row["num"] = Convert.ToInt32(dr1["num"]);
- dt.Rows.Add(row);
- }
- }
- }
- dr1.Close();
- conn1.Close();
- }
- }
- dr.Close();
- conn.Close();
- ds.Tables.Add(dt);
- gvParent3.DataSource = ds;
- gvParent3.DataBind();
- }
- protected void gvParent3_RowDataBound(object sender, GridViewRowEventArgs e)
- {
- if (e.Row.RowType == DataControlRowType.DataRow)
- {
- GridView oGridView = (GridView)e.Row.FindControl("gvChild3");
- if (oGridView != null)
- {
- string str_company = dl_company.SelectedItem.ToString();
- string str_department = dl_department.SelectedItem.ToString();
- string str_type = dl_type.SelectedItem.ToString();
- string str_name = dl_name.SelectedItem.ToString();
- string str_b_time = b_time.Text.ToString();
- string str_e_time = e_time.ToString();
- Label lblID = (Label)e.Row.FindControl("lblll1_ID");
- string str = "select id,eq_name from OA_UNIT_DETAIL where eq_type='" + lblID.Text + "' and eq_name='" + str_name + "'";
- if (str_name.Equals("所有设备"))
- {
- str = "select id,eq_name from OA_UNIT_DETAIL where eq_type='" + lblID.Text + "'";
- }
- SqlConnection conn = dbConnection.getConnection();
- conn.Open();
- DataSet ds = new DataSet();
- DataTable dt = new DataTable();
- dt.Columns.Add("id", typeof(Int32));
- dt.Columns.Add("name", typeof(string));
- dt.Columns.Add("type", typeof(string));
- dt.Columns.Add("num", typeof(Int32));
- SqlCommand sqlcom = new SqlCommand(str, conn);
- SqlDataReader dr = sqlcom.ExecuteReader();
- if (dr.HasRows)
- {
- while (dr.Read())
- {
- SqlConnection conn1 = dbConnection.getConnection();
- conn1.Open();
- string sqlstr = "select count(*) as num from OA_REPAIR_FORM_DETAIL where eq_type='" + lblID.Text + "' and eq_detail='" + dr["eq_name"].ToString() + "'";
- if (!(str_company.Equals("所有厂商")))
- {
- sqlstr = sqlstr + " and company='" + str_company + "'";
- }
- if (!(str_department.Equals("所有门店")))
- {
- SqlCommand sqlcom2 = new SqlCommand("select id from OA_DEPARTMENT where name='" + str_department + "'", conn1);
- SqlDataReader dr2 = sqlcom2.ExecuteReader();
- if (dr2.HasRows)
- {
- while (dr2.Read())
- {
- sqlstr = sqlstr + " and department_id=" + Convert.ToInt32(dr2["id"]);
- }
- }
- dr2.Close();
- }
- if ((!(str_b_time.Equals(""))) && (!(str_e_time.Equals(""))))
- {
- sqlstr = sqlstr + " and (form_id between'" + str_b_time + "' and '" + str_e_time + "')";
- }
- SqlCommand sqlcom1 = new SqlCommand(sqlstr, conn1);
- SqlDataReader dr1 = sqlcom1.ExecuteReader();
- if (dr1.HasRows)
- {
- while (dr1.Read())
- {
- if (Convert.ToInt32(dr1["num"]) > 0)
- {
- DataRow row = dt.NewRow();
- row["id"] = Convert.ToInt32(dr["id"]);
- row["name"] = dr["eq_name"].ToString();
- row["num"] = Convert.ToInt32(dr1["num"]);
- row["type"] = lblID.Text.ToString();
- dt.Rows.Add(row);
- }
- }
- }
- dr1.Close();
- conn1.Close();
- }
- }
- dr.Close();
- conn.Close();
- ds.Tables.Add(dt);
- oGridView.DataSource = ds;
- oGridView.DataBind();
- }
- }
- }
- protected void gvChild3_RowDataBound(object sender, GridViewRowEventArgs e)
- {
- if (e.Row.RowType == DataControlRowType.DataRow)
- {
- GridView oGridView = (GridView)e.Row.FindControl("gvthird3");
- if (oGridView != null)
- {
- string str_company = dl_company.SelectedItem.ToString();
- string str_department = dl_department.SelectedItem.ToString();
- string str_type = dl_type.SelectedItem.ToString();
- string str_name = dl_name.SelectedItem.ToString();
- string str_b_time = b_time.Text.ToString();
- string str_e_time = e_time.ToString();
- Label lbltype = (Label)e.Row.FindControl("lblll2_type");
- Label lblid = (Label)e.Row.FindControl("lblll2_name");
- string str = "select id,name from OA_DEPARTMENT where name='" + str_department + "'";
- if (str_department.Equals("所有门店"))
- {
- str = "select id,name from OA_DEPARTMENT where (charindex('店', name) > 0)";
- }
- SqlConnection conn = dbConnection.getConnection();
- conn.Open();
- DataSet ds = new DataSet();
- DataTable dt = new DataTable();
- dt.Columns.Add("id", typeof(Int32));
- dt.Columns.Add("department", typeof(string));
- dt.Columns.Add("num", typeof(Int32));
- dt.Columns.Add("type", typeof(string));
- dt.Columns.Add("name", typeof(string));
- SqlCommand sqlcom = new SqlCommand(str, conn);
- SqlDataReader dr = sqlcom.ExecuteReader();
- if (dr.HasRows)
- {
- while (dr.Read())
- {
- SqlConnection conn1 = dbConnection.getConnection();
- conn1.Open();
- string sqlstr = "select count(*) as num from OA_REPAIR_FORM_DETAIL where eq_type='" + lbltype.Text + "' and eq_detail='" + lblid.Text + "' and department_id=" + Convert.ToInt32(dr["id"]);
- if (!(str_company.Equals("所有厂商")))
- {
- sqlstr = sqlstr + " and company='" + str_company + "'";
- }
- if ((!(str_b_time.Equals(""))) && (!(str_e_time.Equals(""))))
- {
- sqlstr = sqlstr + " and (form_id between'" + str_b_time + "' and '" + str_e_time + "')";
- }
- ShowMessageBox(sqlstr);
- SqlCommand sqlcom1 = new SqlCommand(sqlstr,conn1);
- SqlDataReader dr1 = sqlcom1.ExecuteReader();
- if (dr1.HasRows)
- {
- while (dr1.Read())
- {
- if (Convert.ToInt32(dr1["num"]) > 0)
- {
- DataRow row = dt.NewRow();
- row["type"] = lbltype.Text;
- row["name"] = lblid.Text;
- row["id"] = Convert.ToInt32(dr["id"]);
- row["department"] = dr["name"].ToString();
- row["num"] = Convert.ToInt32(dr1["num"]);
- dt.Rows.Add(row);
- }
- }
- }
- dr1.Close();
- conn1.Close();
- }
- }
- dr.Close();
- conn.Close();
- ds.Tables.Add(dt);
- oGridView.DataSource = ds;
- oGridView.DataBind();
- }
- }
- }
- protected void gvthird3_RowDataBound(object sender, GridViewRowEventArgs e)
- {
- if (e.Row.RowType == DataControlRowType.DataRow)
- {
- GridView oGridView = (GridView)e.Row.FindControl("gvdetail3");
- if (oGridView != null)
- {
- Label lblname = (Label)e.Row.FindControl("lblll3_detail");
- Label lbltype = (Label)e.Row.FindControl("lblll3_type");
- Label lbldepartment = (Label)e.Row.FindControl("lblll3_department");
- string str_company = dl_company.SelectedItem.ToString();
- string str_b_time = b_time.Text.ToString();
- string str_e_time = e_time.ToString();
- int step = 1;
- DataSet ds = new DataSet();
- DataTable dt = new DataTable();
- dt.Columns.Add(new DataColumn("form_id", typeof(string)));
- dt.Columns.Add(new DataColumn("department", typeof(string)));
- dt.Columns.Add(new DataColumn("apply_time", typeof(string)));
- dt.Columns.Add(new DataColumn("emp_name", typeof(string)));
- dt.Columns.Add(new DataColumn("eq_type", typeof(string)));
- dt.Columns.Add(new DataColumn("eq_detail", typeof(string)));
- dt.Columns.Add(new DataColumn("company", typeof(string)));
- dt.Columns.Add(new DataColumn("content", typeof(string)));
- dt.Columns.Add(new DataColumn("check_md", typeof(string)));
- dt.Columns.Add(new DataColumn("check_company", typeof(string)));
- dt.Columns.Add(new DataColumn("comment", typeof(string)));
- dt.Columns.Add(new DataColumn("check_time", typeof(string)));
- SqlConnection conn = dbConnection.getConnection();
- conn.Open();
- string sqlstr = "select a.form_id as form_id,c.emp_name as emp_name,a.eq_type as eq_type,a.eq_detail as eq_detail,a.company as company,a.content as content from OA_REPAIR_FORM_DETAIL as a,OA_REPAIR_FORM as b,OA_EMPLOYEE as c where b.form_id=a.form_id and b.emp_id=c.id and a.eq_type='" + lbltype.Text + "' and a.eq_detail='" + lblname.Text + "' and a.department_id='" + lbldepartment.Text + "'";
- if ((!(str_b_time.Equals(""))) && (!(str_e_time.Equals(""))))
- {
- sqlstr = sqlstr + " and (a.form_id between'" + str_b_time + "' and '" + str_e_time + "')";
- }
- if (!(str_company.Equals("所有厂商")))
- {
- sqlstr = sqlstr + " and a.company='" + str_company + "'";
- }
- SqlCommand sqlcom = new SqlCommand(sqlstr, conn);
- SqlDataReader dr1 = sqlcom.ExecuteReader();
- if (dr1.HasRows)
- {
- while (dr1.Read())
- {
- DataRow row = dt.NewRow();
- row["form_id"] = dr1["form_id"].ToString();
- row["emp_name"] = dr1["emp_name"].ToString();
- row["eq_type"] = dr1["eq_type"].ToString();
- row["eq_detail"] = dr1["eq_detail"].ToString();
- row["company"] = dr1["company"].ToString();
- row["content"] = dr1["content"].ToString();
- row["apply_time"] = SetTime(dr1["form_id"].ToString());
- SqlConnection conn1 = dbConnection.getConnection();
- conn1.Open();
- SqlCommand sqlcom5 = new SqlCommand("select name from OA_DEPARTMENT where id='" + lbldepartment.Text + "'", conn1);
- SqlDataReader dr5 = sqlcom5.ExecuteReader();
- if (dr5.HasRows)
- {
- while (dr5.Read())
- {
- row["department"] = dr5["name"].ToString();
- }
- }
- dr5.Close();
- SqlCommand sqlcom1 = new SqlCommand("select max(step) as step from OA_REPAIR_FLOW where form_id='" + dr1["form_id"].ToString() + "'", conn1);
- SqlDataReader dr4 = sqlcom1.ExecuteReader();
- if (dr4.HasRows)
- {
- while (dr4.Read())
- {
- if (!(dr4["step"].ToString().Equals("")))
- {
- step = Convert.ToInt32(dr4["step"]);
- }
- }
- }
- dr4.Close();
- SqlCommand sqlcom2 = new SqlCommand("select is_agree from OA_REPAIR_FLOW where form_id='" + dr1["form_id"].ToString() + "'and step=" + step, conn1);
- SqlDataReader dr2 = sqlcom2.ExecuteReader();
- if (dr2.HasRows)
- {
- while (dr2.Read())
- {
- if (dr2["is_agree"].ToString().Equals("Y"))
- {
- row["check_md"] = "已完工";
- }
- else if (dr2["is_agree"].ToString().Equals("N"))
- {
- row["check_md"] = "未处理";
- }
- else
- {
- row["check_md"] = "";
- }
- }
- }
- dr2.Close();
- SqlCommand sqlcom3 = new SqlCommand("select is_agree,comment,check_time from OA_COMPANY_CHECK where form_id='" + dr1["form_id"].ToString() + "' and company='" + dr1["company"].ToString() + "'", conn1);
- SqlDataReader dr3 = sqlcom3.ExecuteReader();
- if (dr3.HasRows)
- {
- while (dr3.Read())
- {
- if (dr3["is_agree"].ToString().Equals("Y"))
- {
- row["check_company"] = "已完工";
- }
- else if (dr3["is_agree"].ToString().Equals("N"))
- {
- row["check_company"] = "未处理";
- }
- else
- {
- row["check_company"] = "";
- }
- row["comment"] = dr3["comment"].ToString().Replace("/n", "<br>").ToString();
- row["check_time"] = SetTime(dr3["check_time"].ToString());
- }
- }
- dr3.Close();
- conn1.Close();
- dt.Rows.Add(row);
- }
- }
- ds.Tables.Add(dt);
- oGridView.DataSource = ds;
- oGridView.DataBind();
- dr1.Close();
- conn.Close();
- }
- }
- }
- }