/// <summary> /// 初始化监测点 /// </summary> /// <param name="datetime"></param> /// <returns></returns> private void InitStation(string datetime) { try { if (datetime == System.DateTime.Now.ToString("yyyy-MM-dd")) { dsstation = GetRedisData.GetData("PassCarCount:hotspot_station");//dataCountInfo.GetPassCarHotSpot(datetime, "ZDDL"); } else if (datetime == System.DateTime.Now.AddDays(-1).ToString("yyyy-MM-dd")) { dsstation = GetRedisData.GetData("PassCarCount:hotspot_station_last"); } else { dsstation = bll.GetCarHotStation(datetime); } if (dsstation != null) { StoreStation.DataSource = dsstation;; StoreStation.DataBind(); this.ResourceManager1.RegisterAfterClientInitScript("isScroll();"); } } catch (Exception ex) { ILog.WriteErrorLog(ex); logManager.InsertLogError("LogRunning.aspx-InitStation", ex.Message + ";" + ex.StackTrace, "InitStation has an exception"); } }
/// <summary> /// 根据道路编号 获得监测点信息 /// </summary> /// <param name="roadId"></param> /// <returns></returns> private void GetStationInfoByRoad(string roadId) { try { dtBind = tgsPproperty.GetStationInfoByRoad(roadId); StoreStation.DataSource = dtBind; StoreStation.DataBind(); } catch (Exception ex) { ILog.WriteErrorLog(ex); logManager.InsertLogError("KeyRoadManager.aspx-GetStationInfoByRoad", ex.Message + ";" + ex.StackTrace, "GetStationInfoByRoad has an exception"); } }
/// <summary> /// 部门树 节点 单击选中事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> /// <returns></returns> protected void RowSelect(object sender, DirectEventArgs e) { try { RowSelectionModel sm = this.GridKeyRoad.SelectionModel.Primary as RowSelectionModel; sm.SelectedRows.Clear(); string id = e.ExtraParams["id"]; Session["DEPARTID"] = id; GetAllDlInfo(id); StoreStation.DataSource = new DataTable(); //清空绑定监测点 StoreStation.DataBind(); StoreBindStation.DataSource = new DataTable(); //清空点击关联监测点窗口中绑定的监测点 StoreBindStation.DataBind(); } catch (Exception ex) { ILog.WriteErrorLog(ex); logManager.InsertLogError("KeyRoadManager.aspx-RowSelect", ex.Message + ";" + ex.StackTrace, "RowSelect has an exception"); } }
protected void Page_Load(object sender, EventArgs e) { if (!X.IsAjaxRequest) { //cs.ZipFloClass zip = new cs.ZipFloClass(); //string filename = "TR20151111110108.xlsx"; //string filepath = System.Web.HttpContext.Current.Request.MapPath("Upload/") + "TR20151111110108.xlsx"; //string zipfilepath = System.Web.HttpContext.Current.Request.MapPath("Upload/") + "TR20151111110108.zip"; //zip.ZipSingleFile(filename, filepath, zipfilepath); if (Request.Cookies.Get("eReimUserID") == null) { X.AddScript("loginWindow.show();Panel1.disable();"); return; } else { ScriptManager.RegisterStartupScript(this, GetType(), "", "$('div.gn_person ul.q-menubox li:eq(0) a').text('" + Request.Cookies.Get("eReimUserName").Value + "');", true); X.AddScript("loginWindow.hide();Panel1.enable();"); cs.DBCommand dbc = new cs.DBCommand(); //获取被授权站点 string getright = "select * from StationRole where UserID='" + Request.Cookies.Get("eReimUserID").Value + "'"; DataTable dtright = dbc.GetData("eReimbursement", getright); DataTable dtStation = new DataTable(); dtStation.Columns.Add("Text", System.Type.GetType("System.String")); dtStation.Columns.Add("Value", System.Type.GetType("System.String")); for (int j = 0; j < dtright.Rows.Count; j++) { string[] dd = dtright.Rows[j]["Stations"].ToString().Split(','); for (int i = 0; i < dd.Length; i++) { if (!string.IsNullOrEmpty(dd[i].Trim())) { bool have = false; for (int g = 0; g < dtStation.Rows.Count; g++) { if (dtStation.Rows[g]["Text"].ToString() == dd[i].Trim()) { have = true; break; } } if (!have) { DataRow dr1 = dtStation.NewRow(); dr1["Text"] = dd[i]; dr1["Value"] = dd[i]; dtStation.Rows.Add(dr1); } } } } dtStation.DefaultView.Sort = "Text ASC"; StoreStation.DataSource = dtStation.DefaultView.ToTable(); StoreStation.DataBind(); cbxStation.Text = Request.Cookies.Get("eReimStation").Value.ToString(); //获取站点文件后缀列表 RefreshList(Request.Cookies.Get("eReimStation").Value.ToString()); //string getpostfix = "select * from FileRule where StationCode='" + Request.Cookies.Get("eReimStation").Value.ToString() + "'"; //DataTable dtPostfix = dbc.GetData("eReimbursement", getpostfix); //dtPostfix.Columns.Add("Allow1"); //for (int i = 0; i < dtPostfix.Rows.Count; i++) //{ // dtPostfix.Rows[i]["Allow1"] = dtPostfix.Rows[i]["Allow"].ToString() == "0" ? "NO" : "YES"; //} //StoreCCList.DataSource = dtPostfix; //StoreCCList.DataBind(); //string sql = "select MailList as Email from MailSetting where UserID='" + Request.Cookies.Get("eReimUserID").Value + "' and MailList!=''"; //DataTable dtdetail = new DataTable(); //dtdetail = dbc.GetData("eReimbursement", sql); //if (dtdetail != null && dtdetail.Rows.Count == 1) //{ // string[] mc = dtdetail.Rows[0]["Email"].ToString().Split(','); // DataTable dt = new DataTable(); // dt.Columns.Add("Email"); // for (int i = 0; i < mc.Length; i++) // { // DataRow dr = dt.NewRow(); // dr["Email"] = mc[i]; // dt.Rows.Add(dr); // } // StoreCCList.DataSource = dt; // StoreCCList.DataBind(); //} //DataTable dt = new DataTable(); //dt.Columns.Add("Postfix"); //dt.Columns.Add("Station"); //DataRow dr = dt.NewRow(); //dr[0] = "xls"; //dr[1] = "ZJDTSN"; //dt.Rows.Add(dr); //dr = dt.NewRow(); //dr[0] = "xlsx"; //dr[1] = "ZJDTSN"; //dt.Rows.Add(dr); //dr = dt.NewRow(); //dr[0] = "doc"; //dr[1] = "ZJDTSN"; //dt.Rows.Add(dr); //dr = dt.NewRow(); //dr[0] = "docx"; //dr[1] = "ZJDTSN"; //dt.Rows.Add(dr); //dr = dt.NewRow(); //dr[0] = "zip"; //dr[1] = "ZJDTSN"; //dt.Rows.Add(dr); //dr = dt.NewRow(); //dr[0] = "rar"; //dr[1] = "ZJDTSN"; //dt.Rows.Add(dr); //dr = dt.NewRow(); //dr[0] = "txt"; //dr[1] = "ZJDTSN"; //dt.Rows.Add(dr); //dr = dt.NewRow(); //dr[0] = "pdf"; //dr[1] = "ZJDTSN"; //dt.Rows.Add(dr); //dr = dt.NewRow(); //dr[0] = "#exe"; //dr[1] = "ZJDTSN"; //dt.Rows.Add(dr); //dr = dt.NewRow(); //dr[0] = "#"; //dr[1] = "ZJDTSN"; //dt.Rows.Add(dr); //StoreCCList.DataSource = dt; //StoreCCList.DataBind(); } } }
protected void Page_Load(object sender, EventArgs e) { if (!X.IsAjaxRequest) { //判断登录状态 cs.DBCommand dbc = new cs.DBCommand(); if (Request.Cookies.Get("eReimUserID") == null) { X.AddScript("loginWindow.show();Panel1.disable();"); return; } else { ScriptManager.RegisterStartupScript(this, GetType(), "", "$('div.gn_person ul.q-menubox li:eq(0) a').text('" + Request.Cookies.Get("eReimUserName").Value + "');", true); X.AddScript("loginWindow.hide();Panel1.enable();"); } string sqltype = ""; string sqldraft = ""; string sqlProcess = ""; if (Request.Cookies["lang"] != null && Request.Cookies["lang"].Value.ToLower() == "zh-cn") { PagingToolbar1.DisplayMsg = "显示 {0} - {1} of {2}"; ResourceManager1.Locale = "zh-CN"; sqltype += "select [Text]=CText,[Value]=CValue from Edic where KeyValue='MainType'"; sqldraft += "select [Text]=CText,[Value]=CValue from Edic where KeyValue='Type'"; sqlProcess += "select [Text]=CText,[Value]=CValue from Edic where KeyValue='Status'"; } else { PagingToolbar1.DisplayMsg = "Displaying items {0} - {1} of {2}"; ResourceManager1.Locale = "en-US"; sqltype += "select [Text]=EText,[Value]=CValue from Edic where KeyValue='MainType'"; sqldraft += "select [Text]=EText,[Value]=CValue from Edic where KeyValue='Type'"; sqlProcess += "select [Text]=EText,[Value]=CValue from Edic where KeyValue='Status'"; } DataTable dttype = dbc.GetData("eReimbursement", sqltype); StoreType.DataSource = dttype; StoreType.DataBind(); DataTable dtdraft = dbc.GetData("eReimbursement", sqldraft); StoreDraft.DataSource = dtdraft; StoreDraft.DataBind(); DataTable dtProcess = dbc.GetData("eReimbursement", sqlProcess); StoreProcess.DataSource = dtProcess; StoreProcess.DataBind(); //获取被授权站点 string getright = "select * from StationRole where UserID='" + Request.Cookies.Get("eReimUserID").Value + "'"; DataTable dtright = dbc.GetData("eReimbursement", getright); DataTable dtStation = new DataTable(); dtStation.Columns.Add("Text", System.Type.GetType("System.String")); dtStation.Columns.Add("Value", System.Type.GetType("System.String")); for (int j = 0; j < dtright.Rows.Count; j++) { string[] dd = dtright.Rows[j]["Stations"].ToString().Split(','); for (int i = 0; i < dd.Length; i++) { if (!string.IsNullOrEmpty(dd[i].Trim())) { bool have = false; for (int g = 0; g < dtStation.Rows.Count; g++) { if (dtStation.Rows[g]["Text"].ToString() == dd[i].Trim()) { have = true; break; } } if (!have) { DataRow dr1 = dtStation.NewRow(); dr1["Text"] = dd[i]; dr1["Value"] = dd[i]; dtStation.Rows.Add(dr1); } } } } dtStation.DefaultView.Sort = "Text ASC"; StoreStation.DataSource = dtStation.DefaultView.ToTable(); StoreStation.DataBind(); //获取被授权站点下的所有申请人 string station = ""; for (int i = 0; i < dtStation.Rows.Count; i++) { station += "'" + dtStation.Rows[i]["Text"].ToString() + "',"; } if (!string.IsNullOrEmpty(station)) { station = " and Station in (" + station.Substring(0, station.Length - 1) + ") "; } string sqlgetPerson = ""; if (station.Length > 0) { sqlgetPerson = "select distinct [Text]=Person,[Value]=PersonID from V_Eflow_ETravel where (Active=1 or Active=2) and Person!='' " + station; } else { sqlgetPerson = "select distinct [Text]=Person,[Value]=PersonID from V_Eflow_ETravel where (Active=1 or Active=2) and Person!='' and FlowID is null"; } DataTable dtperson = dbc.GetData("eReimbursement", sqlgetPerson); dtperson.DefaultView.Sort = "Text ASC"; StorePerson.DataSource = dtperson.DefaultView.ToTable(); StorePerson.DataBind(); //获取被授权站点下的所有提单人 string sqlgetCreatedBy = ""; if (station.Length > 0) { sqlgetCreatedBy = "select distinct [Text]=CreadedBy,[Value]=CreadedByID from V_Eflow_ETravel where (Active=1 or Active=2) and CreadedBy!='' " + station; } else { sqlgetCreatedBy = "select distinct [Text]=CreadedBy,[Value]=CreadedByID from V_Eflow_ETravel where (Active=1 or Active=2) and CreadedBy!='' and FlowID is null"; } DataTable dtcreatedby = dbc.GetData("eReimbursement", sqlgetCreatedBy); dtcreatedby.DefaultView.Sort = "Text ASC"; StoreCreatedBy.DataSource = dtcreatedby.DefaultView.ToTable(); StoreCreatedBy.DataBind(); } }