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 = ""; }
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 = ""; }
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 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 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; }
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(); }
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(); }