private void initial() { DAl.Sample sampleobj = new DAl.Sample(); drop_rwtype.SelectedIndex = 0; lbl_reportNO.Text = "报告标识"; lbl_AccessTime.Text = "委托时间"; panel_wtdw.Visible = true; DataTable dtmode = sampleobj.GetMode("", "mode", ""); drop_mode.DataSource = dtmode; drop_mode.DataTextField = "name"; drop_mode.DataValueField = "code"; drop_mode.DataBind(); DataTable dtpurpose = sampleobj.GetPurpose("", 1); drop_ItemList.DataSource = dtpurpose; drop_ItemList.DataTextField = "ItemName"; drop_ItemList.DataValueField = "ItemID"; drop_ItemList.DataBind(); txt_lxtel.Text = ""; txt_lxman.Text = ""; txt_lxemail.Text = ""; txt_address.Text = ""; txt_ReportID.Text = ""; txt_CreateDate.Text = ""; txt_Projectname.Text = ""; txt_wtdepart.Text = ""; txt_xmfzr.Text = ""; drop_urgent.Text = ""; }
private void initial(string id) { DAl.Sample sampleobj = new DAl.Sample(); DataTable dttype = sampleobj.GetMode("", "rwtype", ""); drop_rwtype.DataSource = dttype; drop_rwtype.DataTextField = "name"; drop_rwtype.DataValueField = "code"; drop_rwtype.DataBind(); drop_rwtype.SelectedValue = id; if (drop_rwtype.SelectedIndex == 0) { lbl_reportNO.Text = "报告标识"; lbl_AccessTime.Text = "接到时间"; DataTable dtmode = sampleobj.GetMode("", "mode", "1"); drop_mode.DataSource = dtmode; drop_mode.DataTextField = "name"; drop_mode.DataValueField = "code"; drop_mode.DataBind(); DataTable dtpurpose = sampleobj.GetPurpose("", 0); drop_ItemList.DataSource = dtpurpose; drop_ItemList.DataTextField = "ItemName"; drop_ItemList.DataValueField = "ItemID"; drop_ItemList.DataBind(); } else { lbl_reportNO.Text = "报告标识"; lbl_AccessTime.Text = "委托时间"; DataTable dtmode = sampleobj.GetMode("", "mode", ""); drop_mode.DataSource = dtmode; drop_mode.DataTextField = "name"; drop_mode.DataValueField = "code"; drop_mode.DataBind(); DataTable dtpurpose = sampleobj.GetPurpose("", 1); drop_ItemList.DataSource = dtpurpose; drop_ItemList.DataTextField = "ItemName"; drop_ItemList.DataValueField = "ItemID"; drop_ItemList.DataBind(); } txt_lxtel.Text = ""; txt_lxman.Text = ""; txt_lxemail.Text = ""; txt_address.Text = ""; txt_ReportID.Text = ""; txt_CreateDate.Text = ""; txt_Projectname.Text = ""; txt_wtdepart.Text = ""; txt_xmfzr.Text = ""; drop_urgent.Text = ""; }
protected void drop_rwtype_SelectedIndexChanged(object sender, EventArgs e) { DAl.Sample sampleobj = new DAl.Sample(); lbl_reportNO.Text = "报告标识"; lbl_AccessTime.Text = "委托时间"; panel_wtdw.Visible = true; DataTable dtmode = sampleobj.GetMode("", "mode", ""); drop_mode.DataSource = dtmode; drop_mode.DataTextField = "name"; drop_mode.DataValueField = "code"; drop_mode.DataBind(); }
protected void initial() { DAl.Sample typeobj = new DAl.Sample(); DataTable dt = typeobj.GetSampleType(""); DataTable dtItem = typeobj.GetPurpose("", 1); drop_ItemName.DataSource = dtItem; drop_ItemName.DataTextField = "ItemName"; drop_ItemName.DataValueField = "ItemID"; drop_ItemName.DataBind(); cb_ItemList.DataSource = dt; cb_ItemList.DataTextField = "ClassName"; cb_ItemList.DataValueField = "ClassID"; cb_ItemList.DataBind(); }
private void initial() { drop_rwtype.Items.Clear(); DAl.Sample sampleobj = new DAl.Sample(); DataTable dttype = sampleobj.GetMode("", "rwtype", ""); drop_rwtype.DataSource = dttype; drop_rwtype.DataTextField = "name"; drop_rwtype.DataValueField = "code"; drop_rwtype.DataBind(); ListItem li = new ListItem("请选择"); drop_rwtype.Items.Add(li); drop_rwtype.SelectedIndex = drop_rwtype.Items.Count - 1; }
protected void drop_rwtype_SelectedIndexChanged(object sender, EventArgs e) { DAl.Sample sampleobj = new DAl.Sample(); if (drop_rwtype.SelectedIndex == 0) { lbl_reportNO.Text = "报告标识"; lbl_AccessTime.Text = "接到时间"; DataTable dtmode = sampleobj.GetMode("", "mode", "1"); drop_mode.DataSource = dtmode; drop_mode.DataTextField = "name"; drop_mode.DataValueField = "code"; drop_mode.DataBind(); DataTable dtpurpose = sampleobj.GetPurpose("", 0); drop_ItemList.DataSource = dtpurpose; drop_ItemList.DataTextField = "ItemName"; drop_ItemList.DataValueField = "ItemID"; drop_ItemList.DataBind(); } else { lbl_reportNO.Text = "报告标识"; lbl_AccessTime.Text = "委托时间"; DataTable dtmode = sampleobj.GetMode("", "mode", ""); drop_mode.DataSource = dtmode; drop_mode.DataTextField = "name"; drop_mode.DataValueField = "code"; drop_mode.DataBind(); DataTable dtpurpose = sampleobj.GetPurpose("", 1); drop_ItemList.DataSource = dtpurpose; drop_ItemList.DataTextField = "ItemName"; drop_ItemList.DataValueField = "ItemID"; drop_ItemList.DataBind(); } }
private void Query() { //strSelectedId=txt_samplequery.Text; string strSample = ""; string strDate = ""; if (txt_samplequery.Text != "") { strSample = "and ReportName like'%" + txt_samplequery.Text + "%'"; } if (drop_tkwether.SelectedValue.Trim() == "0") { strSample += " and (StatusID=6)"; } else { strSample += " and (StatusID>=2 and StatusID!=6 )"; } if (cb_query_fa.Checked) { strSample += " and hanwether=1"; } else { strSample += " and hanwether=0"; } if (txt_QueryTime.Text != "") { strDate = " and ReportAccessDate>= '" + DateTime.Parse(txt_QueryTime.Text.Trim() + " 00:00:00") + "' "; } if (txt_QueryTimeEnd.Text != "") { strDate = " and ReportAccessDate<= '" + DateTime.Parse(txt_QueryTimeEnd.Text.Trim() + " 00:00:00") + "'"; } //TBD//项目负责人只能看到自己的项目 string strSql = "select t_Y_FlowInfo.id,t_Y_FlowInfo.ReportAccessDate 时间,t_Y_FlowInfo.ItemType,ItemName 项目类型,ReportName 报告标识,urgent 备注,t_Y_FlowInfo.Ulevel,Projectname 项目名称,rwclass,jcmethod,address,lxman,lxtel,lxemail,wtdepart,wether,varman1,vardate1,varremark1,t_Y_FlowInfo.chargeman,hanwether from t_Y_FlowInfo,t_M_ItemInfo where t_Y_FlowInfo.ItemType=t_M_ItemInfo.ItemID " + strSample + strDate + " order by t_Y_FlowInfo.ReportAccessDate"; DataSet ds = new MyDataOp(strSql).CreateDataSet(); DataColumn dcc = new DataColumn("紧急程度"); ds.Tables[0].Columns.Add(dcc); DataColumn dc = new DataColumn("监测方式"); ds.Tables[0].Columns.Add(dc); DataColumn dc0 = new DataColumn("任务类型"); ds.Tables[0].Columns.Add(dc0); DataColumn dc1 = new DataColumn("委托单位"); ds.Tables[0].Columns.Add(dc1); DataColumn dc2 = new DataColumn("项目负责人"); ds.Tables[0].Columns.Add(dc2); DAl.Sample getobj = new DAl.Sample(); DataTable dtmode = getobj.GetMode("", "mode", ""); DAl.Station get = new DAl.Station(); DataTable dtstation = get.GetWTByName(""); DAl.User.Users userobj = new DAl.User.Users(); DataTable dtuser = userobj.GetUsersDt(""); foreach (DataRow dr in ds.Tables[0].Rows) { if (dr["rwclass"].ToString() == "1") { dr["任务类型"] = "委托监测"; } else { dr["任务类型"] = "例行监测"; } DataRow[] drsel = dtmode.Select("code='" + dr["jcmethod"].ToString() + "'"); if (drsel.Length == 1) { dr["监测方式"] = drsel[0]["name"].ToString(); } else { dr["监测方式"] = ""; } dr["委托单位"] = dr["wtdepart"].ToString(); if (dr["chargeman"].ToString() != "") { DataRow[] druser = dtuser.Select("UserID='" + dr["chargeman"].ToString().Trim() + "'"); if (druser.Length == 1) { dr["项目负责人"] = druser[0]["name"].ToString(); } else { dr["项目负责人"] = ""; } } } if (ds.Tables[0].Rows.Count == 0) { //没有记录仍保留表头 ds.Tables[0].Rows.Add(ds.Tables[0].NewRow()); grdvw_List.DataSource = ds; grdvw_List.DataBind(); int intColumnCount = grdvw_List.Rows[0].Cells.Count; grdvw_List.Rows[0].Cells.Clear(); grdvw_List.Rows[0].Cells.Add(new TableCell()); grdvw_List.Rows[0].Cells[0].ColumnSpan = intColumnCount; } else { grdvw_List.DataSource = ds; grdvw_List.DataBind(); } ds.Dispose(); }
private void Query() { //strSelectedId=txt_samplequery.Text; string strSample = ""; string strDate = ""; if (txt_samplequery.Text != "") { strSample = "and ReportName like'%" + txt_samplequery.Text + "%'"; } if (txt_QueryTime.Text != "") { strDate = " and (year(ReportAccessDate)= '" + DateTime.Parse(txt_QueryTime.Text.Trim() + " 00:00:00").Year + "' AND month(ReportAccessDate)= '" + DateTime.Parse(txt_QueryTime.Text.Trim() + " 00:00:00").Month + "' and day(ReportAccessDate)= '" + DateTime.Parse(txt_QueryTime.Text.Trim() + " 00:00:00").Day + "')"; } string strSql = "select t_Y_FlowInfo.id,t_Y_FlowInfo.ReportAccessDate 时间,t_Y_FlowInfo.ItemType,ItemName 项目类型,ReportName 报告标识,urgent 备注,t_Y_FlowInfo.Ulevel,Projectname 项目名称,t_R_UserInfo.Name 项目负责人,rwclass,jcmethod,address,lxman,lxtel,lxemail,wtdepart from t_Y_FlowInfo,t_M_ItemInfo,t_R_UserInfo where t_Y_FlowInfo.ItemType=t_M_ItemInfo.ItemID and (StatusID='0') and wetherscance=0 and chargeman=t_R_UserInfo.UserID " + strSample + strDate + " order by t_Y_FlowInfo.id"; DataSet ds = new MyDataOp(strSql).CreateDataSet(); DataColumn dcc = new DataColumn("紧急程度"); ds.Tables[0].Columns.Add(dcc); DataColumn dc = new DataColumn("监测方式"); ds.Tables[0].Columns.Add(dc); DataColumn dc0 = new DataColumn("任务类型"); ds.Tables[0].Columns.Add(dc0); DataColumn dc1 = new DataColumn("委托单位"); ds.Tables[0].Columns.Add(dc1); DAl.Sample getobj = new DAl.Sample(); DataTable dtmode = getobj.GetMode("", "mode", ""); DAl.Station get = new DAl.Station(); DataTable dtstation = get.GetStationByName(""); foreach (DataRow dr in ds.Tables[0].Rows) { if (dr["Ulevel"].ToString() == "1") { dr["紧急程度"] = "紧急"; } else { dr["紧急程度"] = "一般"; } if (dr["rwclass"].ToString() == "1") { dr["任务类型"] = "委托监测"; } else { dr["任务类型"] = "例行监测"; } DataRow[] drsel = dtmode.Select("code='" + dr["jcmethod"].ToString() + "'"); if (drsel.Length == 1) { dr["监测方式"] = drsel[0]["name"].ToString(); } else { dr["监测方式"] = ""; } if (dr["wtdepart"].ToString().Trim() != "") { DataRow[] drdep = dtstation.Select("id=" + dr["wtdepart"].ToString().Trim() + ""); if (drdep.Length == 1) { dr["委托单位"] = drdep[0]["单位全称"].ToString(); } else { dr["委托单位"] = ""; } } } if (ds.Tables[0].Rows.Count == 0) { //没有记录仍保留表头 ds.Tables[0].Rows.Add(ds.Tables[0].NewRow()); grdvw_List.DataSource = ds; grdvw_List.DataBind(); int intColumnCount = grdvw_List.Rows[0].Cells.Count; grdvw_List.Rows[0].Cells.Clear(); grdvw_List.Rows[0].Cells.Add(new TableCell()); grdvw_List.Rows[0].Cells[0].ColumnSpan = intColumnCount; } else { grdvw_List.DataSource = ds; grdvw_List.DataBind(); } ds.Dispose(); }
//提交分析项目,登记分析单数据,更细领用分析标志位 protected void btn_Commit_Click(object sender, EventArgs e) { if (txt_jhdate.Text.Trim() == "") { ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "Success", "alert('校核时间不能为空!');", true); return; } else if (txt_jhman.Text.Trim() == "") { ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "Success", "alert('校核人员不能为空!');", true); } else { Entity.Draw draw = new Entity.Draw(); draw.SampleID = strSampleID; draw.ID = int.Parse(strNowLyID); draw.finishdate = DateTime.Now; draw.jhman = txt_jhman.Text; draw.jhtime = DateTime.Parse(txt_jhdate.Text.Trim()); draw.fxman = Request.Cookies["Cookies"].Values["u_id"].ToString().Trim(); foreach (GridViewRow gr in grdvw_ReportDetail.Rows) { Entity.SampleItem item = new Entity.SampleItem(); if (gr.Cells[1].Text.Trim() != "") { item.ID = int.Parse(gr.Cells[1].Text.Trim()); TextBox txt_value = gr.Cells[7].FindControl("txt_value") as TextBox; if (txt_value.Text.Trim() != "") { DateTime time = DateTime.Now; if (gr.Cells[6].Text.Trim() != " " && gr.Cells[6].Text.Trim() != "") { item.AnalysisDate = DateTime.Parse(gr.Cells[6].Text.Trim()); } //item.jhdate = DateTime.Parse(txt_jhdate.Text.Trim()); item.Value = txt_value.Text.Trim(); item.statusID = 1; item.lyID = strNowLyID; item.AnalysisUserID = Request.Cookies["Cookies"].Values["u_id"].ToString().Trim(); //item.jhman = txt_jhman.Text; draw.SampleItemList.Add(item); } } else { item.ID = 0; } } if (fxlist == " " || draw.SampleItemList.Count == grdvw_ReportDetail.Rows.Count) { DAl.Sample sampleobj = new DAl.Sample(); if (sampleobj.ExChangeSample(draw) > 0) { ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "Success", "alert('分析数据提交成功!');hiddenDetailAnalysis();", true); } else { ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "Success", "alert('分析数据提交失败!')", true); } } else { ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "Success", "alert('分析数据登记未全!不能成功提交')", true); } } ReportQuery(); Query(); }
private void Query() { //strSelectedId=txt_samplequery.Text; string strSample = ""; string strDate = ""; if (txt_samplequery.Text != "") { strSample = "and ReportName like'%" + txt_samplequery.Text + "%'"; } strSample += " and tkwether='1'"; if (drop_tkwether.SelectedValue.ToString() == "3") { strSample += " and (statusID='3')"; btn_OK.Visible = true; btn_Save.Visible = true; panel_han.Visible = true; btn_print.Visible = false; btn_back.Visible = true; grdvw_List.Caption = "<FONT style='WIDTH: 102.16%; COLOR:#2292DD;font-size:14pt; LINE-HEIGHT: 150%; FONT-FAMILY: 楷体_GB2312; HEIGHT: 35px'><b>编制整改函</b></font>"; } else { strSample += " and (statusID='5')"; if (Request.Cookies["Cookies"].Values["u_purview"].ToString().Substring(2, 1) != "1") { btn_OK.Visible = false; } else { btn_OK.Visible = true; } btn_back.Visible = false; btn_Save.Visible = false; panel_han.Visible = true; btn_print.Visible = true; grdvw_List.Caption = "<FONT style='WIDTH: 102.16%; COLOR:#2292DD;font-size:14pt; LINE-HEIGHT: 150%; FONT-FAMILY: 楷体_GB2312; HEIGHT: 35px'><b>编制整改函</b></font>"; } if (Request.Cookies["Cookies"].Values["u_purview"].ToString().Substring(2, 1) != "1") { strSample += " and chargeman='" + Request.Cookies["Cookies"].Values["u_id"].ToString() + "'"; } if (txt_QueryTime.Text != "") { strDate = " and (year(ReportAccessDate)= '" + DateTime.Parse(txt_QueryTime.Text.Trim() + " 00:00:00").Year + "' AND month(ReportAccessDate)= '" + DateTime.Parse(txt_QueryTime.Text.Trim() + " 00:00:00").Month + "' and day(ReportAccessDate)= '" + DateTime.Parse(txt_QueryTime.Text.Trim() + " 00:00:00").Day + "')"; } string strSql = "select t_Y_FlowInfo.id,t_Y_FlowInfo.ReportAccessDate 时间,t_Y_FlowInfo.ItemType,ItemName 项目类型,ReportName 报告标识,urgent 备注,t_Y_FlowInfo.Ulevel,Projectname 项目名称,t_R_UserInfo.Name 项目负责人,rwclass,jcmethod,address,lxman,lxtel,lxemail,wtdepart,wether,varman1,vardate1,varremark1,t_Y_FlowInfo.chargeman,varman2,vardate2,varremark2,tkwether,hcontent,hfwdw,hcs,hanNO 函文号 from t_Y_FlowInfo,t_M_ItemInfo,t_R_UserInfo where t_Y_FlowInfo.ItemType=t_M_ItemInfo.ItemID and chargeman=t_R_UserInfo.UserID and hanwether=1 " + strSample + strDate + " order by t_Y_FlowInfo.ReportAccessDate"; DataSet ds = new MyDataOp(strSql).CreateDataSet(); DataColumn dcc = new DataColumn("紧急程度"); ds.Tables[0].Columns.Add(dcc); DataColumn dc = new DataColumn("监测方式"); ds.Tables[0].Columns.Add(dc); DataColumn dc0 = new DataColumn("任务类型"); ds.Tables[0].Columns.Add(dc0); DataColumn dc1 = new DataColumn("委托单位"); ds.Tables[0].Columns.Add(dc1); DAl.Sample getobj = new DAl.Sample(); DataTable dtmode = getobj.GetMode("", "mode", ""); DAl.Station get = new DAl.Station(); DataTable dtstation = get.GetWTByName(""); foreach (DataRow dr in ds.Tables[0].Rows) { if (dr["Ulevel"].ToString() == "1") { dr["紧急程度"] = "紧急"; } else { dr["紧急程度"] = "一般"; } if (dr["rwclass"].ToString() == "1") { dr["任务类型"] = "委托监测"; } else { dr["任务类型"] = "例行监测"; } DataRow[] drsel = dtmode.Select("code='" + dr["jcmethod"].ToString() + "'"); if (drsel.Length == 1) { dr["监测方式"] = drsel[0]["name"].ToString(); } else { dr["监测方式"] = ""; } //if (dr["wtdepart"].ToString().Trim() != "") //{ // DataRow[] drdep = dtstation.Select("id=" + dr["wtdepart"].ToString().Trim() + ""); // if (drdep.Length == 1) // dr["委托单位"] = drdep[0]["单位全称"].ToString(); // else dr["委托单位"] = dr["wtdepart"].ToString().Trim(); // } } if (ds.Tables[0].Rows.Count == 0) { //没有记录仍保留表头 ds.Tables[0].Rows.Add(ds.Tables[0].NewRow()); grdvw_List.DataSource = ds; grdvw_List.DataBind(); int intColumnCount = grdvw_List.Rows[0].Cells.Count; grdvw_List.Rows[0].Cells.Clear(); grdvw_List.Rows[0].Cells.Add(new TableCell()); grdvw_List.Rows[0].Cells[0].ColumnSpan = intColumnCount; } else { grdvw_List.DataSource = ds; grdvw_List.DataBind(); } ds.Dispose(); }
private void Query() { //strSelectedId=txt_samplequery.Text; string strSample = ""; string strDate = ""; if (txt_samplequery.Text != "") { strSample = "and ReportName like'%" + txt_samplequery.Text + "%'"; } if (drop_tkwether.SelectedIndex == 0) { strSample += " and (StatusID='2') "; } else { strSample += " and tkwether='1' and StatusID='2'"; } if (Request.Cookies["Cookies"].Values["u_purview"].ToString().Substring(2, 1) != "1") { strSample += " and chargeman='" + Request.Cookies["Cookies"].Values["u_id"].ToString() + "'"; } if (txt_QueryTime.Text != "") { strDate = " and (year(ReportAccessDate)= '" + DateTime.Parse(txt_QueryTime.Text.Trim() + " 00:00:00").Year + "' AND month(ReportAccessDate)= '" + DateTime.Parse(txt_QueryTime.Text.Trim() + " 00:00:00").Month + "' and day(ReportAccessDate)= '" + DateTime.Parse(txt_QueryTime.Text.Trim() + " 00:00:00").Day + "')"; } string strSql = "select t_Y_FlowInfo.id,t_Y_FlowInfo.ReportAccessDate 时间,t_Y_FlowInfo.ItemType,ItemName 项目类型,ReportName 报告标识,urgent 备注,t_Y_FlowInfo.Ulevel,Projectname 项目名称,t_R_UserInfo.Name 项目负责人,rwclass,jcmethod,address,lxman,lxtel,lxemail,wtdepart,wether,varman1,vardate1,varremark1,t_Y_FlowInfo.chargeman,varman2,vardate2,varremark2,tkwether,fanbackflag ,fanbackremark ,backflag,varremark3 from t_Y_FlowInfo,t_M_ItemInfo,t_R_UserInfo where t_Y_FlowInfo.ItemType=t_M_ItemInfo.ItemID and chargeman=t_R_UserInfo.UserID " + strSample + strDate + " and hanwether=1 order by t_Y_FlowInfo.ReportAccessDate"; DataSet ds = new MyDataOp(strSql).CreateDataSet(); DataColumn dcc = new DataColumn("紧急程度"); ds.Tables[0].Columns.Add(dcc); DataColumn dc = new DataColumn("监测方式"); ds.Tables[0].Columns.Add(dc); DataColumn dc0 = new DataColumn("任务类型"); ds.Tables[0].Columns.Add(dc0); DataColumn dc1 = new DataColumn("委托单位"); ds.Tables[0].Columns.Add(dc1); DataColumn dc2 = new DataColumn("踏勘是否通过"); ds.Tables[0].Columns.Add(dc2); DAl.Sample getobj = new DAl.Sample(); DataTable dtmode = getobj.GetMode("", "mode", ""); DAl.Station get = new DAl.Station(); DataTable dtstation = get.GetWTByName(""); foreach (DataRow dr in ds.Tables[0].Rows) { if (dr["Ulevel"].ToString() == "1") { dr["紧急程度"] = "紧急"; } else { dr["紧急程度"] = "一般"; } if (dr["rwclass"].ToString() == "1") { dr["任务类型"] = "委托监测"; } else { dr["任务类型"] = "例行监测"; } if (dr["tkwether"].ToString() == "1") { dr["踏勘是否通过"] = "未通过"; } else if (dr["tkwether"].ToString() == "0") { dr["踏勘是否通过"] = "通过"; } else { dr["踏勘是否通过"] = ""; } DataRow[] drsel = dtmode.Select("code='" + dr["jcmethod"].ToString() + "'"); if (drsel.Length == 1) { dr["监测方式"] = drsel[0]["name"].ToString(); } else { dr["监测方式"] = ""; } //if (dr["wtdepart"].ToString().Trim() != "") //{ // DataRow[] drdep = dtstation.Select("id=" + dr["wtdepart"].ToString().Trim() + ""); // if (drdep.Length == 1) dr["委托单位"] = dr["wtdepart"].ToString(); // else // dr["委托单位"] = ""; //} } if (ds.Tables[0].Rows.Count == 0) { //没有记录仍保留表头 ds.Tables[0].Rows.Add(ds.Tables[0].NewRow()); grdvw_List.DataSource = ds; grdvw_List.DataBind(); int intColumnCount = grdvw_List.Rows[0].Cells.Count; grdvw_List.Rows[0].Cells.Clear(); grdvw_List.Rows[0].Cells.Add(new TableCell()); grdvw_List.Rows[0].Cells[0].ColumnSpan = intColumnCount; } else { grdvw_List.DataSource = ds; grdvw_List.DataBind(); } ds.Dispose(); }