/// <summary> /// 删除导出的临时文件夹 /// </summary> public void deleteExportTempFile() { DataTable dt_temp = new DataTable(); dt_temp = fun.getDtBySql("Select t.* from A317 t where t.enter_date < sysdate - 1 "); for (int i = 0; i < dt_temp.Rows.Count; i++) { string filename = dt_temp.Rows[i]["FILE_NAME"].ToString(); string file_ = Server.MapPath("TEMP/" + filename); if (System.IO.File.Exists(file_)) { System.IO.File.Delete(file_); } string a317_id = dt_temp.Rows[i]["A317_ID"].ToString(); string sql_ = "delete from A317 where a317_id = " + a317_id; fun.execSqlOnly(sql_); string dir_ = filename.Substring(0, filename.IndexOf("/")); dt_temp = fun.getDtBySql("Select t.* from A317 t where t.FILE_NAME like '" + dir_ + "%'"); if (dt_temp.Rows.Count == 0) { string Directory_ = Server.MapPath("TEMP/" + dir_); if (System.IO.Directory.Exists(Directory_)) { System.IO.Directory.Delete(Directory_); } } } }
protected void BaseUc_Page_Load(object sender, EventArgs e) { SH = Screen.PrimaryScreen.Bounds.Height; SW = Screen.PrimaryScreen.Bounds.Width; dt_a00201 = Fun.getDtBySql("Select t.* from A00201_V01 t where a00201_key = '" + a00201_key + "'"); // dt_a0130101 = Fun.getA0130101(a00201_key); //dt_a013010101 = Fun.getA013010101(a00201_key); // showdatasql = Fun.getShowDataSql(a00201_key); // A002_ID='[REQUEST_A002ID]' //解析出request for (int i = 0; i < Request.QueryString.AllKeys.Length; i++) { string key = Request.QueryString.AllKeys.GetValue(i).ToString(); // Request.QueryString(""). showdatasql = showdatasql.Replace("[REQUEST_" + key.ToUpper() + "]", Request.QueryString[key].ToString()); } string json = ""; try { json = Session["J_" + dt_a00201.Rows[0]["A00201_KEY"].ToString()].ToString(); } catch { json = ""; } if (json == "") { Hashtable ht = new Hashtable(); dt_a013010101 = Fun.getA013010101(a00201_key); ht.Add("P1", Fun.DataTable2Json(dt_a013010101)); ht.Add("P2", dt_a00201.Rows[0]["TABLE_KEY"].ToString()); ht.Add("P3", dt_a00201.Rows[0]["main_key"].ToString()); ht.Add("P4", dt_a00201.Rows[0]["table_id"].ToString()); ht.Add("P5", Fun.DataTable2Json(Fun.getDtBySql("select t.* from A00210_V01 t where a00201_key ='" + dt_a00201.Rows[0]["A00201_KEY"].ToString() + "' and rb_type='C'"))); ht.Add("P6", Fun.DataTable2Json(Fun.getDtBySql("select t.* from A00210_V01 t where a00201_key ='" + dt_a00201.Rows[0]["A00201_KEY"].ToString() + "' and rb_type='U'"))); ht.Add("P7", dt_a00201.Rows[0]["tbl_type"].ToString()); ht.Add("P8", Fun.DataTable2Json(Fun.getDtBySql("select t.* from a00201_v02 t where a00201_key ='" + dt_a00201.Rows[0]["A00201_KEY"].ToString() + "' order by sort_by"))); // ht.Add("P001", Fun.DataTable2Json(Fun.getDtBySql("Select t.* from A00201_V01 t where a00201_key = '" + a00201_key + "'"))); // ht.Add("P002", Fun.getA0130101(a00201_key)); // ht.Add("P003", Fun.DataTable2Json(dt_a013010101)); ht.Add("P004", Fun.getShowDataSql(a00201_key)); string jsonText = JsonConvert.SerializeObject(ht); Session["J_" + dt_a00201.Rows[0]["A00201_KEY"].ToString()] = jsonText; json = jsonText; } else { dt_a013010101 = Fun.getdtByJson(Fun.getJson(json, "P1")); } showdatasql = Fun.getJson(json, "P004"); }
protected void Page_Load(object sender, EventArgs e) { BaseFun fun = new BaseFun(); try { mainkey = Request.QueryString["KEY"].ToString(); //Session["PK_KEY_PIC"].ToString(); code = Request.QueryString["code"].ToString(); if (code == "0") { j = 20; } else if (code == "1") { j = 0; } else if (code == "2") { j = 21; } } catch { mainkey = "100000630"; } dt_m00203 = fun.getDtBySql("Select t.* from M00201 t where t.m00201_key=" + mainkey); http_url = GetIndexUrl(); }
protected void Page_Load(object sender, EventArgs e) { Response.Cache.SetCacheability(HttpCacheability.NoCache); base.PageBase_Load(sender, e); dt_temp = fun.getDtBySql("Select * From A002 t Where t.ACTIVE='1' and T.Parent_Id = '1201' And Exists (Select 1 From A01301 a Inner Join A00701 a1 On a1.a013_id=a.a013_id And a1.a007_id='" + GlobeAtt.A007_KEY + "' Where a.useable=1 And a.a002_id=t.menu_id) order by t.sort_by"); }
protected void Page_Load(object sender, EventArgs e) { Response.Cache.SetCacheability(HttpCacheability.NoCache); Stream RequestStream = Request.InputStream; StreamReader RequestStreamReader = new StreamReader(RequestStream); RequestXml = RequestStreamReader.ReadToEnd(); RequestStream.Close(); menu_id = BaseFun.getAllHyperLinks(RequestXml, "<MENU_ID>", "</MENU_ID>")[0].Value; line_no = BaseFun.getAllHyperLinks(RequestXml, "<LINE_NO>", "</LINE_NO>")[0].Value; col_line_no = BaseFun.getAllHyperLinks(RequestXml, "<COL_LINE_NO>", "</COL_LINE_NO>")[0].Value; rowlist = BaseFun.getAllHyperLinks(RequestXml, "<ROWLIST>", "</ROWLIST>")[0].Value; mainrowlist = BaseFun.getAllHyperLinks(RequestXml, "<MAINROWLIST>", "</MAINROWLIST>")[0].Value; colid = BaseFun.getAllHyperLinks(RequestXml, "<COLID>", "</COLID>")[0].Value; dt_A00201 = Fun.getDtBySql("select * from A00201_V01 t Where t.Menu_Id='" + menu_id + "' And t.Line_No=" + line_no); dt_A10001 = Fun.getDtBySql("Select * From a10001 t Where t.table_id='" + dt_A00201.Rows[0]["TABLE_ID"].ToString() + "'"); }
protected void Page_Load(object sender, EventArgs e) { Response.Cache.SetCacheability(HttpCacheability.NoCache); Stream RequestStream = Request.InputStream; StreamReader RequestStreamReader = new StreamReader(RequestStream); RequestXml = RequestStreamReader.ReadToEnd(); RequestStream.Close(); menu_id = BaseFun.getAllHyperLinks(RequestXml, "<MENU_ID>", "</MENU_ID>")[0].Value; line_no = BaseFun.getAllHyperLinks(RequestXml, "<LINE_NO>", "</LINE_NO>")[0].Value; string key = BaseFun.getAllHyperLinks(RequestXml, "<KEY>", "</KEY>")[0].Value; dt_a002 = Fun.getDtBySql("Select t.* From a002 t Where t.menu_id='" + menu_id + "'"); dt_a00201 = Fun.getDtBySql("Select t.* From a00201 t Where t.menu_id='" + menu_id + "' And t.line_no='" + line_no + "'"); dt_a10001 = Fun.getDtBySql("select * from a10001 where table_id='" + dt_a00201.Rows[0]["TABLE_ID"].ToString() + "' Order By COL_X"); dt_temp = Fun.getDtBySql("select * from " + dt_a00201.Rows[0]["TABLE_ID"].ToString() + " t where t." + dt_a002.Rows[0]["MIAN_KEY"].ToString() + "='" + key + "' " + dt_a00201.Rows[0]["SORT_COL"].ToString()); }
protected void Page_Load(object sender, EventArgs e) { base.PageBase_Load(sender, e); a00201_key = Request.QueryString["A00201KEY"] == null ? "-1" : Request.QueryString["A00201KEY"].ToString(); dt_a10001 = Fun.getA013010101(a00201_key); if (dt_a10001.Rows.Count > 0) { table_id___ = dt_a10001.Rows[0]["table_id"].ToString(); } dt_data = Fun.getDtBySql(Fun.getShowDataSql(a00201_key) + " and rownum < 4 "); }
protected void Page_Load(object sender, EventArgs e) { Response.Cache.SetCacheability(HttpCacheability.NoCache); Stream RequestStream = Request.InputStream; StreamReader RequestStreamReader = new StreamReader(RequestStream); RequestXml = RequestStreamReader.ReadToEnd(); RequestStream.Close(); menu_id = BaseFun.getAllHyperLinks(RequestXml, "<MENU_ID>", "</MENU_ID>")[0].Value; dt_A002 = Fun.getDtBySql("Select * From A002 t Where T.MENU_ID = '" + menu_id + "'"); }
protected void Page_Load(object sender, EventArgs e) { Stream RequestStream = Request.InputStream; StreamReader RequestStreamReader = new StreamReader(RequestStream); RequestXml = RequestStreamReader.ReadToEnd(); RequestStream.Close(); reqtype = BaseFun.getAllHyperLinks(RequestXml, "<REQTYPE>", "</REQTYPE>")[0].Value; if (reqtype == "HEQ_SAVE") { menu_id = BaseFun.getAllHyperLinks(RequestXml, "<MENU_ID>", "</MENU_ID>")[0].Value; dt_a00201 = Fun.getDtBySql("select * from A00201_V01 t Where t.Menu_Id='" + menu_id + "'"); dt_a00210 = Fun.getDtBySql("Select * From A00210 t Where t.menu_id='" + menu_id + "'"); } if (reqtype == "HEQ_NEW") { menu_id = BaseFun.getAllHyperLinks(RequestXml, "<MENU_ID>", "</MENU_ID>")[0].Value; A00201_Key = BaseFun.getAllHyperLinks(RequestXml, "<A00201KEY>", "</A00201KEY>")[0].Value; dt_a00201 = Fun.getDtBySql("select * from A00201_V01 t Where t.A00201_Key='" + A00201_Key + "'"); } }
protected void Page_Load(object sender, EventArgs e) { Response.Cache.SetCacheability(HttpCacheability.NoCache); Stream RequestStream = Request.InputStream; StreamReader RequestStreamReader = new StreamReader(RequestStream); RequestXml = RequestStreamReader.ReadToEnd(); RequestStream.Close(); menu_id = BaseFun.getAllHyperLinks(RequestXml, "<MENU_ID>", "</MENU_ID>")[0].Value; dt_a00201 = Fun.getDtBySql("Select * From A00201_V01 t Where t.menu_id='" + menu_id + "' order by t.line_no"); pkg_name = dt_a00201.Rows[0]["PKG_NAME"].ToString(); if (pkg_name != "") { dt_btn = Fun.getDtBySql("select " + pkg_name + ".Checkbutton__('BTN_SAVE','','" + GlobeAtt.A007_KEY + "') as save," + pkg_name + ".Checkbutton__('BTN_DEL','','" + GlobeAtt.A007_KEY + "') as del from dual"); if (dt_btn.Rows.Count > 0) { f_save = dt_btn.Rows[0]["save"].ToString(); f_del = dt_btn.Rows[0]["del"].ToString(); } } }
protected void Page_Load(object sender, EventArgs e) { string linkcode = ""; try { linkcode = Request.Form[0].ToString(); //检测用户名称 是否 DataTable dt_check = fun.getDtBySql("select pkg_user.check_auto_login('" + linkcode + "') as c from dual"); user_id = dt_check.Rows[0][0].ToString(); } catch { linkcode = ""; user_id = "-1"; } }
public DataTable get_child_(string menu_id_) { DataTable dt__ = new DataTable(); string sql = "Select t.*,pkg_a.getmenuname(t.a002_key,'" + GlobeAtt.A007_KEY + "') as show_name from A002_V01 t where t.parent_id='" + menu_id_; sql += "' And active ='1' and pkg_a.getUserMenu(t.menu_id,'" + GlobeAtt.A007_KEY + "'," + GlobeAtt.A30001_KEY + ") = '1' order by PARENT_ID ,sort_by,menu_id"; dt__ = Fun.getDtBySql(sql); return(dt__); //DataRow[] rows = dt_all.Select("PARENT_ID='" + menu_id_ + "'", "sort_by asc,menu_id asc"); //DataTable dt_ = dt_all.Clone(); //dt_.Clear(); //foreach (DataRow row in rows) //{ // dt_.ImportRow(row); // dt_all.Rows.Remove(row); //} //return dt_; }
protected void Page_Init(object sender, EventArgs e) { //string str1 = null; string strSql1 = null; //string strSql2 = null; DataTable ds = new DataTable(); //((Button)CrystalReportViewer1.Controls[1]).Click try { rd1.Load(Server.MapPath("rptSerialTrain.rpt")); //strSql1 = "select * from Employees where EmployeeID<10"; //strSql2 = "select * from Orders where OrderID<10270"; // where uidN='03557115-2526'"; //ds = com.TFMI.DAL.TFMIDbHelper.selectDataSetBindReport(strSql1, "Employees", strSql2, "Orders", "Default.aspx"); strSql1 = "select * from bl_v_rpt_serial_transaction t Where t.transaction_id='3633361'"; BaseFun fun = new BaseFun(); ds = fun.getDtBySql(strSql1); rd1.SetDataSource(ds); //"http://localhost/ShowErpForm/Report/Code39handler.ashx?Code=" & {BL_V_RPT_SERIAL_TRANSACTION.SERIAL_NO} //rd1.SetParameterValue("P1", "ABC-X78901234"); CrystalReportViewer1.ReportSource = rd1; } catch (LoadSaveReportException ex) { Response.Write(ex.Message); // 報表載入失敗 } catch (PrintException ex) { Response.Write(ex.Message); // 報表載入失敗 } catch (Exception ex) { Response.Write(ex.Message); // 報表載入失敗 } }
public void getFileList(string dirPath, string key_) { //定义一个DirectoryInfo对象 DirectoryInfo di = new DirectoryInfo(dirPath); import_key = key_; //通过GetFiles方法,获取di目录中的所有文件的大小 //获取文件类型 DataTable dt_a308 = new DataTable(); dt_a308 = Fun.getDtBySql("Select t.* from A308 t where a308_id='" + key_ + "'"); string FILE_TYPE = dt_a308.Rows[0]["FILE_TYPE"].ToString().ToUpper(); FILE_TYPE = FILE_TYPE.Substring(0, 3); StreamWriter fs = new StreamWriter(dirPath + "\\import.log", true, System.Text.Encoding.Default); // StreamWriter FileWriter = new StreamWriter(strPath, true); //创建日志文件 // FileWriter.WriteLine("Time: " + dt.ToString("HH:mm:ss") + " Err: " + strMatter); // FileWriter.Close(); //关闭StreamWriter对象 string sWord = GlobeAtt.Sysdatetime; try { fs.WriteLine("------ begin -----------" + sWord); //System.IO.Path.GetDirectoryName(psh) foreach (FileInfo fi in di.GetFiles()) { /*获取文件名称和类型*/ if (fi.Name.ToUpper().IndexOf("." + FILE_TYPE) > 0) { /*开始处理文件*/ // fs.WriteLine(fi.Name + " :" + DateTime.Now.ToString("HH:mm:ss")); sWord = fi.Name + " :" + DateTime.Now.ToString("HH:mm:ss"); string line_no_ = save_begin_log(fi.Name); string imp_msg = ImportFileData(fi.FullName, key_); string psh = ""; if (imp_msg == "1") { /*把数据移动到成功的文件夹中*/ psh = dirPath + "\\SUCCESS"; if (!System.IO.Directory.Exists(psh)) { System.IO.Directory.CreateDirectory(psh); } sWord += "成功导入了" + totleline + "条数据!"; save_end_log(line_no_, ""); } else { psh = dirPath + "\\ERROR"; if (!System.IO.Directory.Exists(psh)) { System.IO.Directory.CreateDirectory(psh); } /*把文件移动到失败的文件夹中*/ sWord += "导入失败---" + imp_msg; save_end_log(line_no_, imp_msg); } sWord += "》》》》" + DateTime.Now.ToString("HH:mm:ss"); fs.WriteLine(sWord); //把文件拷贝到对应的备份文件夹中 File.Copy(fi.FullName, psh + "\\" + DateTime.Now.ToShortDateString().Replace("-", "") + "_" + fi.Name, true); File.Delete(fi.FullName); } } sWord = GlobeAtt.Sysdatetime; fs.WriteLine("------ end -----------" + sWord); } catch (Exception ex) { //throw new Exception(ex.Message); } finally { fs.Close(); } }
public void PageBase_Load(object sender, System.EventArgs e) { /*生成Ajax*/ // Ajax.Utility.RegisterTypeForAjax(typeof(BasePage)); try { A007_KEY = GlobeAtt.A007_KEY; A30001_KEY = GlobeAtt.A30001_KEY; } catch { A007_KEY = ""; A30001_KEY = ""; } dialog = Request.QueryString["dialog"] == null ? "0" : Request.QueryString["dialog"].ToString();//不需要日期控件 if (A007_KEY == "") { string linkcode = Request.QueryString["linkcode"] == null ? "" : Request.QueryString["linkcode"].ToString(); if (linkcode.Length > 5) { if (linkcode.IndexOf("userid") == 0) { //自动登录 string user = linkcode.Replace("userid", ""); if (user != "" && user != null) { BaseLogin BLogin = new BaseLogin("0", user, "", "0"); string ls_login = BLogin.checkUserLogin(); if (ls_login.IndexOf("02") != 0) { Session["LINK_P_URL"] = Request.Url; } } else { Session["LINK_P_URL"] = Request.Url; } } else { /*解析UCODE 包含用户信息*/ string sql = "Select pkg_user.checklogin('" + linkcode + "') as c from dual"; DataTable dt_a306 = new DataTable(); dt_a306 = Fun.getDtBySql(sql); string a306_id = dt_a306.Rows[0][0].ToString(); if (a306_id != "" && a306_id != null) { Session["LINK_A306"] = a306_id; sql = "Select t.* from A306 t where a306_id='" + a306_id + "'"; DataTable dt_user = new DataTable(); dt_user = Fun.getDtBySql(sql); string user = dt_user.Rows[0]["rec_a007"].ToString(); if (user != "" && user != null) { BaseLogin BLogin = new BaseLogin("0", user, "", "0"); string ls_login = BLogin.checkUserLogin(); if (ls_login.IndexOf("02") != 0) { Session["LINK_P_URL"] = Request.Url; } } else { Session["LINK_P_URL"] = Request.Url; } } } } try { A007_KEY = GlobeAtt.A007_KEY; A30001_KEY = GlobeAtt.A30001_KEY; } catch { A007_KEY = ""; A30001_KEY = ""; } } if (A007_KEY == "" && Request.Path.ToUpper().IndexOf("LOGIN.ASPX") < 0) { Response.Write("<script>parent.parent.location.href='" + GlobeAtt.HTTP_URL + "\\login.aspx?code=0'</script>"); } }
/// <summary> /// 检测用户登录 /// </summary> /// <returns>0 成功</returns> public string checkUserLogin( ) { try { // in varchar2, user_id_ in varchar2, // pass_word_ in varchar2 ,user_ip_ in varchar2 string clientip = fun.getClientIp(); string sql = "Select PKG_User.checkUserLogin('" + _comp_no + "','" + _user_id + "','" + _pass_word.Replace("'", "''") + "','" + clientip + "','" + _if_check__ + "') as c from dual "; DataTable dt = new DataTable(); int li_db = fun.db.ExcuteDataTable(dt, sql, CommandType.Text); if (li_db < 0) { return("01执行校验失败!"); } int li_res = int.Parse(dt.Rows[0][0].ToString()); if (li_res < 0) { return(usermsg.getMsgByMsgId("100001", "")); } /*登录成功以后执行写日志和写事务*/ DataTable dt_key = new DataTable(); sql = "select s_a300.nextval as c from dual "; li_db = fun.db.ExcuteDataTable(dt_key, sql, CommandType.Text); if (li_db < 0) { return("01执行校验失败!"); } sql = "Select a022_name from a022 t where a022_id='CHECK_MAC_NAME' "; string CHECK_MAC_NAME = "1"; DataTable dt_a = new DataTable(); dt_a = fun.getDtBySql(sql); if (dt_a.Rows.Count > 0) { CHECK_MAC_NAME = dt_a.Rows[0][0].ToString(); if (CHECK_MAC_NAME != "1") { CHECK_MAC_NAME = "0"; } } if (CHECK_MAC_NAME == "1") { try { System.Net.IPHostEntry hostInfo = System.Net.Dns.GetHostByAddress(clientip); sql = "PKG_User.UserLogin('" + _user_id + "','" + clientip + "'," + dt_key.Rows[0][0].ToString() + ",'" + hostInfo.HostName + "','WEB','" + _comp_no + "')"; } catch { sql = "PKG_User.UserLogin('" + _user_id + "','" + clientip + "'," + dt_key.Rows[0][0].ToString() + ",'" + clientip + "','WEB','" + _comp_no + "')"; } } else { sql = "PKG_User.UserLogin('" + _user_id + "','" + clientip + "'," + dt_key.Rows[0][0].ToString() + ",'" + clientip + "','WEB','" + _comp_no + "')"; } string res = fun.execSql(sql, _user_id, "login"); if (res != "0") { return(res); } /*初始化 把用户数据 记录到session中*/ if (GlobeAtt.A007_KEY != "") { if (_user_id != GlobeAtt.A007_KEY) { HttpContext.Current.Session.Clear(); } } //用户属性 HttpContext.Current.Session["USER_ID"] = _user_id; HttpContext.Current.Session["A007_KEY"] = _user_id; HttpContext.Current.Session["A30001_KEY"] = dt_key.Rows[0][0].ToString(); DataTable dt_a007 = new DataTable(); sql = "Select t.* from A007_v01 t where a007_id= '" + _user_id + "'"; li_db = fun.db.ExcuteDataTable(dt_a007, sql, CommandType.Text); if (li_db < 0) { return("01执行校验失败!"); } HttpContext.Current.Session["A007_NAME"] = dt_a007.Rows[0]["A007_NAME"].ToString(); HttpContext.Current.Session["LANGUAGE_ID"] = dt_a007.Rows[0]["LANGUAGE_ID"].ToString(); DataTable dt_dataindex = new DataTable(); dt_dataindex = fun.getDtBySql("select f_get_data_index() as c from dual "); string v = dt_dataindex.Rows[0][0].ToString(); dt_dataindex.Dispose(); HttpContext.Current.Session["DATA_INDEX"] = v; DataTable dt_config = new DataTable(); sql = "Select pkg_show.getSysConfig('" + _user_id + "') as c from dual "; DataTable dt_temp = new DataTable(); dt_temp = fun.getDtBySql(sql); sql = dt_temp.Rows[0][0].ToString(); dt_config = fun.getDtBySql(sql); for (int i = 0; i < dt_config.Columns.Count; i++) { string column_id = dt_config.Columns[i].ColumnName.ToUpper(); HttpContext.Current.Session["CFG_" + column_id] = dt_config.Rows[0][i].ToString(); } string ls_cfg = fun.DataTable2Json(dt_config); HttpContext.Current.Session["CFG"] = ls_cfg; DataTable dt_a022 = new DataTable(); sql = "Select t.* from A022 t "; dt_a022 = fun.getDtBySql(sql); for (int i = 0; i < dt_a022.Rows.Count; i++) { string a022_id = dt_a022.Rows[i]["A022_ID"].ToString(); string a002_name = dt_a022.Rows[i]["A022_NAME"].ToString(); a002_name = a002_name.Replace("[USER_ID]", GlobeAtt.A007_KEY); a002_name = a002_name.Replace("[A30001_KEY]", GlobeAtt.A30001_KEY); string if_exec = dt_a022.Rows[i]["if_exec"].ToString(); if (if_exec == "1") { DataTable dt_exec = new DataTable(); dt_exec = fun.getDtBySql(a002_name); a002_name = dt_exec.Rows[0][0].ToString(); } HttpContext.Current.Session[a022_id.ToUpper()] = a002_name; } try { string LINK_A007_ID = HttpContext.Current.Session["LINK_A007_ID"].ToString(); if (LINK_A007_ID != _user_id) { HttpContext.Current.Session["LINK_P_URL"] = ""; } } catch { HttpContext.Current.Session["LINK_P_URL"] = ""; } /* = fun.getA022Name("QueryList_PageRow"); * HttpContext.Current.Session["QueryList_MaxRow"] = fun.getA022Name("QueryList_MaxRow"); * HttpContext.Current.Session["DetailRowS"] = fun.getA022Name("DetailRowS"); * HttpContext.Current.Session["BS_LOG_SQL"] = fun.getA022Name("BS_LOG_SQL"); * HttpContext.Current.Session["BS_LOG_A314"] = fun.getA022Name("BS_LOG_A314"); * HttpContext.Current.Session["SYS_MODE"] = fun.getA022Name("SYS_MODE"); * HttpContext.Current.Session["BS_LOG_SELECTSQL"] = fun.getA022Name("BS_LOG_SELECTSQL"); * HttpContext.Current.Session["QUERY_LIKE"] = fun.getA022Name("QUERY_LIKE"); */ //HttpContext.Current.Session["A007"] = fun.setPkSYS_MODEgStr(dt_a007); //DataTable dt_a00701 = new DataTable(); //sql = "Select t.* from A00701 t where a007_key= " + li_res.ToString(); //li_db = fun.db.ExcuteDataTable(dt_a00701, sql, CommandType.Text); //if (li_db < 0) //{ // return "01执行校验失败!"; //} //HttpContext.Current.Session["A013"] = fun.setPkgStr(dt_a00701); ///*登录的日志信息*/ //DataTable dt_a30001 = new DataTable(); //sql = "Select t.* from A30001 t where a30001_key= " + dt_key.Rows[0][0].ToString(); //li_db = fun.db.ExcuteDataTable(dt_a30001, sql, CommandType.Text); //if (li_db < 0) //{ // return "01执行校验失败!"; //} //HttpContext.Current.Session["A30001"] = fun.setPkgStr(dt_a007); return("02[HTTP_URL]/default.aspx"); } catch (Exception ex) { return("00" + ex.Message.Replace("\n", ";").Replace("'", "\"")); } }
protected void Page_Load(object sender, EventArgs e) { try { table_id = Request.QueryString["table_id"] == null ? "" : Request.QueryString["table_id"].ToString(); key_id = Request.QueryString["key_id"] == null ? "" : Request.QueryString["key_id"].ToString(); line_no = Request.QueryString["line_no"] == null ? "" : Request.QueryString["line_no"].ToString(); basekey = Request.QueryString["basekey"] == null ? "" : Request.QueryString["basekey"].ToString(); basekey = basekey.Replace("-", "+"); key_id = key_id.Replace("-", "+"); key_id = key_id.Replace("'", "''"); string sql = "Select t.* from A10001 t where t.table_id='" + table_id + "' and line_no='" + line_no + "'"; dt_a10001 = fun.getDtBySql(sql); a308_id = dt_a10001.Rows[0]["col_mask"].ToString(); dt_a308 = fun.getDtBySql("Select t.* from A308 t where t.a308_id='" + a308_id + "'"); FILE_TYPE = dt_a308.Rows[0]["FILE_TYPE"].ToString().ToUpper(); // FILE_TYPE = FILE_TYPE.Substring(0, 3); if (FILE_TYPE != "*") { string model_file_name_ = HttpContext.Current.Request.MapPath("../data/" + a308_id + "." + FILE_TYPE); if (System.IO.File.Exists(model_file_name_)) { model_file_name = fun.GetIndexUrl() + "\\data\\" + a308_id + "." + FILE_TYPE; } else { model_file_name = ""; } } else { model_file_name = ""; } dt_a30801 = fun.getDtBySql("Select t.* from A30801 t where t.a308_id='" + a308_id + "'"); dt_a30802 = fun.getDtBySql("Select t.* from A30802 t where t.a308_id='" + a308_id + "'"); uploadfilepath = "..\\data\\import\\" + a308_id + "\\upload"; sql = "Select count(*) from a30803 t where a308_id='" + a308_id + "' and t.BASE_TABLE_ID='" + table_id + "' and BASE_COLUMN_ID='" + dt_a10001.Rows[0]["COLUMN_ID"].ToString() + "' and BASE_KEY='" + basekey + "'"; DataTable dt_count = new DataTable(); dt_count = fun.getDtBySql(sql); if (dt_count.Rows[0][0].ToString() == "0") { DataTable dt_key = new DataTable(); dt_key = fun.getDtBySql("select s_a30803.nextval as c from dual "); a30803_key = dt_key.Rows[0][0].ToString(); sql = "insert into a30803(a308_id,line_no,d001_id,d001_name,BASE_TABLE_ID,BASE_COLUMN_ID,BASE_KEY,BASE_USER,BASE_DATE,state)"; sql += "Select '" + a308_id + "'," + a30803_key + ",'" + key_id + "','','" + table_id + "','" + dt_a10001.Rows[0]["COLUMN_ID"].ToString() + "','" + basekey + "','" + GlobeAtt.A007_KEY + "',sysdate,'-1' from dual "; // Response.Write(sql); fun.execSqlOnly(sql); } else { DataTable dt_key = new DataTable(); sql = "select line_no as c from a30803 t where a308_id='" + a308_id + "' and t.BASE_TABLE_ID='" + table_id + "' and BASE_COLUMN_ID='" + dt_a10001.Rows[0]["COLUMN_ID"].ToString() + "' and BASE_KEY='" + basekey + "'"; // Response.Write(sql); dt_key = fun.getDtBySql(sql); a30803_key = dt_key.Rows[0][0].ToString(); } } catch (Exception ex) { Response.Write(ex.Message.Replace("\n", ";").Replace("'", "\"")); } }
public void PageBase_Load(object sender, System.EventArgs e) { if (GlobeAtt.A007_KEY == "") { Response.Write("showlogin();"); return; } try { Stream RequestStream = Request.InputStream; StreamReader RequestStreamReader = new StreamReader(RequestStream); RequestXml = RequestStreamReader.ReadToEnd(); RequestStream.Close(); a00201_key = BaseFun.getAllHyperLinks(RequestXml, "<A00201KEY>", "</A00201KEY>")[0].Value; try { RequestURL = BaseFun.getAllHyperLinks(RequestXml, "<URL>", "</URL>")[0].Value; } catch { RequestURL = ""; } } catch (Exception ex) { a00201_key = "-1"; return; } // a00201_key = Request.QueryString["A00201KEY"] == null ? "-1" : Request.QueryString["A00201KEY"].ToString(); if (a00201_key == "-1") { return; } try { json = Session["JSON_" + a00201_key].ToString(); } catch { json = ""; } if (GlobeAtt.SYS_MODE == "K") { json = ""; } if (json == "") { Hashtable ht = new Hashtable(); dt_a013010101 = Fun.getA013010101(a00201_key); dt_a00201 = Fun.getDtBySql("Select t.* from A00201_V01 t where a00201_key = '" + a00201_key + "' order by line_no "); //列属性 ht.Add("P1", Fun.DataTable2Json(dt_a013010101)); //菜单属性 ht.Add("P2", Fun.DataTable2Json(dt_a00201)); //数据检测属性 if (dt_a00201.Rows[0]["IF_MAIN"].ToString() == "1") { ht.Add("P3", Fun.DataTable2Json(Fun.getDtBySql("select t.* from A00210_V01 t where menu_id ='" + dt_a00201.Rows[0]["MENU_ID"].ToString() + "' and rb_type='C'"))); ht.Add("P4", Fun.DataTable2Json(Fun.getDtBySql("select t.* from A00210_V01 t where menu_id ='" + dt_a00201.Rows[0]["MENU_ID"].ToString() + "' and rb_type='U'"))); ht.Add("P9", Fun.DataTable2Json(Fun.getDtBySql("select t.* from A00201_V01 t where menu_id ='" + dt_a00201.Rows[0]["MENU_ID"].ToString() + "' order by line_no"))); } //右键属性 ht.Add("P5", Fun.DataTable2Json(Fun.getDtBySql("select t.* from a00201_v02 t where a00201_key ='" + a00201_key + "' order by sort_by"))); //查询数据的SQL showdatasql = Fun.getShowDataSql(a00201_key); ht.Add("P6", showdatasql); //查询数据数量的SQL getShowDataCountSql = Fun.getShowDataCountSql(a00201_key); ht.Add("P7", getShowDataCountSql); //打印列表 if (dt_a00201.Rows[0]["if_main"].ToString() == "1") { ht.Add("P8", Fun.DataTable2Json(Fun.getDtBySql("select t.* from A00205 t where menu_id ='" + dt_a00201.Rows[0]["menu_id"].ToString() + "' order by sort_by"))); } else { ht.Add("P8", ""); } string form_init = dt_a00201.Rows[0]["FORM_INIT"].ToString(); ht.Add("P10", form_init); string jsonText = JsonConvert.SerializeObject(ht); Session["JSON_" + a00201_key] = jsonText; json = jsonText; } else { dt_a013010101 = Fun.getdtByJson(Fun.getJson(json, "P1")); dt_a00201 = Fun.getdtByJson(Fun.getJson(json, "P2")); showdatasql = Fun.getJson(json, "P6"); getShowDataCountSql = Fun.getJson(json, "P7"); } try { QUERYID = BaseFun.getAllHyperLinks(RequestXml, "<QUERYID>", "</QUERYID>")[0].Value; } catch { QUERYID = ""; } string condition = ""; if (QUERYID != "") { condition = Fun.getQueryCondition(dt_a00201, QUERYID); int pos = condition.IndexOf("ORDER BY"); string str_order = ""; if (pos > 0) { str_order = condition.Substring(pos); condition = condition.Substring(0, pos - 1); } showdatasql = showdatasql + condition + " " + str_order; getShowDataCountSql = getShowDataCountSql + condition; } string url = ""; try { url = BaseFun.getAllHyperLinks(RequestXml, "<URL>", "</URL>")[0].Value; } catch { url = ""; } if (url.IndexOf("?") > 0) { int pos = url.IndexOf("?"); url = url.Substring(pos + 1); string[] data_ = url.Split('&'); for (int i = 0; i < data_.Length; i++) { string[] data1_ = data_[i].Split('='); showdatasql = showdatasql.Replace("[REQUEST_" + data1_[0] + "]", data1_[1]); getShowDataCountSql = getShowDataCountSql.Replace("[REQUEST_" + data1_[0] + "]", data1_[1]); } } }
protected void Page_Load(object sender, EventArgs e) { dt_data = Fun.getDtBySql("Select t.* from a319 t where t.state='1'"); a319_id = Request.QueryString["key"] == null ? "-1" : Request.QueryString["key"].ToString(); if ((a319_id == "" || a319_id == "-1") && dt_data.Rows.Count > 0) { a319_id = dt_data.Rows[0]["a319_id"].ToString(); } dt_detail = Fun.getDtBySql("Select t.* from A31901_V01 t where t.a319_id='" + a319_id + "' order by t.col_id "); Base.HttpRequest http = new Base.HttpRequest(); StringBuilder REQDATA = new StringBuilder(); //REQDATA.Append("<?xml version=\"1.0\" encoding=\"utf-8\"?>"); //REQDATA.Append("<miap>"); //REQDATA.Append("<miap-header>"); //REQDATA.Append("<transactionid>" + DateTime.Now.ToString("yyyyMMddHHmmssfff") + "</transactionid>"); //REQDATA.Append("<version>1.0</version>"); //REQDATA.Append("<messagename>getaddressidreq</messagename>"); //REQDATA.Append("</miap-header>"); //REQDATA.Append("<miap-Body>"); //REQDATA.Append("<getaddressidreq>"); //REQDATA.Append("<customerno>102419</customerno>"); //REQDATA.Append("</getaddressidreq>"); //REQDATA.Append("</miap-Body>"); //REQDATA.Append("</miap>"); //REQDATA.Append("<?xml version=\"1.0\" encoding=\"utf-8\"?>"); //REQDATA.Append("<miap>"); //REQDATA.Append("<miap-header>"); //REQDATA.Append("<transactionid>" + DateTime.Now.ToString("yyyyMMddHHmmssfff") + "</transactionid>"); //REQDATA.Append("<version>1.0</version>"); //REQDATA.Append("<messagename>getcostatereq</messagename>"); //REQDATA.Append("</miap-header>"); //REQDATA.Append("<miap-Body>"); //REQDATA.Append("<getcostatereq>"); //REQDATA.Append("<transid>100161</transid>"); //REQDATA.Append("</getcostatereq>"); //REQDATA.Append("<getcostatereq>"); //REQDATA.Append("<transid>100162</transid>"); //REQDATA.Append("</getcostatereq>"); //REQDATA.Append("<getcostatereq>"); //REQDATA.Append("<transid>100163</transid>"); //REQDATA.Append("</getcostatereq>"); //REQDATA.Append("<getcostatereq>"); //REQDATA.Append("<transid>100164</transid>"); //REQDATA.Append("</getcostatereq>"); //REQDATA.Append("<getcostatereq>"); //REQDATA.Append("<transid>100165</transid>"); //REQDATA.Append("</getcostatereq>"); //REQDATA.Append("</miap-Body>"); //REQDATA.Append("</miap>"); //#region 创建订单 //REQDATA.Append("<?xml version=\"1.0\" encoding=\"utf-8\"?>"); //REQDATA.Append("<miap>"); //REQDATA.Append("<miap-header>"); //REQDATA.Append("<transactionid>" + DateTime.Now.ToString("yyyyMMddHHmmssfff") + "</transactionid>"); //REQDATA.Append("<version>1.0</version>"); //REQDATA.Append("<messagename>newcoreq</messagename>"); //REQDATA.Append("</miap-header>"); //REQDATA.Append("<miap-Body>"); //REQDATA.Append("<newcoreq>"); //REQDATA.Append("<orderno>1000001</orderno>"); //REQDATA.Append("<customerno>990997</customerno>"); //REQDATA.Append("<contract>18</contract>"); //REQDATA.Append("<userid>USERTEST</userid>"); //REQDATA.Append("<ordertype>0</ordertype>"); //REQDATA.Append("<paytype>3</paytype>"); //REQDATA.Append("<payno>20000000001</payno>"); //REQDATA.Append("<paytime>20140810110810</paytime>"); //REQDATA.Append("<remark>ddddccc.c.c.cldddddd</remark>"); //REQDATA.Append("<amount>5370</amount>"); //REQDATA.Append("<shipcode>B23</shipcode>"); //REQDATA.Append("<shipamount>123</shipamount>"); //REQDATA.Append("<othersamount>-89</othersamount>"); //REQDATA.Append("<invoiceflag>0</invoiceflag>"); //REQDATA.Append("<invoicehead></invoicehead>"); //REQDATA.Append("<invoiceprocject></invoiceprocject>"); //REQDATA.Append("<invoiceamount></invoiceamount>"); //REQDATA.Append("<addressid>01</addressid>"); //REQDATA.Append("<address>中山西路1000号XX大厦1号楼****室</address>"); //REQDATA.Append("<state>上海市</state>"); //REQDATA.Append("<city>徐汇区</city>"); //REQDATA.Append("<zipcode>100001</zipcode>"); //REQDATA.Append("<name>XXXXXX</name>"); //REQDATA.Append("<phone>021-12345678</phone>"); //REQDATA.Append("<fax>021-12345679</fax>"); //REQDATA.Append("<email>XXXXXXXXX@wwww.*****.com</email>"); //REQDATA.Append("<mobile>13112345678</mobile>"); //REQDATA.Append("<partlist>"); //REQDATA.Append("<detail>"); //REQDATA.Append("<partno>110410602078</partno>"); //REQDATA.Append("<qty>10</qty>"); //REQDATA.Append("<saleprice>426</saleprice>"); //REQDATA.Append("<amount>4260</amount>"); //REQDATA.Append("<lineremark>dddaaa,ddd|ddd.,ddd;|</lineremark>"); //REQDATA.Append("</detail>"); //REQDATA.Append("<detail>"); //REQDATA.Append("<partno>110410600321</partno>"); //REQDATA.Append("<qty>10</qty>"); //REQDATA.Append("<saleprice>111</saleprice>"); //REQDATA.Append("<amount>1110</amount>"); //REQDATA.Append("<lineremark>222dddaaa,ddd|ddd.,ddd;|</lineremark>"); //REQDATA.Append("</detail>"); //REQDATA.Append("</partlist>"); //REQDATA.Append("</newcoreq>"); //REQDATA.Append("</miap-Body>"); //REQDATA.Append("</miap>"); //#endregion http.CharacterSet = "utf-8"; Reqxml = get_modifuaddress();// REQDATA.ToString(); SaveLog.Verification(Reqxml); http.OpenRequest(REQURL, REQURL, Reqxml); Responsexml = http.HtmlDocument; }
protected void Page_Load(object sender, EventArgs e) { dt = fun.getDtBySql("Select t.* from a002 t "); this.GridView1.DataSource = dt; this.GridView1.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { try { string u_select_sql = ""; PageRow = int.Parse(GlobeAtt.DetailRowS); MaxRow = int.Parse(GlobeAtt.QueryList_MaxRow); string if_main = dt_a00201.Rows[0]["if_main"].ToString(); string sort_col = dt_a00201.Rows[0]["sort_col"].ToString(); Boolean if_select = false; if (sort_col == null) { sort_col = ""; } ifinsertrow = Request.QueryString["IFINSERT"] == null ? "V" : Request.QueryString["IFINSERT"].ToString(); /*新增*/ main_key_value = BaseFun.getAllHyperLinks(RequestXml, "<KEY>", "</KEY>")[0].Value; option = BaseFun.getAllHyperLinks(RequestXml, "<OPTION>", "</OPTION>")[0].Value; //调整dt_a013010101 的数据 if (dt_a013010101.Rows.Count > 0) { string a016_a016_enable = dt_a013010101.Rows[0]["a016_enable"].ToString(); DataTable dt = dt_a013010101.Clone(); dt.Clear(); //格式化列 for (int i = 0; i < dt_a013010101.Rows.Count; i++) { a016_a016_enable = dt_a013010101.Rows[i]["a016_enable"].ToString(); if (a016_a016_enable == "0" || a016_a016_enable == "1") { string A016_ENABLE = dt_a013010101.Rows[i]["A016_ENABLE"].ToString(); if (A016_ENABLE == "0") { dt_a013010101.Rows[i]["COL_ENABLE"] = "0"; } string A016_VISIBLE = dt_a013010101.Rows[i]["A016_VISIBLE"].ToString(); if (A016_VISIBLE == "0") { dt_a013010101.Rows[i]["COL_VISIBLE"] = "0"; } string A016_NECESSARY = dt_a013010101.Rows[i]["A016_NECESSARY"].ToString(); if (A016_NECESSARY == "1") { dt_a013010101.Rows[i]["COL_NECESSARY"] = "1"; } string a016_col_x = dt_a013010101.Rows[i]["a016_col_x"].ToString(); if (a016_col_x != null && a016_col_x != "") { dt_a013010101.Rows[i]["COL_X"] = decimal.Parse(a016_col_x); } string a016_bs_width = dt_a013010101.Rows[i]["a016_bs_width"].ToString(); string bs_width = dt_a013010101.Rows[i]["bs_width"].ToString(); if (a016_bs_width != null && a016_bs_width != "" && a016_bs_width != bs_width) { dt_a013010101.Rows[i]["bs_width"] = decimal.Parse(a016_bs_width); string bs_edit_width = dt_a013010101.Rows[i]["BS_EDIT_WIDTH"].ToString(); dt_a013010101.Rows[i]["BS_EDIT_WIDTH"] = decimal.Parse(bs_edit_width) + (decimal.Parse(a016_bs_width) - decimal.Parse(bs_width)); string col_width = dt_a013010101.Rows[i]["col_width"].ToString(); dt_a013010101.Rows[i]["col_width"] = decimal.Parse(col_width) + (decimal.Parse(a016_bs_width) - decimal.Parse(bs_width)); } } string col01 = dt_a013010101.Rows[i]["col01"].ToString().ToLower(); if (col01 == "1") { if_select = true; string COLUMN_ID = dt_a013010101.Rows[i]["COLUMN_ID"].ToString(); string line_no = dt_a013010101.Rows[i]["LINE_NO"].ToString(); string select_sql_ = dt_a013010101.Rows[i]["SELECT_SQL"].ToString(); select_sql_ = select_sql_.Replace("[A007_KEY]", GlobeAtt.A007_KEY); select_sql_ = select_sql_.Replace("[A30001_KEY]", GlobeAtt.A30001_KEY); select_sql_ = select_sql_.Replace("[USER_ID]", GlobeAtt.A007_KEY); select_sql_ = select_sql_.Replace("[MAIN_KEY]", main_key_value); dt_temp = Fun.getDtBySql(select_sql_); //sql string BS_HTML_ = dt_a013010101.Rows[i]["BS_HTML"].ToString(); string col10 = dt_a013010101.Rows[i]["col10"].ToString(); string col_X = dt_a013010101.Rows[i]["COL_X"].ToString(); for (int j = 0; j < dt_temp.Rows.Count; j++) { string id = dt_temp.Rows[j][0].ToString(); string name = dt_temp.Rows[j][1].ToString(); DataRow dr = dt_a013010101.NewRow(); dr = dt_a013010101.Rows[i]; dr["COLUMN_ID"] = COLUMN_ID + id; dr["COL_TEXT"] = name; dr["COL_X"] = double.Parse(col_X) + 0.0001 * j; dr["A10001_KEY"] = int.Parse(line_no) * 1000 + j; string BS_HTML = BS_HTML_.Replace("[" + COLUMN_ID + "]", "[" + COLUMN_ID + id + "]"); BS_HTML = BS_HTML.Replace("[" + dt_temp.Columns[0].ToString().ToUpper() + "]", id); dr["BS_HTML"] = BS_HTML; dt.ImportRow(dr); //替换列名称 u_select_sql = u_select_sql + col10.Replace("[" + dt_temp.Columns[0].ToString().ToUpper() + "]", id) + " as " + COLUMN_ID + id + ","; } } else { dt.ImportRow(dt_a013010101.Rows[i]); } } dt_a013010101 = dt; DataRow[] rows = dt_a013010101.Select("", "COL_X asc"); DataTable t = dt_a013010101.Clone(); t.Clear(); foreach (DataRow row in rows) { t.ImportRow(row); } dt_a013010101 = t; } if (option == "Q") { PageRow = int.Parse(GlobeAtt.QueryList_PageRow); string PageRow_ = dt_a00201.Rows[0]["pagerows"].ToString(); if (PageRow_ != null && PageRow_ != "") { PageRow = int.Parse(PageRow_); } } else { string PageRow_ = dt_a00201.Rows[0]["pagerows"].ToString(); if (PageRow_ != null && PageRow_ != "") { PageRow = int.Parse(PageRow_); } } try { PageNum = int.Parse(BaseFun.getAllHyperLinks(RequestXml, "<PageNum>", "</PageNum>")[0].Value); } catch { PageNum = 1; } string data_sql = ""; string con_sql = ""; if (option != "Q") { if (option == "I") { con_sql = con_sql + " AND 1=2"; } else { if (dt_a00201.Rows[0]["if_main"].ToString() != "1") { if (dt_a00201.Rows[0]["MAIN_KEY"].ToString() != "") { con_sql = con_sql + " AND " + dt_a00201.Rows[0]["MAIN_KEY"].ToString() + "='" + main_key_value + "'"; } else { con_sql = con_sql + " AND " + dt_a00201.Rows[0]["TABLE_KEY"].ToString() + "='" + main_key_value + "'"; } } } } else { // showdatasql = replace_getShowDataSql(dt_a013010101, showdatasql, u_select_sql); if (PageNum <= 0) { string RETRIEVE = dt_a00201.Rows[0]["RETRIEVE"].ToString(); if (RETRIEVE != "1") { con_sql = con_sql + " AND 1=2"; } } string A002ID = BaseFun.getAllHyperLinks(RequestXml, "<A002ID>", "</A002ID>")[0].Value; if (a00201_key != A002ID) { option = "V"; con_sql = con_sql + " AND " + dt_a00201.Rows[0]["MAIN_KEY"].ToString() + "='" + main_key_value + "'"; } //if (RequestURL.ToUpper().IndexOf("QUERYDATA.ASPX") > 0 && main_key_value != "") //{ // con_sql = con_sql + " AND " + dt_a00201.Rows[0]["TABLE_KEY"].ToString() + "='" + main_key_value + "'"; //} } if (option == "Q") { con_sql = con_sql + " AND ROWNUM <=" + dt_a00201.Rows[0]["MAXROWS"].ToString(); } int pos = showdatasql.IndexOf("ORDER BY"); string str_order = ""; if (pos > 0) { str_order = " " + showdatasql.Substring(pos); showdatasql = showdatasql.Substring(0, pos - 1); } else { str_order = " " + sort_col; } data_sql = showdatasql + con_sql + str_order; getShowDataCountSql = getShowDataCountSql + con_sql; data_sql = data_sql.Replace("[MAIN_KEY]", main_key_value); getShowDataCountSql = getShowDataCountSql.Replace("[MAIN_KEY]", main_key_value); /*把查询的写日志记录到A00601中*/ if (GlobeAtt.BS_LOG_SELECTSQL == "1") { string log_sql = "pkg_a.saveQuerySql('" + GlobeAtt.A007_KEY + "', '" + a00201_key + "' , '" + data_sql.Replace("'", "''") + "','" + main_key_value + "' ) "; try { Fun.saveQuerySql(a00201_key, data_sql, main_key_value, option); } catch (Exception ex) { log_sql = ex.Message; } } if (option != "Q") { if (if_select) { data_sql = "Select a.* , " + u_select_sql + " rownum as rn from (" + data_sql + ") a where rownum <= " + (PageNum * PageRow).ToString(); } else { data_sql = "Select a.* , rownum as rn from (" + data_sql + ") a where rownum <= " + (PageNum * PageRow).ToString(); } } else { data_sql = "Select a.* , rownum as rn from (" + data_sql + ") a where rownum <= " + (PageNum * PageRow).ToString(); } data_sql = "Select b.* from (" + data_sql + ") b where rn > " + ((PageNum - 1) * PageRow).ToString(); Session["QUERY" + a00201_key] = data_sql; DateTime ld = DateTime.Now; dt_data = Fun.getDtBySql(data_sql); double le = (DateTime.Now - ld).TotalSeconds; string sql_ = "Select pkg_show.geta00204('" + a00201_key + "','" + main_key_value + "','" + GlobeAtt.A007_KEY + "','0','" + option + "','" + status + "') as c from dual "; if (option == "Q") { sql_ = "Select pkg_show.geta00204('" + a00201_key + "','[LIST]','" + GlobeAtt.A007_KEY + "','1','Q') as c from dual "; } dt_a00204 = Fun.getDtBySql(sql_); double GRID_SECONDS = 5; try { GRID_SECONDS = double.Parse(GlobeAtt.GetValue("GRID_SECONDS")); } catch { GRID_SECONDS = 5; } if (le < GRID_SECONDS) { dt_temp = Fun.getDtBySql(getShowDataCountSql); try { rowscount = int.Parse(dt_temp.Rows[0][0].ToString()); } catch { rowscount = 0; } } else { if (dt_data.Rows.Count < PageRow) { rowscount = dt_data.Rows.Count; } else { rowscount = int.Parse(dt_a00201.Rows[0]["MAXROWS"].ToString()); } } pagecount = rowscount / PageRow; if (rowscount % PageRow > 0) { pagecount = pagecount + 1; } } catch (Exception ex) { Response.Write("ERROR URL:" + ex.Message); } }
protected void Page_Load(object sender, EventArgs e) { ReturnCode = "0"; try { Stream RequestStream = Request.InputStream; StreamReader RequestStreamReader = new StreamReader(RequestStream); RequestXml = RequestStreamReader.ReadToEnd(); RequestStream.Close(); } catch (Exception ex) { ReturnCode = "-1"; ReturnMessage = "错误报文格式!"; Error_Resp("0", "errorresp"); return; } string clientip = Fun.getClientIp(); // '&' (ampersand) becomes '&' RequestXml = RequestXml.Replace("&", "&"); //'"' (double quote) becomes '"' when ENT_NOQUOTES is not set. RequestXml = RequestXml.Replace(""", "\""); //''' (single quote) becomes ''' only when ENT_QUOTES is set. RequestXml = RequestXml.Replace("'", "'"); //'<' (less than) becomes '<' RequestXml = RequestXml.Replace("<", "<"); //'>' (greater than) becomes '>' RequestXml = RequestXml.Replace(">", ">"); SaveLog.Verification(clientip + ":" + RequestXml); //获取MessageName try { MessageName = BaseFun.getAllHyperLinks(RequestXml, "<messagename>", "</messagename>")[0].Value; MessageName = MessageName.Substring(0, MessageName.Length - 3); } catch (Exception ex) { ReturnCode = "-1"; ReturnMessage = "错误报文格式(-1)!"; Error_Resp("0", "errorresp"); return; } try { //检测报文消息的有效性 string sql = "Select t.* from A319 t where a319_id='" + MessageName + "'"; DataTable dt_a319 = new DataTable(); dt_a319 = Fun.getDtBySql(sql); if (dt_a319.Rows.Count == 0) { ReturnCode = "-1"; ReturnMessage = "错误报文格式(-2)!" + MessageName + sql; Error_Resp("0", MessageName); return; } if (dt_a319.Rows[0]["A319_TYPE"].ToString() == "0") { ReturnCode = "-1"; ReturnMessage = "错误报文格式(-3)!" + MessageName; Error_Resp("0", MessageName); return; } //检测报文状态失败有效 if (dt_a319.Rows[0]["STATE"].ToString() != "1") { ReturnCode = "-1"; ReturnMessage = "错误报文格式(-4)!" + MessageName; Error_Resp("0", MessageName); return; } //检测客户端的有效性 sql = dt_a319.Rows[0]["REQSQL"].ToString(); if (sql.Length > 10) { sql = sql.Replace("[CLIENTIP]", clientip); DataTable dt_temp = new DataTable(); dt_temp = Fun.getDtBySql(sql); if (dt_temp.Rows.Count <= 0) { ReturnCode = "-1"; ReturnMessage = "错误的客户端地址!" + MessageName; Error_Resp("0", MessageName); return; } } sql = "Select s_a31902 .nextval as c from dual"; DataTable dt = new DataTable(); dt = Fun.getDtBySql(sql); if (dt.Rows.Count <= 0) { ReturnCode = "-1"; ReturnMessage = "获取日志编码失败!" + MessageName; Error_Resp("0", MessageName); return; } log_key = dt.Rows[0][0].ToString(); //开始写日志 OracleParameter[] parmeters = { new OracleParameter("Messagename_", OracleType.NVarChar, 200), new OracleParameter("A31902_Line_", OracleType.NVarChar, 200), new OracleParameter("User_Id_", OracleType.NVarChar, 200), new OracleParameter("Requestxml_", OracleType.Clob) }; parmeters[0].Direction = ParameterDirection.Input; parmeters[1].Direction = ParameterDirection.Input; parmeters[2].Direction = ParameterDirection.Input; parmeters[0].Value = MessageName; parmeters[1].Value = log_key; parmeters[2].Value = clientip; parmeters[3].Value = RequestXml; //写日志 int li_db = 0; Fun.db.db_oracle.BeginTransaction(); try { li_db = Fun.db.db_oracle.ExecuteNonQuery("Pkg_a319_api.Save_Xml_", parmeters); //db.ExecuteNonQuery(str_sql, CommandType.Text); if (li_db < 0) { Fun.db.db_oracle.Rollback(); ReturnCode = "-1"; ReturnMessage = "记录日志失败!" + MessageName; Error_Resp("0", MessageName); return; } } catch (Exception ex) { Fun.db.db_oracle.Rollback(); ReturnCode = "-1"; ReturnMessage = BaseFun.GetOracleMsg(ex.Message); Error_Resp("0", MessageName); return; } Fun.db.db_oracle.Commit(); //处理报文 OracleParameter[] parm = { new OracleParameter("A31902_Line_", OracleType.NVarChar, 200) }; parm[0].Direction = ParameterDirection.Input; parm[0].Value = log_key; //写日志 Fun.db.db_oracle.BeginTransaction(); try { li_db = Fun.db.db_oracle.ExecuteNonQuery("Pkg_a319_api.Req_xml_", parm); //db.ExecuteNonQuery(str_sql, CommandType.Text); if (li_db < 0) { Fun.db.db_oracle.Rollback(); ReturnCode = "-1"; ReturnMessage = "处理失败!" + MessageName; Error_Resp("0", MessageName); return; } } catch (Exception ex) { Fun.db.db_oracle.Rollback(); ReturnCode = "-1"; ReturnMessage = BaseFun.GetOracleMsg(ex.Message); Error_Resp("0", MessageName); return; } Fun.db.db_oracle.Commit(); // responsexml = parmeters[1].Value.ToString(); try { DataTable dt_send = new DataTable(); dt_send = Fun.getDtBySql("select t.sendxml from a31902 t where line_no=" + log_key); Response.Write(dt_send.Rows[0][0].ToString()); } catch { ReturnCode = "-1"; ReturnMessage = "处理失败!" + MessageName; Error_Resp("0", MessageName); } } catch { ReturnCode = "-1"; ReturnMessage = "处理失败!" + MessageName; Error_Resp("0", MessageName); } }