public string ExportCode(string clientInf) { Dictionary <string, string> resultDic = new Dictionary <string, string>(); resultDic["result"] = ""; resultDic["message"] = ""; string sqlstr = "select c.parentnodeid,c.nodename,c.nodevalue from t_code_content c join t_code_menu m on c.parentnodeid=m.nodeid where m.nodeoperpage='app' order by c.nodeid"; DataSet ds1 = new DataSet(); DataSet ds2 = new DataSet(); DataTable dt1 = new DataTable(); DataTable dt2 = new DataTable(); StringBuilder result = new StringBuilder(@"<?xml version=#1.0# encoding=#UTF-8#?>" + System.Environment.NewLine + "<!DOCTYPE plist PUBLIC #-//Apple//DTD PLIST 1.0//EN# #http://www.apple.com/DTDs/PropertyList-1.0.dtd#>" + System.Environment.NewLine + "<plist version=#1.0#>" + System.Environment.NewLine + "<dict>" + System.Environment.NewLine); try { ds1 = _iAccessData.Query(sqlstr); ds2 = _iAccessData.Query("select distinct(parentnodeid) from t_code_content order by parentnodeid"); dt1 = ds1.Tables[0]; dt2 = ds2.Tables[0]; for (int i = 0; i < dt2.Rows.Count; i++) { DataRow[] drs = dt1.Select("parentnodeid ='" + dt2.Rows[i][0].ToString() + "'"); for (int j = 0; j < drs.Length; j++) { if (j == 0) { result.Append("<key>" + drs[j][0].ToString() + "</key>" + System.Environment.NewLine + "<string>[{#id#:#" + drs[j][2].ToString() + "#,#text#:#" + drs[j][1].ToString() + "#},"); } else { result.Append("{#id#:#" + drs[j][2].ToString() + "#,#text#:#" + drs[j][1].ToString() + "#},"); } if (j == drs.Length - 1) { result.Remove(result.ToString().LastIndexOf(','), 1); result.Append("]</string>" + System.Environment.NewLine); } } } result.Append("</dict>" + System.Environment.NewLine + "</plist>"); result.Replace('#', '"'); string downloadPath = Eva.Library.Format.FormatTextTool.GetMapPath((Eva.Library.Configuration.ConfigurationManager.AppSettings["AppResourceRootPath"] + "code/code.plist"), HttpContext.Current.Server); sara.dd.ldsw.commonclass.FileOperation.writeFile(downloadPath, result.ToString()); resultDic["message"] = Eva.Library.Configuration.ConfigurationManager.AppSettings["AppResourceRootPath"] + "code/code.plist"; resultDic["result"] = "true"; } catch (Exception ex) { resultDic["result"] = "false"; resultDic["message"] = Eva.Library.Format.FormatTextTool.ErrorMessageFormat(ex.Message + ex.StackTrace); } return(Eva.Library.Format.FormatEntityTool.FormatDicToJson(resultDic)); }
/// <summary> /// /// </summary> /// <param name="whereString"></param> /// <param name="orderByString">sys_creatdate desc,sys_id desc</param> /// <param name="columnsString">where、orderby条件可以在columns之外</param> /// <param name="pageSizeString">如果为null则获取全部数据</param> /// <param name="pageIndexString">如果为null则获取全部数据</param> /// <returns></returns> public List <sara.dd.ldsw.model.tbl_ld_cben> GetList(string whereString, string orderByString, string columnsString, string pageSizeString, string pageIndexString, Eva.Library.Data.AccessDataTrans.IAccessDataTrans t) { StringBuilder strSql = new StringBuilder(); strSql.Append(" select " + columnsString + " from ("); strSql.Append(" select rownum rn,a.* from ("); strSql.Append(" select * from tbl_ld_cben t where"); if (whereString.Trim() == "") { strSql.Append(" 1=1 "); } else { strSql.Append(" " + whereString); } if (orderByString.Trim() == "") { strSql.Append(" order by sys_creatdate desc "); } else { strSql.Append(" order by " + orderByString); } strSql.Append(" ) a "); strSql.Append(" ) b "); if (pageSizeString != "" && pageSizeString != null && pageIndexString != "" && pageIndexString != null) { int fromInt = int.Parse(pageSizeString) * (int.Parse(pageIndexString) - 1) + 1; int toInt = (int.Parse(pageSizeString) * (int.Parse(pageIndexString))); strSql.Append(" where b.rn>='" + fromInt.ToString() + "' and b.rn <='" + toInt.ToString() + "' "); } DataTable resultDataTable = null; if (t == null) { resultDataTable = _iAccessData.Query(strSql.ToString()).Tables[0]; } else { resultDataTable = t.Query(strSql.ToString()).Tables[0]; } List <sara.dd.ldsw.model.tbl_ld_cben> modelList = Eva.Library.Format.FormatEntityTool.FormatDataTableToModelList <sara.dd.ldsw.model.tbl_ld_cben>(resultDataTable); if (Eva.Library.Configuration.ConfigurationManager.AppSettings["SqlEditMode"].ToString() == "parameter") { } else //如果是sql形式的话,则进行textReturn { modelList = Eva.Library.Format.FormatTextTool.ModelListReturn(modelList); } return(modelList); }
/// <summary> /// 删除附件 /// </summary> /// <param name="fileID">附件ID</param> /// <param name="delmod">1:物理删除,2:逻辑删除</param> /// <param name="isfilelog">1:记录日志,2:不记录日志</param> /// <param name="clientInf">用户信息</param> /// <returns></returns> public static void deleteByFileName(string fileIDs, Eva.Library.Data.AccessDataTrans.IAccessDataTrans t) { //删除物理文件 string fileuploadname = ""; string query_sql = "select * from tbl_file_content where menuid in ('" + fileIDs.Replace(",", "','") + "')"; DataSet ds = null; if (t == null) { ds = _iAccessData.Query(query_sql); } else { ds = t.Query(query_sql); } if (ds != null) { for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { fileuploadname += ds.Tables[0].Rows[i]["fileuploadname"].ToString() + "^"; } } fileuploadname = fileuploadname.TrimEnd('^'); if (fileuploadname != "") { string methordName = "deleteByFileUploadName"; object[] args = { _fileUpLoadRootPath, fileuploadname }; string rr = sara.dd.ldsw.commonclass.webserviceadapter.DoWebService(_serviceFile_url, methordName, args).ToString(); IDictionary <string, string> re = Eva.Library.Format.FormatEntityTool.FormatJsonToDic(rr); if (re["result"] == "true") { } else { throw new Exception(re["message"]); } } string sql_tbl_file_content = " delete from tbl_file_content where menuid in ('" + fileIDs.Replace(",", "','") + "')"; string sql_tbl_file_menu = " delete from tbl_file_menu where id in ('" + fileIDs.Replace(",", "','") + "')"; if (t == null) { _iAccessData.ExecuteSql(sql_tbl_file_content); _iAccessData.ExecuteSql(sql_tbl_file_menu); } else { t.ExecuteSql(sql_tbl_file_content); t.ExecuteSql(sql_tbl_file_menu); } }
protected void Application_Start(object sender, EventArgs e) { try { HttpContext HttpCurrent = HttpContext.Current; if (HttpCurrent != null) { Eva.Library.Global.AppRootPath = HttpCurrent.Server.MapPath("~"); } else { Eva.Library.Global.AppRootPath = AppDomain.CurrentDomain.BaseDirectory; if (Regex.Match(Eva.Library.Global.AppRootPath, @"\\$", RegexOptions.Compiled).Success) { Eva.Library.Global.AppRootPath = Eva.Library.Global.AppRootPath.Substring(0, Eva.Library.Global.AppRootPath.Length - 1); } } Eva.Library.Global.AppRootPath = Eva.Library.Global.AppRootPath + "\\"; Eva.Library.Global.ConfigFileName = System.Configuration.ConfigurationManager.AppSettings["ConfigFileName"].ToString(); //2016-01-15---token _iAccessData = commonclass.commonclass.CreateIAccessData(); _dt_token_function_istoken = _iAccessData.Query("select f_function,f_service from t_token_function where sys_delflag='0' and f_istoken='false'").Tables[0]; _dt_token_function_isencrypt = _iAccessData.Query("select f_function,f_service from t_token_function where sys_delflag='0' and f_isencrypt='false'").Tables[0]; _dt_token_function_islock = _iAccessData.Query("select f_function,f_service,f_value10 from t_token_function where sys_delflag='0' and f_value10 is not null").Tables[0]; ConfigAppName = System.Configuration.ConfigurationManager.AppSettings["EasyFrameConfigName"].ToString(); ConfigAppCode = Eva.Library.Configuration.ConfigurationManager.AppSettings["AppCode"].ToString(); ConfigDefaultTokenId = Eva.Library.Configuration.ConfigurationManager.AppSettings["DefaultTokenId"].ToString(); ConfigWebServiceCollect = Eva.Library.Configuration.ConfigurationManager.AppSettings["WebServiceCollect"].ToString(); ConfigWebServiceEncrypt = Eva.Library.Configuration.ConfigurationManager.AppSettings["WebServiceEncrypt"].ToString(); ConfigWebServiceLock = Eva.Library.Configuration.ConfigurationManager.AppSettings["WebServiceLock"].ToString(); ConfigWebServiceToken = Eva.Library.Configuration.ConfigurationManager.AppSettings["WebServiceToken"].ToString(); //2016-01-15---log if (_ilog == null) { _ilog = Eva.Library.Log.LogFactory.CreateLogBySchemaName(Eva.Library.Global.AppRootPath + Eva.Library.Global.ConfigFileName, "54"); } } catch { } }
public string GetQueryCopyResult(string whereString, string orderByString, string columnsString, string pageSizeString, string pageIndexString, string clientInf) { Dictionary <string, string> resultDic = new Dictionary <string, string>(); resultDic["result"] = ""; resultDic["message"] = ""; try { columnsString = FormatColumns(columnsString).Replace("^", ","); string sqlTemp = ""; DataSet ds = new DataSet(); DataSet dsTemp = new DataSet(); Eva.Library.Data.AccessData.IAccessData _ia = commonclass.commonclass.CreateIAccessData(); string sql = ""; sql = "select " + columnsString + " from (select rownum rn,a.* from (select * from tbl_maintable where "; if (whereString.Trim() == "") { sql += " 1=1 "; } else { sql += whereString; } sql += " order by " + orderByString; sql += ") a ) b"; sqlTemp = sql; if (pageSizeString != "" && pageSizeString != null && pageIndexString != "" && pageIndexString != null) { int fromInt = int.Parse(pageSizeString) * (int.Parse(pageIndexString) - 1) + 1; int toInt = (int.Parse(pageSizeString) * (int.Parse(pageIndexString))); sql += " where b.rn>='" + fromInt.ToString() + "' and b.rn <='" + toInt.ToString() + "' "; } ds = _ia.Query(sql); dsTemp = _ia.Query(sqlTemp); string rows = Eva.Library.Format.FormatEntityTool.FormatDataTableToJson(ds.Tables[0]); string message = "{\"total\":\"" + dsTemp.Tables[0].Rows.Count + "\",\"rows\":" + rows + "}"; resultDic["message"] = message; resultDic["result"] = "true"; NewLog("数据查询成功,查询的数据条件为:whereString:" + whereString + ",orderByString:" + orderByString + ",columnsString:" + columnsString + ",pageSizeString:" + pageSizeString + ",pageIndexString:" + pageIndexString + "", "sql_select", clientInf); } catch (Exception ex) { resultDic["result"] = "false"; resultDic["message"] = Eva.Library.Format.FormatTextTool.ErrorMessageFormat(ex.Message + ex.StackTrace); NewLog("数据查询失败,查询的数据条件为:whereString:" + whereString + ",orderByString:" + orderByString + ",columnsString:" + columnsString + ",pageSizeString:" + pageSizeString + ",pageIndexString:" + pageIndexString + ",异常信息:" + Eva.Library.Format.FormatTextTool.ErrorMessageFormat(ex.Message + ex.StackTrace), "sql_select", clientInf); } return(Eva.Library.Format.FormatEntityTool.FormatDicToJson(resultDic)); }
public string CreatExcelBySqlAppcode(string sqlStr, string appcodeStr) { _iAccessData = Eva.Library.Data.AccessData.AccessDataFactory.CreateDataAccess(DataBaseType.oracledal, Eva.Library.Configuration.ConfigurationManager.AppSettings["DataBaseConnectString_" + appcodeStr].ToString()); DataSet ds = _iAccessData.Query((sqlStr)); return(sara.dd.ldsw.commonclass.commonclass.CreatExcelByDataTable(ds.Tables[0])); }
public string CheckFileSize(string menuids, string fileMaxSize) { _iAccessData = commonclass.commonclass.CreateIAccessData(); Dictionary <string, string> resultDic = new Dictionary <string, string>(); resultDic["result"] = ""; resultDic["message"] = ""; try { DataSet dsFile = _iAccessData.Query("select * from tbl_file_content where menuid in ('" + menuids.Replace("^", "','") + "')"); string message = ""; for (int i = 0; i < dsFile.Tables[0].Rows.Count; i++) { if (Eva.Library.Text.NumberTool.Parse(dsFile.Tables[0].Rows[i]["filesize"].ToString()) > Eva.Library.Text.NumberTool.Parse(fileMaxSize)) { message += "【" + dsFile.Tables[0].Rows[i]["filerealname"].ToString() + "】文件大于" + fileMaxSize + ",请注意修改<br/>"; } } resultDic["result"] = "true"; resultDic["message"] = message; } catch (Exception ex) { resultDic["result"] = "false"; resultDic["message"] = Eva.Library.Format.FormatTextTool.ErrorMessageFormat(ex.Message + ex.StackTrace); } return(Eva.Library.Format.FormatEntityTool.FormatDicToJson(resultDic)); }
public string AddListByTitleResource(string json, string clientInf) { Dictionary <string, string> resultDic = new Dictionary <string, string>(); resultDic["result"] = ""; resultDic["message"] = ""; try { sara.dd.ldsw.model.tbl_app_news_content model = Eva.Library.Format.FormatEntityTool.FormatJsonToModel <sara.dd.ldsw.model.tbl_app_news_content>(json); Eva.Library.Data.AccessData.IAccessData iAccessData = Eva.Library.Data.AccessData.AccessDataFactory.CreateDataAccess(DataBaseType.oracledal, Eva.Library.Configuration.ConfigurationManager.AppSettings["DataBaseConnectionString"].ToString()); DataSet ds = iAccessData.Query("select * from tbl_file_content where menuid in (select f_contentresource from tbl_app_news where sys_id='" + model.fk_tbl_app_news_sys_id + "')"); for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { model.sys_id = 0; model.f_mediaurl = ds.Tables[0].Rows[i]["FILEUPLOADNAME"].ToString(); _idal_tbl_app_news_content.Add(model, null); } resultDic["result"] = "true"; resultDic["message"] = ""; NewLog("数据创建成功,创建的数据为:" + json, "sql_insert", clientInf); } catch (Exception ex) { resultDic["result"] = "false"; resultDic["message"] = Eva.Library.Format.FormatTextTool.ErrorMessageFormat(ex.Message + ex.StackTrace); NewLog("数据创建失败,创建的数据为:" + json + ",异常信息:" + Eva.Library.Format.FormatTextTool.ErrorMessageFormat(ex.Message + ex.StackTrace), "sql_insert", clientInf); } return(Eva.Library.Format.FormatEntityTool.FormatDicToJson(resultDic)); }
public string Export(string clientInf) { Dictionary <string, string> resultDic = new Dictionary <string, string>(); resultDic["result"] = ""; resultDic["message"] = ""; Eva.Library.Data.AccessData.IAccessData _iAccessData = sara.dd.ldsw.commonclass.commonclass.CreateIAccessData(); string sqlstr = "select f_htmlname,f_htmlversion from tbl_app_version_html order by f_htmlname"; DataTable dt = new DataTable(); StringBuilder result = new StringBuilder(@"<?xml version=#1.0# encoding=#UTF-8#?>" + System.Environment.NewLine + "<!DOCTYPE plist PUBLIC #-//Apple//DTD PLIST 1.0//EN# #http://www.apple.com/DTDs/PropertyList-1.0.dtd#>" + System.Environment.NewLine + "<plist version=#1.0#>" + System.Environment.NewLine + "<dict>" + System.Environment.NewLine); try { dt = _iAccessData.Query(sqlstr).Tables[0]; for (int i = 0; i < dt.Rows.Count; i++) { result.Append("<key>" + dt.Rows[i]["f_htmlname"].ToString() + "</key>" + System.Environment.NewLine + "<string>" + dt.Rows[i]["f_htmlversion"].ToString() + "</string>" + System.Environment.NewLine); } result.Append("</dict>" + System.Environment.NewLine + "</plist>"); result.Replace('#', '"'); string downloadPath = Eva.Library.Format.FormatTextTool.GetMapPath((Eva.Library.Configuration.ConfigurationManager.AppSettings["AppResourceRootPath"] + "html/html.plist"), HttpContext.Current.Server); sara.dd.ldsw.commonclass.FileOperation.writeFile(downloadPath, result.ToString()); resultDic["message"] = Eva.Library.Configuration.ConfigurationManager.AppSettings["AppResourceRootPath"] + "html/html.plist"; resultDic["result"] = "true"; } catch (Exception ex) { resultDic["result"] = "false"; resultDic["message"] = Eva.Library.Format.FormatTextTool.ErrorMessageFormat(ex.Message + ex.StackTrace); } return(Eva.Library.Format.FormatEntityTool.FormatDicToJson(resultDic)); }
public string getLogListByMaintableSysId(string maintable_sys_id, string orderByString, string pageSizeString, string pageIndexString, string clientInf) { Dictionary <string, string> resultDic = new Dictionary <string, string>(); try { resultDic["result"] = "true"; Eva.Library.Data.AccessData.IAccessData _ia = commonclass.commonclass.CreateIAccessData(); string sql = "select sys_projectclassid from tbl_maintable where sys_id='" + maintable_sys_id + "'"; string sys_projclassid = _ia.GetSingle(sql).ToString(); string selectStr = "select sys_creatdate,sys_id,sys_flag,value1,value2,value3,value4,value5,businessname,businessid,processsinsid,processdefid,workflowid,"; selectStr += " sys_creatusername,"; selectStr += " sys_creatuserid,"; selectStr += " (select value1 from t_projclass_dtl1 where projclassid='" + sys_projclassid + "' and projstate =fromstate )as fromstate,"; selectStr += " (select value1 from t_projclass_dtl1 where projclassid='" + sys_projclassid + "' and projstate =tostate )as tostate ,"; selectStr += " remark"; selectStr += " from t_projstate_log t where businessid='" + maintable_sys_id + "'"; string countSql = "select count(*) from t_projstate_log where businessid='" + maintable_sys_id + "'"; string count = _ia.GetSingle(countSql).ToString(); if (orderByString != "") { selectStr += " order by " + orderByString; } else { selectStr += " order by sys_creatdate asc"; } if (pageSizeString != "" && pageIndexString != "") { int startindex = (int.Parse(pageIndexString) - 1) * int.Parse(pageSizeString); int endindex = int.Parse(pageIndexString) * int.Parse(pageSizeString); selectStr = "select * from (select rownum rn,tt.* from(" + selectStr + ") tt) where rn<=" + endindex + " and rn>" + startindex + ""; } DataSet ds = _ia.Query(selectStr); string rows = ""; if (ds.Tables.Count > 0) { rows = Eva.Library.Format.FormatEntityTool.FormatDataTableToJson(ds.Tables[0]); } else { rows = "[]"; } string message = "{\"total\":\"" + count + "\",\"rows\":" + rows + "}"; //code-less为了程序能过,暂时处理,需要修改 message = message.Replace("\r", "").Replace("\n", ""); resultDic["message"] = message; } catch (Exception e) { resultDic["result"] = "false"; resultDic["messaget"] = Eva.Library.Format.FormatTextTool.ErrorMessageFormat(e.Message); } return(Eva.Library.Format.FormatEntityTool.FormatDicToJson(resultDic)); }
public string Delete(string whereString, string clientInf) { Dictionary <string, string> resultDic = new Dictionary <string, string>(); resultDic["result"] = ""; resultDic["message"] = ""; try { _iAccessData = sara.dd.ldsw.commonclass.commonclass.CreateIAccessData(); //删除附件的功能 //删除子表的方法 //加入删除子表附件文件的方法 string sql = "select f_yslxid,f_dyid,sys_id from tbl_ldbm_jtsj where " + whereString + ""; DataTable dt = _iAccessData.Query(sql).Tables[0]; ArrayList list = new ArrayList(); for (int i = 0; i < dt.Rows.Count; i++) { string yslxid = dt.Rows[i]["f_yslxid"].ToString(); string dyid = dt.Rows[i]["f_dyid"].ToString(); string sys_id = dt.Rows[i]["sys_id"].ToString(); string arraySql = "select count(*) as count from tbl_ld_khb where f_yslxid =(select f_yslxid from tbl_ldbm_jtsj where sys_id =" + sys_id + ") and f_dyid =(select f_dyid from tbl_ldbm_jtsj where sys_id =" + sys_id + ") and f_ztid = '0' and sys_delflag = '0'"; string count = _iAccessData.GetSingle(arraySql).ToString(); if (count != "0") { //存不可以删除的sys_id list.Add(sys_id); } else { resultDic["result"] = "true"; resultDic["message"] = _idal_tbl_ldbm_jtsj.Delete(whereString, null); NewLog("数据删除成功,删除的数据条件为:" + whereString, "sql_delete", clientInf); } } if (list.Count != 0) { string str = string.Join(",", list.ToArray()); resultDic["result"] = "false"; resultDic["message"] = "有用户正在使用该阶梯水价,不可以删除sys_id为" + str + "的阶梯水价"; } } catch (Exception ex) { resultDic["result"] = "false"; resultDic["message"] = Eva.Library.Format.FormatTextTool.ErrorMessageFormat(ex.Message + ex.StackTrace); NewLog("数据删除失败,删除的数据条件为:" + whereString + ",异常信息:" + Eva.Library.Format.FormatTextTool.ErrorMessageFormat(ex.Message + ex.StackTrace), "sql_delete", clientInf); } return(Eva.Library.Format.FormatEntityTool.FormatDicToJson(resultDic)); }
/// <summary> /// /// </summary> /// <param name="whereString"></param> /// <param name="orderByString">sys_creatdate desc,sys_id desc</param> /// <param name="columnsString">where、orderby条件可以在columns之外</param> /// <param name="pageSizeString">如果为null则获取全部数据</param> /// <param name="pageIndexString">如果为null则获取全部数据</param> /// <returns></returns> public List <sara.dd.ldsw.model.tbl_clob> GetList(string whereString, string orderByString, string columnsString, string pageSizeString, string pageIndexString, Eva.Library.Data.AccessDataTrans.IAccessDataTrans t) { StringBuilder strSql = new StringBuilder(); strSql.Append(" select " + columnsString + " from ("); strSql.Append(" select rownum rn,a.* from ("); strSql.Append(" select * from tbl_clob t where"); if (whereString.Trim() == "") { strSql.Append(" 1=1 "); } else { strSql.Append(" " + whereString); } if (orderByString.Trim() == "") { strSql.Append(" order by sys_creatdate desc "); } else { strSql.Append(" order by " + orderByString); } strSql.Append(" ) a "); strSql.Append(" ) b "); if (pageSizeString != "" && pageSizeString != null && pageIndexString != "" && pageIndexString != null) { int fromInt = int.Parse(pageSizeString) * (int.Parse(pageIndexString) - 1) + 1; int toInt = (int.Parse(pageSizeString) * (int.Parse(pageIndexString))); strSql.Append(" where b.rn>='" + fromInt.ToString() + "' and b.rn <='" + toInt.ToString() + "' "); } DataTable resultDataTable = null; if (t == null) { resultDataTable = _iAccessData.Query(strSql.ToString()).Tables[0]; } else { resultDataTable = t.Query(strSql.ToString()).Tables[0]; } List <sara.dd.ldsw.model.tbl_clob> modelList = Eva.Library.Format.FormatEntityTool.FormatDataTableToModelList <sara.dd.ldsw.model.tbl_clob>(resultDataTable); return(modelList); }
public string GetBaseCode(string clientInf) { Dictionary<string, string> resultDic = new Dictionary<string, string>(); resultDic["result"] = ""; resultDic["message"] = ""; string sqlstr = "select distinct f_resourcename from tbl_app_version_color where f_resourcename is not null"; DataTable dt = new DataTable(); string result = ""; try { dt = _iAccessData.Query(sqlstr).Tables[0]; for (int i = 0; i < dt.Rows.Count; i++) { if (i == dt.Rows.Count - 1) { result += dt.Rows[i][0].ToString(); } else { result += dt.Rows[i][0].ToString() + "^"; } } resultDic["message"] = result; resultDic["result"] = "true"; } catch (Exception ex) { resultDic["result"] = "false"; resultDic["message"] = Eva.Library.Format.FormatTextTool.ErrorMessageFormat(ex.Message + ex.StackTrace); } return Eva.Library.Format.FormatEntityTool.FormatDicToJson(resultDic); }
public string GetHtmlResource(string appVersionString, string htmlVersionString, string clientInf) { Dictionary <string, string> resultDic = new Dictionary <string, string>(); resultDic["result"] = ""; resultDic["message"] = ""; try { IDictionary <String, String> userInfDic = commonclass.commonclass.CheckClientInf(clientInf); if (userInfDic == null) { resultDic["result"] = "false"; resultDic["message"] = "客户端信息错误"; } else { string currentVersion = "1.0.0"; _iAccessData = commonclass.commonclass.CreateIAccessData(); string sqlString = "select f_htmlversion from tbl_app_version where f_apptypeid = '" + userInfDic["devicetype"] + "' and f_appversion = '" + appVersionString + "'"; DataSet ds = _iAccessData.Query(sqlString); if (ds.Tables[0].Rows.Count > 0) { currentVersion = ds.Tables[0].Rows[0]["f_htmlversion"].ToString(); } if (currentVersion != htmlVersionString) { resultDic["result"] = "true"; resultDic["message"] = currentVersion;//版本号不一致,需要客户端调用下边方法,验证是哪个文件不一致 } else { resultDic["result"] = "true"; resultDic["message"] = "true";//版本号一致 } } } catch (Exception ex) { resultDic["result"] = "error"; resultDic["message"] = Eva.Library.Format.FormatTextTool.ErrorMessageFormat(ex.Message + ex.StackTrace); } return(Eva.Library.Format.FormatEntityTool.FormatDicToJson(resultDic)); }
public string QuerySqlsByAppcode(string sqlStringJson, string appcodeStr, string isShowAll) { _iAccessData = Eva.Library.Data.AccessData.AccessDataFactory.CreateDataAccess(DataBaseType.oracledal, Eva.Library.Configuration.ConfigurationManager.AppSettings["DataBaseConnectString_" + appcodeStr].ToString()); Dictionary <string, string> resultDic = new Dictionary <string, string>(); resultDic["result"] = ""; resultDic["message"] = ""; string message = ""; try { IDictionary <string, string> sqlStringDic = Eva.Library.Format.FormatEntityTool.FormatJsonToDic(sqlStringJson); DataSet ds = null; foreach (string key in sqlStringDic.Keys) { string sql = sqlStringDic[key]; if (isShowAll != "true") { sql = "select * from (" + (sql) + ") where rownum<1001"; } ds = _iAccessData.Query(Eva.Library.Format.FormatTextTool.FormatSqlStrWidthIn1000(sql)); if (ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0) { message += "\"" + key + "\":" + Eva.Library.Format.FormatEntityTool.FormatDataTableToJson(ds.Tables[0]) + ","; } else { message += "\"" + key + "\":" + "[]" + ","; } } resultDic["result"] = "true"; resultDic["message"] = "{" + message.TrimEnd(',') + "}"; } catch (Exception ex) { resultDic["result"] = "false"; resultDic["message"] = Eva.Library.Format.FormatTextTool.ErrorMessageFormat(ex.Message + ex.StackTrace); } return(Eva.Library.Format.FormatEntityTool.FormatDicToJson(resultDic)); }
public string AddList(string json, string clientInf) { Dictionary <string, string> resultDic = new Dictionary <string, string>(); resultDic["result"] = ""; resultDic["message"] = ""; _iAccessData = commonclass.commonclass.CreateIAccessData(); try { //从t_user表读取f_value6(设备类型),f_value7(推送证书),f_value8(设备ID) List <sara.dd.ldsw.model.tbl_app_pushnotification> modellist = Eva.Library.Format.FormatEntityTool.FormatJsonToModelList <sara.dd.ldsw.model.tbl_app_pushnotification>(json); string useridString = ""; for (int i = 0; i < modellist.Count; i++) { useridString += modellist[i].f_recive_userid + ","; } string sqlString = "select u_id,u_name,f_value6,f_value7,f_value8 from t_user where u_state = '1' and u_id in ('" + useridString.TrimEnd(',').Replace(",", "','") + "')"; DataTable dt = _iAccessData.Query(sqlString).Tables[0]; DataRow[] dr = null; for (int i = 0; i < modellist.Count; i++) { dr = dt.Select("u_id = '" + modellist[i].f_recive_userid + "'"); if (dr.Length > 0) { modellist[i].f_recive_devicetype = dr[0]["f_value6"].ToString(); modellist[i].f_recive_devicetypeid = dr[0]["f_value6"].ToString(); modellist[i].f_recive_deviceid = dr[0]["f_value8"].ToString(); //modellist[i].f_recive_certificate = dr[0]["f_value7"].ToString(); } } resultDic["result"] = "true"; resultDic["message"] = _idal_tbl_app_pushnotification.AddList(modellist, null); NewLog("数据创建成功,创建的数据为:" + json, "sql_insert", clientInf); } catch (Exception ex) { resultDic["result"] = "false"; resultDic["message"] = Eva.Library.Format.FormatTextTool.ErrorMessageFormat(ex.Message + ex.StackTrace); NewLog("数据创建失败,创建的数据为:" + json + ",异常信息:" + Eva.Library.Format.FormatTextTool.ErrorMessageFormat(ex.Message + ex.StackTrace), "sql_insert", clientInf); } return(Eva.Library.Format.FormatEntityTool.FormatDicToJson(resultDic)); }
public string QuerySqls(string sqlStringJson) { _iAccessData = commonclass.commonclass.CreateIAccessData(); Dictionary <string, string> resultDic = new Dictionary <string, string>(); resultDic["result"] = ""; resultDic["message"] = ""; string message = ""; try { IDictionary <string, string> sqlStringDic = Eva.Library.Format.FormatEntityTool.FormatJsonToDic(sqlStringJson); DataSet ds = null; foreach (string key in sqlStringDic.Keys) { ds = _iAccessData.Query((sqlStringDic[key].ToString())); if (ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0) { message += "\"" + key + "\":" + Eva.Library.Format.FormatEntityTool.FormatDataTableToJson(ds.Tables[0]) + ","; } else { message += "\"" + key + "\":" + "[]" + ","; } } resultDic["result"] = "true"; resultDic["message"] = "{" + message.TrimEnd(',') + "}"; } catch (Exception ex) { resultDic["result"] = "false"; resultDic["message"] = Eva.Library.Format.FormatTextTool.ErrorMessageFormat(ex.Message + ex.StackTrace); } return(Eva.Library.Format.FormatEntityTool.FormatDicToJson(resultDic)); }
public static string GetFilesJsonArrayByFileId(string fileID) { Eva.Library.Data.AccessData.IAccessData _iAccessData = commonclass.CreateIAccessData(); string sqlString = "select * from tbl_file_content where menuid = '" + fileID + "'"; string ShpFileUpLoadRootPath = Eva.Library.Configuration.ConfigurationManager.AppSettings["ShpFileUpLoadRootPath"].ToString().Replace("http://", ""); DataSet ds = _iAccessData.Query(sqlString); IList <IDictionary <string, string> > resultDicList = new List <IDictionary <string, string> >(); for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { Dictionary <string, string> a = new Dictionary <string, string>(); a["filerealname"] = ds.Tables[0].Rows[i]["filerealname"].ToString(); a["fileuploadname"] = ShpFileUpLoadRootPath + ds.Tables[0].Rows[i]["fileuploadname"].ToString(); resultDicList.Add(a); } return(Eva.Library.Format.FormatEntityTool.FormatDicListToJson(resultDicList)); }
public string GetIdText(string dataNameStr, string whereStr, string columsStr) { Dictionary <string, string> resultDic = new Dictionary <string, string>(); string[] columns = (columsStr).Split('^'); try { string sql = "select distinct " + string.Join(",", columns) + " from " + (dataNameStr) + ((whereStr) == "" ? "" : (" where " + (whereStr))); Eva.Library.Data.AccessData.IAccessData _ia = commonclass.commonclass.CreateIAccessData(); DataSet ds = _ia.Query(sql); if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0) { ds.Tables[0].Columns.Add("id"); ds.Tables[0].Columns.Add("text"); for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { ds.Tables[0].Rows[i]["id"] = ds.Tables[0].Rows[i][columns[0]]; ds.Tables[0].Rows[i]["text"] = ds.Tables[0].Rows[i][columns[1]]; } ds.Tables[0].Columns.Remove(columns[0]); ds.Tables[0].Columns.Remove(columns[1]); resultDic["result"] = "true"; resultDic["message"] = Eva.Library.Format.FormatEntityTool.FormatDataTableToJson(ds.Tables[0]); } else { resultDic["result"] = "true"; resultDic["message"] = "[]"; } } catch (Exception e) { resultDic["result"] = "false"; resultDic["message"] = Eva.Library.Format.FormatTextTool.ErrorMessageFormat(e.Message); } return(Eva.Library.Format.FormatEntityTool.FormatDicToJson(resultDic)); }
public string getLogByMaintableSysId(string maintable_sys_id) { Dictionary <string, string> resultDic = new Dictionary <string, string>(); try { resultDic["result"] = "true"; Eva.Library.Data.AccessData.IAccessData _ia = commonclass.commonclass.CreateIAccessData(); string sql = "select sys_projectclassid from tbl_maintable where sys_id='" + maintable_sys_id + "'"; string sys_projclassid = _ia.GetSingle(sql).ToString(); string selectStr = "select sys_creatdate,"; selectStr += " sys_creatusername,"; selectStr += " sys_creatuserid,"; selectStr += " (select value1 from t_projclass_dtl1 where projclassid='" + sys_projclassid + "' and projstate =fromstate )as fromstate,"; selectStr += " (select value1 from t_projclass_dtl1 where projclassid='" + sys_projclassid + "' and projstate =tostate )as tostate ,"; selectStr += " remark"; selectStr += " from t_projstate_log t where businessid='" + maintable_sys_id + "' order by sys_creatdate asc"; DataSet ds = _ia.Query(selectStr); if (ds.Tables.Count > 0) { resultDic["message"] = Eva.Library.Format.FormatEntityTool.FormatDataTableToJson(ds.Tables[0]); } else { resultDic["message"] = "[]"; } } catch (Exception e) { resultDic["result"] = "false"; resultDic["messaget"] = Eva.Library.Format.FormatTextTool.ErrorMessageFormat(e.Message); } return(Eva.Library.Format.FormatEntityTool.FormatDicToJson(resultDic)); }
public void ProcessRequest(HttpContext context) { try { Stream s = System.Web.HttpContext.Current.Request.InputStream; byte[] b = new byte[s.Length]; s.Read(b, 0, (int)s.Length); //string xmlstr = UTF8Encoding.UTF8.GetString(b); string xmlstr = System.Text.Encoding.GetEncoding("gbk").GetString(b); if (xmlstr != null && xmlstr != "") { xmlstr = xmlstr.TrimEnd('0'); XmlDocument document = new XmlDocument(); document.LoadXml(xmlstr); //交易码 string FTranCode = ""; //公缴单位分配机构号 string InstID = ""; //交易日期时间 string TranDateTime = ""; //银行端系统流水号 string BankNum = ""; //缴费交易日期 string payDate = ""; //缴费交易流水 string bankBillNo = ""; //客户编号 string billKey = ""; //客户姓名 string customerName = ""; //缴费金额 string payAmount = ""; ////起始笔数 //string beginNum = ""; ////查询笔数 //string queryNum = ""; FTranCode = document.GetElementsByTagName("FTranCode")[0].InnerText; InstID = document.GetElementsByTagName("InstID")[0].InnerText; TranDateTime = document.GetElementsByTagName("TranDateTime")[0].InnerText; BankNum = document.GetElementsByTagName("BankNum")[0].InnerText; payDate = document.GetElementsByTagName("payDate")[0].InnerText; bankBillNo = document.GetElementsByTagName("bankBillNo")[0].InnerText; billKey = document.GetElementsByTagName("billKey")[0].InnerText; customerName = document.GetElementsByTagName("customerName")[0].InnerText; payAmount = document.GetElementsByTagName("payAmount")[0].InnerText; //beginNum = document.GetElementsByTagName("beginNum")[0].InnerText; //queryNum = document.GetElementsByTagName("queryNum")[0].InnerText; _iAccessData = commonclass.commonclass.CreateIAccessData(); if (billKey.Length == 10) { //查询该用户未缴费的抄表记录 string add_sqlStr = "sum(f_dyjtsl) as f_dyjtsl ,sum(f_dyjtsf) as f_dyjtsf ,sum(f_dejtsl) as f_dejtsl ,sum(f_dejtsf) as f_dejtsf ,sum(f_dsjtsl) as f_dsjtsl ,sum(f_dsjtsf) as f_dsjtsf "; DataTable dt = _iAccessData.Query("select wm_concat(sys_id) as sys_id,wm_concat(f_cb_cbbh) as f_cbbh,sum(f_bqje) as f_bqje,sum(f_bqsl) as f_bqsl,sum(f_sf) as f_sf,sum(f_pwf) as f_pwf,f_yhm,REPLACE(wm_concat(f_sfjl),',','|') as f_sfjl , " + add_sqlStr + " from TBL_LD_CBIAO where f_khbh='" + billKey + "' and f_ztid='2' and f_cbbh not like 'PZ%' and f_cbbh not like 'YC%' group by f_yhm").Tables[0]; DataTable ye_dt = _iAccessData.Query("select NVL(f_ye,0) as f_ye from TBL_LD_KHB where f_khbh='" + billKey + "'").Tables[0]; double ye = Eva.Library.Text.NumberTool.Parse(ye_dt.Rows[0]["f_ye"].ToString()); double bqje = Eva.Library.Text.NumberTool.Parse(dt.Rows[0]["f_bqje"].ToString()); double bqsl = Eva.Library.Text.NumberTool.Parse(dt.Rows[0]["f_bqsl"].ToString()); double sf = Eva.Library.Text.NumberTool.Parse(dt.Rows[0]["f_sf"].ToString()); double pwf = Eva.Library.Text.NumberTool.Parse(dt.Rows[0]["f_pwf"].ToString()); double f_dyjtsl = Eva.Library.Text.NumberTool.Parse(dt.Rows[0]["f_dyjtsl"].ToString()); double f_dyjtsf = Eva.Library.Text.NumberTool.Parse(dt.Rows[0]["f_dyjtsf"].ToString()); double f_dejtsl = Eva.Library.Text.NumberTool.Parse(dt.Rows[0]["f_dejtsl"].ToString()); double f_dejtsf = Eva.Library.Text.NumberTool.Parse(dt.Rows[0]["f_dejtsf"].ToString()); double f_dsjtsl = Eva.Library.Text.NumberTool.Parse(dt.Rows[0]["f_dsjtsl"].ToString()); double f_dsjtsf = Eva.Library.Text.NumberTool.Parse(dt.Rows[0]["f_dsjtsf"].ToString()); //核实缴费信息正确性 if (customerName.Trim() == dt.Rows[0]["f_yhm"].ToString() && (Eva.Library.Text.NumberTool.Parse(dt.Rows[0]["f_bqje"].ToString()) - ye) == Eva.Library.Text.NumberTool.Parse(payAmount)) { //客户信息 sara.dd.ldsw.idal.Itbl_ld_khb idal_tbl_ld_khb = new sara.dd.ldsw.dal.tbl_ld_khb(); sara.dd.ldsw.idal.Itbl_ld_jfb idal_tbl_ld_jfb = new sara.dd.ldsw.dal.tbl_ld_jfb(); sara.dd.ldsw.model.tbl_ld_khb model_tbl_ld_khb = idal_tbl_ld_khb.GetList("f_khbh='" + billKey + "'", "", "*", "", "", null)[0]; #region 创建缴费记录 sara.dd.ldsw.model.tbl_ld_jfb jfmodel = new model.tbl_ld_jfb(); DateTime currentTime = System.DateTime.Now; jfmodel.sys_creatuserid = "1565"; jfmodel.sys_creatusername = "******"; jfmodel.sys_creatdate = currentTime; jfmodel.sys_lastedituserid = "1565"; jfmodel.sys_lasteditusername = "******"; jfmodel.sys_lasteditdate = currentTime; jfmodel.sys_deldate = DateTime.Parse("1900-01-01"); jfmodel.sys_delflag = "0"; jfmodel.f_jfbh = commonclass.commonclass.getBusinessNum("JF", "", null); jfmodel.f_jfrq = currentTime; jfmodel.f_jffs = "光大银行网上缴费"; jfmodel.f_jffsid = "05740010"; jfmodel.f_jcfs = "全额找零"; jfmodel.f_jcfsid = "05750001"; jfmodel.f_yyy = "光大"; jfmodel.f_yyyid = "1565"; jfmodel.f_czsj = currentTime; jfmodel.f_sfykfp = "false"; jfmodel.f_zt = "已提交"; jfmodel.f_ztid = "2"; jfmodel.f_khbh = model_tbl_ld_khb.f_khbh; jfmodel.f_khbhid = model_tbl_ld_khb.sys_id.ToString(); jfmodel.f_yhbh = model_tbl_ld_khb.f_yhbh; jfmodel.f_yhbhid = model_tbl_ld_khb.f_yhbhid; jfmodel.f_yhm = model_tbl_ld_khb.f_yhm; jfmodel.f_jfm = model_tbl_ld_khb.f_jfm; jfmodel.f_dh = model_tbl_ld_khb.f_dh; jfmodel.f_dz = model_tbl_ld_khb.f_dz; jfmodel.f_dy = model_tbl_ld_khb.f_dy; jfmodel.f_dyid = model_tbl_ld_khb.f_dyid; jfmodel.f_sc = model_tbl_ld_khb.f_sc; jfmodel.f_scid = model_tbl_ld_khb.f_scid; jfmodel.f_qy = model_tbl_ld_khb.f_qy; jfmodel.f_qyid = model_tbl_ld_khb.f_qyid; jfmodel.f_pq = model_tbl_ld_khb.f_pq; jfmodel.f_pqid = model_tbl_ld_khb.f_pqid; jfmodel.f_sbbh = model_tbl_ld_khb.f_sbbh; jfmodel.f_sbbhid = model_tbl_ld_khb.f_sbbhid; jfmodel.f_sblx = model_tbl_ld_khb.f_sblx; jfmodel.f_sblxid = model_tbl_ld_khb.f_sblxid; jfmodel.f_yslx = model_tbl_ld_khb.f_yslx; jfmodel.f_yslxid = model_tbl_ld_khb.f_yslxid; jfmodel.f_lxtkhh = model_tbl_ld_khb.f_lxth; jfmodel.f_rs = model_tbl_ld_khb.f_rs; jfmodel.f_cbbh = dt.Rows[0]["f_cbbh"].ToString(); jfmodel.f_cbbhid = dt.Rows[0]["sys_id"].ToString(); jfmodel.f_cbyslj = Eva.Library.Text.NumberTool.GetNumberByLength(bqje, 2); jfmodel.f_sllj = Eva.Library.Text.NumberTool.GetNumberByLength(bqsl, 0); jfmodel.f_sflj = Eva.Library.Text.NumberTool.GetNumberByLength(sf, 2); jfmodel.f_pwflj = Eva.Library.Text.NumberTool.GetNumberByLength(pwf, 2); jfmodel.f_dj = Eva.Library.Text.NumberTool.GetNumberByLength(Eva.Library.Text.NumberTool.Parse(jfmodel.f_cbyslj) / Eva.Library.Text.NumberTool.Parse(jfmodel.f_sllj), 2); jfmodel.f_jmhyslj = Eva.Library.Text.NumberTool.GetNumberByLength(bqje, 2); jfmodel.f_khytjjzsf = model_tbl_ld_khb.f_tjjzsf; jfmodel.f_khytjjzpwf = model_tbl_ld_khb.f_tjjzpwf; jfmodel.f_sfsytjjz = "false"; jfmodel.f_sytjjzsf = "0"; jfmodel.f_sytjjzpwf = "0"; jfmodel.f_syhtjjzsf = model_tbl_ld_khb.f_tjjzsf; jfmodel.f_syhtjjzpwf = model_tbl_ld_khb.f_tjjzpwf; jfmodel.f_khyye = model_tbl_ld_khb.f_ycje; jfmodel.f_sfsyye = "false"; jfmodel.f_syye = "0"; jfmodel.f_yhye = model_tbl_ld_khb.f_ycje; jfmodel.f_shys = payAmount; jfmodel.f_shss = payAmount; jfmodel.f_hszl = "0"; jfmodel.f_shssdx = sara.dd.ldsw.commonclass.commonclass.num2String((Eva.Library.Text.NumberTool.Parse(payAmount))); jfmodel.f_khfz = model_tbl_ld_khb.f_khfz; jfmodel.f_khfzid = model_tbl_ld_khb.f_khfzid; jfmodel.f_cbenbh = model_tbl_ld_khb.f_cbbh; jfmodel.f_cbenbhid = model_tbl_ld_khb.f_cbbhid; jfmodel.f_ljqf = model_tbl_ld_khb.f_ljqf; jfmodel.f_jmjelj = "0"; jfmodel.f_ly = "光大自助缴费"; jfmodel.f_lyid = "08080006"; jfmodel.f_bz = xmlstr; jfmodel.f_sfjl = dt.Rows[0]["f_sfjl"].ToString(); jfmodel.f_dyjtsl = Eva.Library.Text.NumberTool.GetNumberByLength(f_dyjtsl, 2); jfmodel.f_dyjtsf = Eva.Library.Text.NumberTool.GetNumberByLength(f_dyjtsf, 2); jfmodel.f_dejtsl = Eva.Library.Text.NumberTool.GetNumberByLength(f_dejtsl, 2); jfmodel.f_dejtsf = Eva.Library.Text.NumberTool.GetNumberByLength(f_dejtsf, 2); jfmodel.f_dsjtsl = Eva.Library.Text.NumberTool.GetNumberByLength(f_dsjtsl, 2); jfmodel.f_dsjtsf = Eva.Library.Text.NumberTool.GetNumberByLength(f_dsjtsf, 2); jfmodel.f_khyycje = model_tbl_ld_khb.f_ye; if (ye > 0) { jfmodel.f_sfsyycje = "true"; jfmodel.f_syycje = model_tbl_ld_khb.f_ye; } else { jfmodel.f_sfsyycje = "false"; jfmodel.f_syycje = "0"; } jfmodel.f_yhycje = "0"; jfmodel.f_dszycje = "0"; string jfbhid = idal_tbl_ld_jfb.Add(jfmodel, null); #endregion //更新抄表表 string updatecb = "update TBL_LD_CBIAO set F_ZT='已缴费',F_ZTID='3',F_JFBH='" + jfmodel.f_jfbh + "',F_JFBHID='" + jfbhid + "',F_JFSJ=to_date('" + jfmodel.f_jfrq + "','yyyy-MM-dd hh24:mi:ss') where SYS_ID in (" + dt.Rows[0]["sys_id"].ToString() + ")"; //更新客户表 string updatekh = "update TBL_LD_KHB set F_YCJE='" + jfmodel.f_yhye + "',F_TJJZSF='" + jfmodel.f_syhtjjzsf + "',F_TJJZPWF='" + jfmodel.f_syhtjjzpwf + "',F_LJQF= '0' ,f_ye = '" + jfmodel.f_yhycje + "' where sys_id='" + jfmodel.f_khbhid + "'"; int flag_cb = _iAccessData.ExecuteSql(updatecb); int flag_kh = _iAccessData.ExecuteSql(updatekh); //写入客户表日志 #region 写入日志 List <IDictionary <string, string> > array = new List <IDictionary <string, string> >(); IDictionary <string, string> temp = null; #region 对比各个业务子段,将不同的写入array if (jfmodel.f_yhye != jfmodel.f_khyye) { temp = new Dictionary <string, string>(); temp.Add("key", "f_ycje"); temp.Add("oldvalue", jfmodel.f_khyye); temp.Add("newvalue", jfmodel.f_yhye); temp.Add("name", "绿化表押金"); array.Add(temp); } if (jfmodel.f_yhycje != jfmodel.f_khyycje) { temp = new Dictionary <string, string>(); temp.Add("key", "f_ye"); temp.Add("oldvalue", jfmodel.f_khyycje); temp.Add("newvalue", jfmodel.f_yhycje); temp.Add("name", "余额"); array.Add(temp); } if (jfmodel.f_syhtjjzsf != jfmodel.f_khytjjzsf) { temp = new Dictionary <string, string>(); temp.Add("key", "f_tjjzsf"); temp.Add("oldvalue", jfmodel.f_khytjjzsf); temp.Add("newvalue", jfmodel.f_syhtjjzsf); temp.Add("name", "调价结转水费"); array.Add(temp); } if (jfmodel.f_syhtjjzpwf != jfmodel.f_khytjjzpwf) { temp = new Dictionary <string, string>(); temp.Add("key", "f_tjjzpwf"); temp.Add("oldvalue", jfmodel.f_khytjjzpwf); temp.Add("newvalue", jfmodel.f_syhtjjzpwf); temp.Add("name", "调价结转污水处理费"); array.Add(temp); } if (jfmodel.f_cbyslj == null || jfmodel.f_cbyslj == "") { jfmodel.f_cbyslj = "0"; } if (model_tbl_ld_khb.f_ljqf == null || model_tbl_ld_khb.f_ljqf == "") { model_tbl_ld_khb.f_ljqf = "0"; } if (double.Parse(jfmodel.f_cbyslj) > 0) { temp = new Dictionary <string, string>(); temp.Add("key", "f_ljqf"); temp.Add("oldvalue", model_tbl_ld_khb.f_ljqf); temp.Add("newvalue", (double.Parse(model_tbl_ld_khb.f_ljqf) - double.Parse(jfmodel.f_cbyslj)).ToString()); temp.Add("name", "累计欠费"); array.Add(temp); } #endregion sara.dd.ldsw.commonclass.commonclass.addUpdateLog("tbl_ld_khb", jfmodel.f_khbhid.ToString(), "tbl_ld_jfb_detail", "缴费表", array, "", null); #endregion #region 应答报文 string resultxml = "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>"; resultxml += "<Out>"; resultxml += "<Head>"; resultxml += "<FTranCode>" + FTranCode + "</FTranCode>"; resultxml += "<InstID>" + InstID + "</InstID>"; resultxml += "<TranDateTime>" + TranDateTime + "</TranDateTime>"; resultxml += "<BankNum>" + BankNum + "</BankNum>"; resultxml += "<AnsCode>AAAAAAA</AnsCode>"; resultxml += "</Head>"; resultxml += "<Body>"; resultxml += "<companyNo>" + jfmodel.f_jfbh + "</companyNo>"; resultxml += "<billKey>" + billKey + "</billKey>"; resultxml += "<payAmount>" + payAmount + "</payAmount>"; resultxml += "<receiptNo></receiptNo>"; resultxml += "<reserve1></reserve1>"; resultxml += "<reserve2></reserve2>"; resultxml += "<reserve3></reserve3>"; resultxml += "<reserve4></reserve4>"; resultxml += "<reserve5></reserve5>"; resultxml += "<reserve6></reserve6>"; resultxml += "<reserve7></reserve7>"; resultxml += "<reserve8></reserve8>"; resultxml += "<reserve9></reserve9>"; resultxml += "<reserve10></reserve10>"; resultxml += "<reserve11></reserve11>"; resultxml += "<reserve12></reserve12>"; resultxml += "<reserve13></reserve13>"; resultxml += "<reserve14></reserve14>"; resultxml += "<reserve15></reserve15>"; resultxml += "<reserve16></reserve16>"; resultxml += "<reserve17></reserve17>"; resultxml += "<reserve18></reserve18>"; resultxml += "</Body>"; resultxml += "</Out>"; context.Response.ContentType = "text/plain"; context.Response.Charset = "gbk"; context.Response.ContentEncoding = System.Text.Encoding.GetEncoding("gbk"); context.Response.Write(resultxml); #endregion } else { //错误报文,缴费信息不一致 string errxml = "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>"; errxml += "<Out>"; errxml += "<Head>"; errxml += "<FTranCode>" + FTranCode + "</FTranCode>"; errxml += "<InstID>" + InstID + "</InstID>"; errxml += "<TranDateTime>" + TranDateTime + "</TranDateTime>"; errxml += "<BankNum>" + BankNum + "</BankNum>"; errxml += "<AnsCode>ERR000</AnsCode>"; errxml += "</Head>"; errxml += "<Body>"; errxml += "<ErrorCode>DEF0013</ErrorCode>"; errxml += "<ErrorInfo>错误的缴费信息</ErrorInfo>"; errxml += "</Body>"; errxml += "</Out>"; context.Response.ContentType = "text/plain"; context.Response.Charset = "gbk"; context.Response.ContentEncoding = System.Text.Encoding.GetEncoding("gbk"); context.Response.Write(errxml); } } else { //错误报文 错误的客户编号 string errxml = "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>"; errxml += "<Out>"; errxml += "<Head>"; errxml += "<FTranCode>" + FTranCode + "</FTranCode>"; errxml += "<InstID>" + InstID + "</InstID>"; errxml += "<TranDateTime>" + TranDateTime + "</TranDateTime>"; errxml += "<BankNum>" + BankNum + "</BankNum>"; errxml += "<AnsCode>ERR000</AnsCode>"; errxml += "</Head>"; errxml += "<Body>"; errxml += "<ErrorCode>DEF0013</ErrorCode>"; errxml += "<ErrorInfo>错误的客户编号</ErrorInfo>"; errxml += "</Body>"; errxml += "</Out>"; context.Response.ContentType = "text/plain"; context.Response.Charset = "gbk"; context.Response.ContentEncoding = System.Text.Encoding.GetEncoding("gbk"); context.Response.Write(errxml); } } } catch (System.Exception ex) { //错误报文 错误的客户编号 string errxml = "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>"; errxml += "<Out>"; errxml += "<Head>"; errxml += "<FTranCode></FTranCode>"; errxml += "<InstID></InstID>"; errxml += "<TranDateTime></TranDateTime>"; errxml += "<BankNum></BankNum>"; errxml += "<AnsCode>ERR000</AnsCode>"; errxml += "</Head>"; errxml += "<Body>"; errxml += "<ErrorCode>DEF0006</ErrorCode>"; errxml += "<ErrorInfo>" + ex.ToString() + "</ErrorInfo>"; errxml += "</Body>"; errxml += "</Out>"; context.Response.ContentType = "text/plain"; context.Response.Charset = "gbk"; context.Response.ContentEncoding = System.Text.Encoding.GetEncoding("gbk"); context.Response.Write(errxml); } }
public string GetCommonData(string dataNameString, string whereString, string columnsString, string orderByString, string pageSizeString, string pageIndexString, string clientInf) { Dictionary <string, string> resultDic = new Dictionary <string, string>(); resultDic["result"] = ""; resultDic["message"] = ""; string message = ""; Eva.Library.Data.AccessData.IAccessData ia = null; try { IDictionary <String, String> userInfDic = commonclass.commonclass.CheckClientInf(clientInf); if (userInfDic == null) { resultDic["result"] = "false"; resultDic["message"] = "客户端信息错误"; } else { whereString = Eva.Library.Format.FormatTextTool.TextReturn(whereString); ia = commonclass.commonclass.CreateIAccessData(); columnsString = columnsString.Replace("^", ","); StringBuilder strSql = new StringBuilder(100); strSql.Append(" select " + columnsString + " from ("); strSql.Append(" select rownum rn,a.* from ("); strSql.Append(" select * from " + dataNameString + " t where"); if (whereString.Trim() == "") { strSql.Append(" 1=1 "); } else { strSql.Append(" " + whereString); } if (orderByString.Trim() == "") { //strSql.Append(" order by sys_creatdate desc "); } else { strSql.Append(" order by " + Eva.Library.Format.FormatTextTool.TextReturn(orderByString)); } strSql.Append(" ) a "); strSql.Append(" ) b "); if (pageSizeString != "" && pageSizeString != null && pageIndexString != "" && pageIndexString != null) { int fromInt = int.Parse(pageSizeString) * (int.Parse(pageIndexString) - 1) + 1; int toInt = (int.Parse(pageSizeString) * (int.Parse(pageIndexString))); strSql.Append(" where b.rn>='" + fromInt.ToString() + "' and b.rn <='" + toInt.ToString() + "' "); } DataSet ds = ia.Query(strSql.ToString()); if (ds.Tables[0].Rows.Count > 0) { string count = "0"; string countSql = "select count(1) from " + dataNameString; if (whereString.Trim() != "") { countSql += " where " + whereString; } count = ia.GetSingle(countSql).ToString(); message = "{\"total\":\"" + count + "\",\"rows\":" + Eva.Library.Format.FormatEntityTool.FormatDataTableToJson(ds.Tables[0]) + "}"; } else { message = "{\"total\":\"0\",\"rows\":[]}"; } resultDic["result"] = "true"; resultDic["message"] = message; } } catch (Exception ex) { resultDic["result"] = "false"; resultDic["message"] = Eva.Library.Format.FormatTextTool.ErrorMessageFormat(ex.Message + ex.StackTrace); } return(Eva.Library.Format.FormatEntityTool.FormatDicToJson(resultDic)); }
public string GetCommonData(string dataNameString, string whereString, string columnsString, string orderByString, string countString, string stepString) { _iAccessData = commonclass.commonclass.CreateIAccessData(); Dictionary <string, string> resultDic = new Dictionary <string, string>(); resultDic["result"] = ""; resultDic["message"] = ""; string message = ""; try { columnsString = columnsString.TrimStart('^').TrimEnd('^').Replace("^", ","); //whereString = (whereString); //orderByString = (orderByString); StringBuilder strSqlCount = new StringBuilder(); strSqlCount.Append(" select count(*) from " + dataNameString + " t where"); if (whereString.Trim() == "") { strSqlCount.Append(" 1=1 "); } else { strSqlCount.Append(" " + whereString); } string count = _iAccessData.GetSingle(strSqlCount.ToString()).ToString(); if (count == "0" || count == "") { message = "{\"total\":\"0\",\"rows\":[]}"; } else { StringBuilder strSql = new StringBuilder(); strSql.Append(" select " + columnsString + " from ("); strSql.Append(" select rownum rn,a.* from ("); strSql.Append(" select * from " + dataNameString + " t where"); if (whereString.Trim() == "") { strSql.Append(" 1=1 "); } else { strSql.Append(" " + whereString); } if (orderByString.Trim() == "") { } else { strSql.Append(" order by " + orderByString); } strSql.Append(" ) a "); strSql.Append(" ) b "); if (countString != "" && countString != null && stepString != "" && stepString != null) { strSql.Append(" where b.rn>'" + countString + "' and b.rn <='" + (int.Parse(countString) + int.Parse(stepString)).ToString() + "' "); } DataTable resultDataTable = _iAccessData.Query(strSql.ToString()).Tables[0]; message = "{\"total\":\"" + count + "\",\"rows\":" + Eva.Library.Format.FormatEntityTool.FormatDataTableToJson(resultDataTable) + "}"; } resultDic["result"] = "true"; resultDic["message"] = message; } catch (Exception ex) { resultDic["result"] = "false"; resultDic["message"] = Eva.Library.Format.FormatTextTool.ErrorMessageFormat(ex.Message + ex.StackTrace); } return(Eva.Library.Format.FormatEntityTool.FormatDicToJson(resultDic)); }
public string GetUserNames(string queryParameter, string whereClause, string queryType, string clientInf) { Dictionary <string, string> resultDic = new Dictionary <string, string>(); resultDic["result"] = ""; resultDic["message"] = ""; string sqlString = ""; DataTable resultDataTable = null; try { _iAccessData = commonclass.commonclass.CreateIAccessData(); Dictionary <string, string> messageDic = new Dictionary <string, string>(); switch (queryType) { case "role": { sqlString = "select wm_concat(u.u_id) as userid, wm_concat(u.u_name) as username,wm_concat(u.u_phototurl) as phototurl from t_userrole_relation r, t_user u where r.r_id in ('" + queryParameter.Replace("^", "','") + "') and r.u_id = u.u_id and u.u_state = '1'"; if (whereClause != "") { sqlString += " and u.u_id in (" + whereClause + ") "; } resultDataTable = _iAccessData.Query(sqlString).Tables[0]; if (resultDataTable.Rows.Count > 0) { messageDic["userids"] = resultDataTable.Rows[0]["userid"].ToString().Replace(",", "^"); messageDic["usernames"] = resultDataTable.Rows[0]["username"].ToString().Replace(",", "^"); messageDic["phototurls"] = resultDataTable.Rows[0]["phototurl"].ToString().Replace(",", "^"); } } break; case "organ": { sqlString = "select wm_concat(u.u_id) as userid,wm_concat(u.u_name) as username,wm_concat(u.u_phototurl) as phototurl from t_user u where u.u_organid in ('" + queryParameter.Replace("^", "','") + "') and u.u_state = '1'"; if (whereClause != "") { sqlString += " and u.u_id in (" + whereClause + ") "; } resultDataTable = _iAccessData.Query(sqlString).Tables[0]; if (resultDataTable.Rows.Count > 0) { messageDic["userids"] = resultDataTable.Rows[0]["userid"].ToString().Replace(",", "^"); messageDic["usernames"] = resultDataTable.Rows[0]["username"].ToString().Replace(",", "^"); messageDic["phototurls"] = resultDataTable.Rows[0]["phototurl"].ToString().Replace(",", "^"); } } break; case "usergroup": { sqlString = " select wm_concat(u.u_id) as userid, wm_concat(u.u_name) as username,wm_concat(u.u_phototurl) as phototurl from t_usergroup_relation r, t_user u where r.g_id in ('" + queryParameter.Replace("^", "','") + "') and r.u_id = u.u_id and u.u_state = '1'"; if (whereClause != "") { sqlString += " and u.u_id in (" + whereClause + ") "; } resultDataTable = _iAccessData.Query(sqlString).Tables[0]; if (resultDataTable.Rows.Count > 0) { messageDic["userids"] = resultDataTable.Rows[0]["userid"].ToString().Replace(",", "^"); messageDic["usernames"] = resultDataTable.Rows[0]["username"].ToString().Replace(",", "^"); messageDic["phototurls"] = resultDataTable.Rows[0]["phototurl"].ToString().Replace(",", "^"); } } break; case "username": { sqlString = "select wm_concat(u.u_id) as userid,wm_concat(u.u_name) as username,wm_concat(u.u_phototurl) as phototurl from t_user u where u.u_name like '%" + queryParameter + "%' and u.u_state = '1'"; if (whereClause != "") { sqlString += " and u.u_id in (" + whereClause + ") "; } //sqlString += " and u.u_id in (select r.u_id from t_userrole_relation r where r.r_id='2019') "; resultDataTable = _iAccessData.Query(sqlString).Tables[0]; if (resultDataTable.Rows.Count > 0) { messageDic["userids"] = resultDataTable.Rows[0]["userid"].ToString().Replace(",", "^"); messageDic["usernames"] = resultDataTable.Rows[0]["username"].ToString().Replace(",", "^"); messageDic["phototurls"] = resultDataTable.Rows[0]["phototurl"].ToString().Replace(",", "^"); } } break; case "position": { sqlString = "select wm_concat(u.u_id) as userid, wm_concat(u.u_name) as username,wm_concat(u.u_phototurl) as phototurl from t_userposition_relation r, t_user u where r.p_id in ('" + queryParameter.Replace("^", "','") + "') and r.u_id = u.u_id and u.u_state = '1'"; if (whereClause != "") { sqlString += " and u.u_id in (" + whereClause + ") "; } resultDataTable = _iAccessData.Query(sqlString).Tables[0]; if (resultDataTable.Rows.Count > 0) { messageDic["userids"] = resultDataTable.Rows[0]["userid"].ToString().Replace(",", "^"); messageDic["usernames"] = resultDataTable.Rows[0]["username"].ToString().Replace(",", "^"); messageDic["phototurls"] = resultDataTable.Rows[0]["phototurl"].ToString().Replace(",", "^"); } } break; } resultDic["message"] = Eva.Library.Format.FormatEntityTool.FormatDicToJson(messageDic); resultDic["result"] = "true"; } catch (Exception ex) { resultDic["result"] = "false"; resultDic["message"] = Eva.Library.Format.FormatTextTool.ErrorMessageFormat(ex.Message + ex.StackTrace); } return(Eva.Library.Format.FormatEntityTool.FormatDicToJson(resultDic)); }
public string GetBaseCode(string clientInf) { Dictionary <string, string> resultDic = new Dictionary <string, string>(); resultDic["result"] = ""; resultDic["message"] = ""; try { _iAccessData = commonclass.commonclass.CreateIAccessData(); Dictionary <string, string> messageDic = new Dictionary <string, string>(); string appcode = Eva.Library.Configuration.ConfigurationManager.AppSettings["AppCode"].ToString(); string sqlString = ""; #region organ sqlString = " select o_fullname as text,o_id as id,o_nodeid as nodeid from t_organ where o_state = '1' order by o_nodeid"; DataTable organDataTable = _iAccessData.Query(sqlString).Tables[0]; string tempText = ""; string nodeid = ""; DataRow[] drs = null; foreach (DataRow dr in organDataTable.Rows) { tempText = dr["text"].ToString(); nodeid = dr["nodeid"].ToString(); while (nodeid.Length > 4) { nodeid = nodeid.Substring(0, nodeid.Length - 4); drs = organDataTable.Select("nodeid='" + nodeid + "'"); tempText = drs[0]["text"].ToString() + "-" + tempText; } dr["text"] = tempText; } messageDic["organ"] = Eva.Library.Format.FormatEntityTool.FormatDataTableToJson(organDataTable); #endregion #region role sqlString = "select r_name as text ,r_id as id from t_role where ( r_sys_appcode is null or r_sys_appcode = '" + appcode + "') and r_state = '1'"; DataTable roleDataTable = _iAccessData.Query(sqlString).Tables[0]; messageDic["role"] = Eva.Library.Format.FormatEntityTool.FormatDataTableToJson(roleDataTable); #endregion #region usergroup sqlString = "select g_name as text ,g_id as id from t_usergroup where ( g_sys_appcode is null or g_sys_appcode = '" + appcode + "') and g_state = '1'"; DataTable usergroupDataTable = _iAccessData.Query(sqlString).Tables[0]; messageDic["usergroup"] = Eva.Library.Format.FormatEntityTool.FormatDataTableToJson(usergroupDataTable); #endregion #region position sqlString = "select p_fullname as text ,p_id as id from t_position where ( p_sys_appcode is null or p_sys_appcode = '" + appcode + "') and p_state = '1'"; DataTable positionDataTable = _iAccessData.Query(sqlString).Tables[0]; messageDic["position"] = Eva.Library.Format.FormatEntityTool.FormatDataTableToJson(positionDataTable); #endregion resultDic["message"] = Eva.Library.Format.FormatEntityTool.FormatDicToJson(messageDic); resultDic["result"] = "true"; } catch (Exception ex) { resultDic["result"] = "false"; resultDic["message"] = Eva.Library.Format.FormatTextTool.ErrorMessageFormat(ex.Message + ex.StackTrace); } return(Eva.Library.Format.FormatEntityTool.FormatDicToJson(resultDic)); }
public string GetMeList(string value2String, string clientInf) { Dictionary <string, string> resultDic = new Dictionary <string, string>(); resultDic["result"] = ""; resultDic["message"] = ""; try { IDictionary <String, String> userInfDic = commonclass.commonclass.CheckClientInf(clientInf); if (userInfDic == null) { resultDic["result"] = "false"; resultDic["message"] = "客户端信息错误"; } else { string userIdString = userInfDic["userid"].ToString(); _iAccessData = commonclass.commonclass.CreateIAccessData(); string sqlString = ""; List <String> sectionCodeList = new List <string>(); string sectionNames = ""; string sectionValues = ""; Dictionary <String, String> sectionContentDic = new Dictionary <string, string>(); //===============获取用indexview节点下的全部字段 //==用户的全部字段 DataSet userFieldDataSet = sara.platform.service.auth.Service.GetUserFieldByUserid(userIdString); //找到meview根节点 string whereString8 = " ','+sys_appcode+',' like '%," + Eva.Library.Configuration.ConfigurationManager.AppSettings["AppCode"] + ",%' "; whereString8 += " and len(F_NODEID) = 8 "; whereString8 += " and f_value2 = '" + value2String + "'"; DataRow[] userFieldDataRow8 = userFieldDataSet.Tables[0].Select(whereString8);//应该只有一行数据 int hh = 0; for (int i = 0; i < userFieldDataRow8.Length; i++) { string whereString12 = " ','+sys_appcode+',' like '%," + Eva.Library.Configuration.ConfigurationManager.AppSettings["AppCode"] + ",%' "; whereString12 += " and len(F_NODEID) = 12 "; whereString12 += "and F_NODEID like '" + userFieldDataRow8[i]["F_NODEID"].ToString() + "%'"; //得到indexview下section节点 DataRow[] userFieldDataRow12 = userFieldDataSet.Tables[0].Select(whereString12); for (int j = 0; j < userFieldDataRow12.Length; j++) { string sectionCode = userFieldDataRow12[j]["f_value1"].ToString() + "_" + i.ToString() + j.ToString(); sectionCodeList.Add(sectionCode); sectionNames += userFieldDataRow12[j]["f_name"].ToString() + "^"; if (userFieldDataRow12[j]["f_value2"].ToString() == "") { sectionValues += "0^"; } else { sectionValues += userFieldDataRow12[j]["f_value2"].ToString() + "^"; } //读取16级子节点的f_value10的置, string whereString16 = " ','+sys_appcode+',' like '%," + Eva.Library.Configuration.ConfigurationManager.AppSettings["AppCode"] + ",%' "; whereString16 += " and len(F_NODEID) = 16 "; whereString16 += "and F_NODEID like '" + userFieldDataRow12[j]["F_NODEID"].ToString() + "%'"; //得到section下按钮节点 DataRow[] userFieldDataRow16 = userFieldDataSet.Tables[0].Select(whereString16); switch (userFieldDataRow12[j]["f_value1"].ToString()) { case "iconbutton0": case "iconbutton1": case "iconbuttontable": string iconButtonString = "["; for (int k = 0; k < userFieldDataRow16.Length; k++) { iconButtonString += "{"; iconButtonString += "\"title\":\"" + userFieldDataRow16[k]["f_name"].ToString() + "\","; iconButtonString += "\"icon\":\"" + userFieldDataRow16[k]["f_value10"].ToString() + "\","; iconButtonString += "\"value1\":\"" + userFieldDataRow16[k]["f_value1"].ToString() + "\","; iconButtonString += "\"value2\":\"" + userFieldDataRow16[k]["f_value2"].ToString() + "\","; iconButtonString += "\"badge\":\"\""; iconButtonString += "},"; } iconButtonString = iconButtonString.TrimEnd(','); iconButtonString += "]"; sectionContentDic[sectionCode] = iconButtonString; break; case "imgscroll0": case "imgscroll1": case "imgbutton0": case "imgbutton1": case "imgtext": //通过tbl_app_me构造数据 { string sys_ids = ""; List <String> value1Array = new List <string>(); List <String> value2Array = new List <string>(); for (int k = 0; k < userFieldDataRow16.Length; k++) { sys_ids += userFieldDataRow16[k]["f_value10"].ToString() + "^"; value1Array.Add(userFieldDataRow16[k]["f_value1"].ToString()); value2Array.Add(userFieldDataRow16[k]["f_value2"].ToString()); } sys_ids = sys_ids.TrimEnd('^'); sqlString = ""; sqlString += " select "; sqlString += GetColumnString(); sqlString += " from tbl_app_me n"; sqlString += " where 1 = 1"; sqlString += " and sys_id in ('" + sys_ids.Replace("^", "','") + "')"; DataTable dt = _iAccessData.Query(sqlString).Tables[0]; DataTable dtsort = dt.Copy(); dtsort.Clear(); string[] sys_idsArray = sys_ids.Split('^'); for (int m = 0; m < sys_idsArray.Length; m++) { for (int n = 0; n < dt.Rows.Count; n++) { hh += 1; if (dt.Rows[n]["indexid"].ToString() == sys_idsArray[m]) { dt.Rows[n]["value1"] = value1Array[m]; dt.Rows[n]["value2"] = value2Array[m]; dtsort.Rows.Add(dt.Rows[n].ItemArray); break; } } } //重新计算顺序 //==================== string sectionContentString = Eva.Library.Format.FormatEntityTool.FormatDataTableToJson(dtsort); sectionContentDic[sectionCode] = sectionContentString; } break; } } } string sectionCodes = ""; for (int i = 0; i < sectionCodeList.Count; i++) { sectionCodes += sectionCodeList[i].ToString() + "^"; } string sectionCount = sectionCodeList.Count.ToString(); string message = "{"; message += "\"sectionNames\":\"" + sectionNames.Substring(0, sectionNames.Length - 1) + "\",";//解决名字全部为空的问题,所以不能用TrimEnd message += "\"sectionCodes\":\"" + sectionCodes.TrimEnd('^') + "\","; message += "\"sectionValues\":\"" + sectionValues.TrimEnd('^') + "\","; message += "\"sectionCount\":\"" + sectionCount + "\","; for (int i = 0; i < sectionCodeList.Count; i++) { message += "\"" + sectionCodeList[i].ToString() + "\":" + sectionContentDic[sectionCodeList[i].ToString()].ToString() + ","; } message = message.TrimEnd(','); message += "}"; resultDic["result"] = "true"; resultDic["message"] = message; } } catch (Exception ex) { resultDic["result"] = "error"; resultDic["message"] = Eva.Library.Format.FormatTextTool.ErrorMessageFormat(ex.Message + ex.StackTrace); } return(Eva.Library.Format.FormatEntityTool.FormatDicToJson(resultDic)); }
public string GetNewsList(string whereString, string orderByString, string columnsString, string countString, string stepString, string clientInf) { Dictionary <string, string> resultDic = new Dictionary <string, string>(); resultDic["result"] = ""; resultDic["message"] = ""; try { IDictionary <String, String> userInfDic = commonclass.commonclass.CheckClientInf(clientInf); if (userInfDic == null) { resultDic["result"] = "false"; resultDic["message"] = "客户端信息错误"; } else { string userIdString = userInfDic["userid"].ToString(); _iAccessData = commonclass.commonclass.CreateIAccessData(); string sqlString = ""; #region rows sqlString = ""; sqlString += " select * "; sqlString += " from(select a.*, rownum as rn"; sqlString += " from("; sqlString += " select "; sqlString += GetColumnString(userIdString); sqlString += " from tbl_app_news n"; sqlString += " where "; sqlString += GetWhereString(userIdString, whereString); sqlString += " order by "; if (orderByString == "")//默认按照序号倒叙 { sqlString += " to_number(sys_orderid) desc "; } sqlString += " ) a) b"; if (countString != "" && stepString != "") { sqlString += " where b.rn > '" + countString + "'"; sqlString += " and b.rn <= '" + (int.Parse(countString) + int.Parse(stepString)).ToString() + "'"; } DataSet ds = _iAccessData.Query(sqlString); string rows = Eva.Library.Format.FormatEntityTool.FormatDataTableToJson(ds.Tables[0]); #endregion #region count sqlString = ""; sqlString += " select count(*)"; sqlString += " from tbl_app_news n"; sqlString += " where "; sqlString += GetWhereString(userIdString, whereString); string total = _iAccessData.GetSingle(sqlString).ToString(); #endregion string message = "{\"total\":\"" + total + "\",\"rows\":" + rows + "}"; resultDic["result"] = "true"; resultDic["message"] = message; } } catch (Exception ex) { resultDic["result"] = "error"; resultDic["message"] = Eva.Library.Format.FormatTextTool.ErrorMessageFormat(ex.Message + ex.StackTrace); } return(Eva.Library.Format.FormatEntityTool.FormatDicToJson(resultDic)); }
///// <summary> ///// 启动流程方法 ///// </summary> ///// <param name="sys_id"></param> ///// <param name="sys_processinsid"></param> ///// <param name="selectusernames"></param> ///// <param name="_ds_facter"></param> ///// <param name="str_shyj"></param> ///// <param name="processdefid"></param> ///// <param name="facterid"></param> ///// <param name="clientInf"></param> ///// <param name="t"></param> ///// <returns></returns> //public string set_startworkflow(string sys_id, string sys_processinsid, string selectusernames, DataSet _ds_facter, string str_shyj, string processdefid, string facterid, string clientInf, Eva.Library.Data.AccessDataTrans.IAccessDataTrans t) //{ // string result = ""; // NameValueCollection nvc_maintableparameters = new NameValueCollection(); // nvc_maintableparameters.Add("sys_processnextuser", selectusernames); // nvc_maintableparameters.Add("sys_processinsid", sys_processinsid); // nvc_maintableparameters.Add("processdefid", processdefid); // nvc_maintableparameters.Add("fk_tbl_maintable_sys_id", "^null"); // result = _hic.NextStateItemNew(sys_id, nvc_maintableparameters, facterid, _ds_facter, str_shyj, sys_processinsid, "", clientInf, t); // return result; // //if (result == "") // //{ // // #region businesscode // // //根据WorkFlowUserControl1.WF_ProcessDefid可以识别业务程序进行业务代码编写 // // #endregion // //} //} #endregion #region 工作流转件 /// <summary> /// 验证是不是能转件 /// </summary> /// <param name="workitemid"></param> /// <param name="str_resultmessage"></param> /// <param name="clientInf"></param> /// <returns>//[sys_id]$[fk_workflow_sys_id]$[selectusernames]$[ds_facter]$[str_shyj]$[processinsid]$[businessparm]$[processdefid]$[facterid]$[trans]</returns> public string get_sendworkflow(string workitemid, ref string str_resultmessage, string clientInf) { string result = ""; try { IDictionary <string, string> clientInfoDic = Eva.Library.Format.FormatEntityTool.FormatJsonToDic(clientInf); string userid = clientInfoDic["userid"]; string username = clientInfoDic["username"]; Eva.Library.ServiceAdapter.IAdapter.IWorkFlow w = Eva.Library.ServiceAdapter.AdapterFactory.WorkFlowFactory.CreateService(Eva.Library.Configuration.ConfigurationManager.AppSettings["AppCode"]); DataSet useroperation = null; string shyj = ""; if (sara.dd.ldsw.commonclass.commonclass.GetPlatformServiceModel() == "dll") { shyj = sara.platform.service.workflow.Service.GetUserOperationSHYJ(workitemid); } else { shyj = w.GetUserOperationSHYJ(workitemid); } if (shyj == "-1") { if (sara.dd.ldsw.commonclass.commonclass.GetPlatformServiceModel() == "dll") { useroperation = sara.platform.service.workflow.Service.GetUserOperation(workitemid, userid, username, DateTime.Now); } else { useroperation = w.GetUserOperation(workitemid, userid, username, DateTime.Now); } } else { DataSet ds_old; if (sara.dd.ldsw.commonclass.commonclass.GetPlatformServiceModel() == "dll") { ds_old = sara.platform.service.workflow.Service.GetUserOperationCZNR(workitemid); } else { ds_old = w.GetUserOperationCZNR(workitemid); } if (ds_old == null || ds_old.Tables.Count == 0) { if (sara.dd.ldsw.commonclass.commonclass.GetPlatformServiceModel() == "dll") { useroperation = sara.platform.service.workflow.Service.GetUserOperation(workitemid, userid, username, DateTime.Now); } else { useroperation = w.GetUserOperation(workitemid, userid, username, DateTime.Now); } } else { useroperation = ds_old; } } #region businesscode //在此处添加业务代码,可以控制默认选中哪个tab页,那条连接线,哪个用户 //具体规则如下: //1、在datarow["Iselected"]中,设置0表示连接线被选中,设置-1表示连接线没有被选中 //2、在datarow["userids"]\datarow["usernames"]中存放着备选用户的id和name,以小写逗号分割,例如: //datarow["userids"] = "1,2";datarow["usernames"] = "张三,李四" //此时程序会自动选中这2个用户,在id和names前边加“-”,则不会被选中,例如: //datarow["userids"] = "-1,2";datarow["usernames"] = "-张三,李四" //则李四默认会被选中,张三默认不会被选中 //3、可以调整1,2的顺序,实现对审核顺序的调整,(如果当前节点的jdnyh!=1,并且节点类型是串行的话) //4、在1个useroperation中会存在多个连接线(多个datarow),当某个datarow的iselected=+0时,该连接线所在的页会默认被打开 //如果不设置+号的话,则默认打开第一个0的连接线所在的页。 //一个useroperation中只能有一个+0,否则按照最先一个+0计算。 //传过来的数据里边,默认用户都是被选中的,连接线也是被选中的。 for (int i = 0; i < useroperation.Tables[0].Rows.Count; i++) { //新增水表_居民//业务代码,转给经办人时,默认转给发起的经办人 if (useroperation.Tables[0].Rows[i]["fk_dy_jd_sys_id_to"].ToString() == "540004020") { string lcslid = useroperation.Tables[0].Rows[i]["fk_sl_lc_sys_id"].ToString(); string sql = "select czrid,czrname from t_workitem where fk_sl_lc_sys_id = '" + lcslid + "' and fk_dy_jd_sys_id = '540004000'"; DataSet dsczr = _iAccessData.Query(sql); if (dsczr.Tables[0].Rows.Count > 0) { string czrid = dsczr.Tables[0].Rows[0]["czrid"].ToString(); string czrname = dsczr.Tables[0].Rows[0]["czrname"].ToString(); string[] oldUserIdArray = useroperation.Tables[0].Rows[i]["userids"].ToString().Split(','); string[] oldUserNameArray = useroperation.Tables[0].Rows[i]["usernames"].ToString().Split(','); string newUserIds = ""; string newUserNames = ""; for (int ii = 0; ii < oldUserIdArray.Length; ii++) { if (oldUserIdArray[ii] == czrid) { newUserIds += oldUserIdArray[ii] + ","; newUserNames += oldUserNameArray[ii] + ","; } else { newUserIds += "-" + oldUserIdArray[ii] + ","; newUserNames += "-" + oldUserNameArray[ii] + ","; } } useroperation.Tables[0].Rows[i]["userids"] = newUserIds.TrimEnd(','); useroperation.Tables[0].Rows[i]["usernames"] = newUserNames.TrimEnd(','); } } } #endregion str_resultmessage = Eva.Library.Format.FormatEntityTool.FormatDataTableToJson(useroperation.Tables[0]); } catch (Exception ex) { result = Eva.Library.Format.FormatTextTool.ErrorMessageFormat(ex.Message + ex.StackTrace); } return(result); }
public string GetNewsContentType1(string newsIdString, string clientInf) { Dictionary <string, string> resultDic = new Dictionary <string, string>(); resultDic["result"] = ""; resultDic["message"] = ""; //string newsIdString = "11"; //string clientInf = "{\"userid\":\"1280\",\"devicetype\":\"ios\"}"; try { IDictionary <String, String> userInfDic = commonclass.commonclass.CheckClientInf(clientInf); if (userInfDic == null) { resultDic["result"] = "false"; resultDic["message"] = "客户端信息错误"; } else { _iAccessData = commonclass.commonclass.CreateIAccessData(); string userIdString = userInfDic["userid"].ToString(); string sqlString = ""; sqlString += " select "; //创建人头像 sqlString += " f_value1 as creatuserimg,"; //创建人 sqlString += " sys_lasteditusername as creatusername,"; //标题 sqlString += " f_title as title,"; //简述 sqlString += " f_resume as resume,"; //新闻类型 sqlString += " f_newstype as newstype,"; //评论数 sqlString += " (select count(*) from tbl_app_news_discuss where fk_tbl_app_news_sys_id = n.sys_id ) as discusscount,"; //点赞数 sqlString += " (select count(*) from tbl_app_news_like where fk_tbl_app_news_sys_id = n.sys_id and f_liketypeid = '1' ) as likecount,"; //不赞数 sqlString += " (select count(*) from tbl_app_news_like where fk_tbl_app_news_sys_id = n.sys_id and f_liketypeid = '2' ) as unlikecount,"; if (userIdString == "") { sqlString += " 'false' as isliked,"; sqlString += " 'false' as isunliked,"; } else { //用户是否点赞 sqlString += " (select decode( count(*),0,'false','true') from tbl_app_news_like where fk_tbl_app_news_sys_id = n.sys_id and fk_t_user_id = '" + userIdString + "' and f_liketypeid = '1' ) as isliked,"; //用户是否不赞 sqlString += " (select decode( count(*),0,'false','true') from tbl_app_news_like where fk_tbl_app_news_sys_id = n.sys_id and fk_t_user_id = '" + userIdString + "' and f_liketypeid = '2' ) as isunliked,"; } if (userIdString == "") { //是否可以评论 sqlString += " 'false' as iscandiscuss,"; } else { //是否可以评论 //sqlString += " (select decode(decode(count(*), 0, 'false', 'true') || '_' || f_isdiscuss, 'true_true', 'true', 'false') from t_usergroup_relation ugr where ugr.u_id = '" + userIdString + "' and ','||n.f_discussrangeid||',' like '%,'||ugr.g_id||',%' and ugr.g_id = '" + _usergroup107 + "' ) as iscandiscuss,"; sqlString += " decode( f_checknewsdiscuss('" + userIdString + "',f_discussrangeid)||f_isdiscuss,'truetrue','true','false') as iscandiscuss, "; } //发布时间 sqlString += " f_releasedate as releasedate,"; //发布时间2 sqlString += " f_timedifferent(f_releasedate) as timedifferent, "; //新闻内容 sqlString += " f_content as content, "; //标签 sqlString += " f_tag as tag"; sqlString += " from tbl_app_news n "; sqlString += " where sys_id = '" + newsIdString + "' "; DataTable dt = _iAccessData.Query(sqlString).Tables[0]; string content1rows = Eva.Library.Format.FormatEntityTool.FormatDataTableToJson(dt); sqlString = ""; sqlString += " select newsid, title, contenttypeid from( "; if (dt.Rows.Count > 0) { string[] tagArray = dt.Rows[0]["tag"].ToString().Split(' '); for (int i = 0; i < tagArray.Length; i++) { sqlString += " ( "; sqlString += " select newsid, title, contenttypeid from "; sqlString += " ( "; sqlString += " select sys_id as newsid, f_title as title,"; sqlString += " f_contenttypeid as contenttypeid "; sqlString += " from tbl_app_news where sys_id !='" + newsIdString + "' and f_tag like '%" + tagArray[i].ToString() + "%' and f_contenttypeid in ('1','2') order by to_number(sys_orderid) desc "; sqlString += " ) "; sqlString += " where rownum = 1 "; sqlString += " ) "; if (i != tagArray.Length - 1) { sqlString += " union all "; } } } sqlString += " ) "; string tagrows = Eva.Library.Format.FormatEntityTool.FormatDataTableToJson(_iAccessData.Query(sqlString).Tables[0]); resultDic["result"] = "true"; resultDic["message"] = "{\"content1rows\":" + content1rows + ",\"tagrows\":" + tagrows + "}"; } } catch (Exception ex) { resultDic["result"] = "error"; resultDic["message"] = Eva.Library.Format.FormatTextTool.ErrorMessageFormat(ex.Message + ex.StackTrace); } return(Eva.Library.Format.FormatEntityTool.FormatDicToJson(resultDic)); }
public void ProcessRequest(HttpContext context) { try { //string method = System.Web.HttpContext.Current.Request.HttpMethod; //string type = System.Web.HttpContext.Current.Request.RequestType; //NameValueCollection nvc = System.Web.HttpContext.Current.Request.Params; //string[] paramss = nvc.AllKeys; Stream s = System.Web.HttpContext.Current.Request.InputStream; byte[] b = new byte[s.Length]; s.Read(b, 0, (int)s.Length); //string xmlstr = UTF8Encoding.UTF8.GetString(b); string xmlstr = System.Text.Encoding.GetEncoding("gbk").GetString(b); if (xmlstr != null && xmlstr != "") { xmlstr = xmlstr.TrimEnd('0'); XmlDocument document = new XmlDocument(); document.LoadXml(xmlstr); //交易码 string FTranCode = ""; //公缴单位分配机构号 string InstID = ""; //交易日期时间 string TranDateTime = ""; //银行端系统流水号 string BankNum = ""; //客户编号 string billKey = ""; ////起始笔数 //string beginNum = ""; ////查询笔数 //string queryNum = ""; FTranCode = document.GetElementsByTagName("FTranCode")[0].InnerText; InstID = document.GetElementsByTagName("InstID")[0].InnerText; TranDateTime = document.GetElementsByTagName("TranDateTime")[0].InnerText; BankNum = document.GetElementsByTagName("BankNum")[0].InnerText; billKey = document.GetElementsByTagName("billKey")[0].InnerText; //beginNum = document.GetElementsByTagName("beginNum")[0].InnerText; //queryNum = document.GetElementsByTagName("queryNum")[0].InnerText; _iAccessData = commonclass.commonclass.CreateIAccessData(); //DataTable khdt = _iAccessData.Query("SELECT * FROM TBL_LD_KHB WHERE F_KHBH='" + billKey + "' and f_cbbh not like 'PZ%' and f_cbbh not like 'YC%'").Tables[0]; DataTable khdt = _iAccessData.Query("SELECT * FROM TBL_LD_KHB WHERE F_KHBH='" + billKey + "'").Tables[0]; if (billKey.Length == 10 && khdt.Rows.Count == 1) { DataRow khdr = khdt.Rows[0]; //判断是否在代扣中并判断是否存在疫情减免 if ((khdr["f_value5"] != null && khdr["f_value5"].ToString() != "") || (khdr["f_yqjmsf"] != null && khdr["f_yqjmsf"].ToString() != "" && khdr["f_yqjmsf"].ToString() != "0") || (khdr["f_yqjmpwf"] != null && khdr["f_yqjmpwf"].ToString() != "" && khdr["f_yqjmpwf"].ToString() != "0")) { //代扣中返回错误报文 string errxml = "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>"; errxml += "<Out>"; errxml += "<Head>"; errxml += "<FTranCode>" + FTranCode + "</FTranCode>"; errxml += "<InstID>" + InstID + "</InstID>"; errxml += "<TranDateTime>" + TranDateTime + "</TranDateTime>"; errxml += "<BankNum>" + BankNum + "</BankNum>"; errxml += "<AnsCode>ERR0000</AnsCode>"; errxml += "</Head>"; errxml += "<Body>"; errxml += "<ErrorCode>DEF0018</ErrorCode>"; errxml += "<ErrorInfo></ErrorInfo>"; errxml += "</Body>"; errxml += "</Out>"; context.Response.ContentType = "text/xml"; context.Response.Charset = "gbk"; context.Response.ContentEncoding = System.Text.Encoding.GetEncoding("gbk"); context.Response.Write(errxml); } else { bool flag = true; //判断大用户超过两期未缴费 if (khdr["f_khfz"].ToString().Contains("大用户")) { DataTable cbdt = _iAccessData.Query("SELECT * FROM TBL_LD_CBIAO WHERE F_KHBH='" + billKey + "' AND F_ZTID='2' and f_cbsj < ADD_MONTHS(sysdate,-2)").Tables[0]; if (cbdt.Rows.Count > 0) { //代扣中返回错误报文 string errxml = "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>"; errxml += "<Out>"; errxml += "<Head>"; errxml += "<FTranCode>" + FTranCode + "</FTranCode>"; errxml += "<InstID>" + InstID + "</InstID>"; errxml += "<TranDateTime>" + TranDateTime + "</TranDateTime>"; errxml += "<BankNum>" + BankNum + "</BankNum>"; errxml += "<AnsCode>ERR0000</AnsCode>"; errxml += "</Head>"; errxml += "<Body>"; errxml += "<ErrorCode>DEF0021</ErrorCode>"; errxml += "<ErrorInfo></ErrorInfo>"; errxml += "</Body>"; errxml += "</Out>"; context.Response.ContentType = "text/xml"; context.Response.Charset = "gbk"; context.Response.ContentEncoding = System.Text.Encoding.GetEncoding("gbk"); context.Response.Write(errxml); flag = false; } } if (flag) { DataTable dt = _iAccessData.Query("SELECT NVL(F_LJQF,0) as f_ljqf,f_yhm,f_hth ,f_ye,f_dz FROM TBL_LD_KHB WHERE F_KHBH='" + billKey + "'").Tables[0]; double ljqf = Eva.Library.Text.NumberTool.Parse(dt.Rows[0]["f_ljqf"].ToString()); double ye = Eva.Library.Text.NumberTool.Parse(dt.Rows[0]["f_ye"].ToString()); ljqf = ljqf - ye; if (ljqf <= 0) { //错误报文 用户未欠费 string errxml = "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>"; errxml += "<Out>"; errxml += "<Head>"; errxml += "<FTranCode>" + FTranCode + "</FTranCode>"; errxml += "<InstID>" + InstID + "</InstID>"; errxml += "<TranDateTime>" + TranDateTime + "</TranDateTime>"; errxml += "<BankNum>" + BankNum + "</BankNum>"; errxml += "<AnsCode>ERR0000</AnsCode>"; errxml += "</Head>"; errxml += "<Body>"; errxml += "<ErrorCode>DEF0002</ErrorCode>"; errxml += "<ErrorInfo></ErrorInfo>"; errxml += "</Body>"; errxml += "</Out>"; context.Response.ContentType = "text/xml"; context.Response.Charset = "gbk"; context.Response.ContentEncoding = System.Text.Encoding.GetEncoding("gbk"); context.Response.Write(errxml); } else { string resultxml = "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>"; resultxml += "<Out>"; resultxml += "<Head>"; resultxml += "<FTranCode>" + FTranCode + "</FTranCode>"; resultxml += "<InstID>" + InstID + "</InstID>"; resultxml += "<TranDateTime>" + TranDateTime + "</TranDateTime>"; resultxml += "<BankNum>" + BankNum + "</BankNum>"; resultxml += "<AnsCode>AAAAAAA</AnsCode>"; resultxml += "</Head>"; resultxml += "<Body>"; resultxml += "<companyNo>" + Eva.Library.Text.NumberTool.GetNoRepeatNumber() + "</companyNo>"; resultxml += "<billKey>" + billKey + "</billKey>"; resultxml += "<item1></item1>"; resultxml += "<item2></item2>"; resultxml += "<item3></item3>"; resultxml += "<item4></item4>"; resultxml += "<item5></item5>"; resultxml += "<item6></item6>"; resultxml += "<item7>" + dt.Rows[0]["f_dz"] + "</item7>"; resultxml += "<reserve1></reserve1>"; resultxml += "<reserve2></reserve2>"; resultxml += "<reserve3></reserve3>"; resultxml += "<reserve4></reserve4>"; resultxml += "<reserve5></reserve5>"; resultxml += "<reserve6></reserve6>"; resultxml += "<reserve7></reserve7>"; resultxml += "<reserve8></reserve8>"; resultxml += "<reserve9></reserve9>"; resultxml += "<reserve10></reserve10>"; resultxml += "<reserve11></reserve11>"; resultxml += "<reserve12></reserve12>"; resultxml += "<reserve13></reserve13>"; resultxml += "<reserve14></reserve14>"; resultxml += "<reserve15></reserve15>"; resultxml += "<reserve16></reserve16>"; resultxml += "<reserve17></reserve17>"; resultxml += "<reserve18></reserve18>"; resultxml += "<totalNum>1</totalNum>"; resultxml += "<Frame>"; resultxml += "<contractNo>" + dt.Rows[0]["f_hth"] + "</contractNo>"; resultxml += "<customerName>" + dt.Rows[0]["f_yhm"] + "</customerName>"; resultxml += "<balance>0</balance>"; resultxml += "<payAmount>" + ljqf + "</payAmount>"; resultxml += "<beginDate></beginDate>"; resultxml += "<endDate></endDate>"; resultxml += "<detailFiled1></detailFiled1>"; resultxml += "<detailFiled2></detailFiled2>"; resultxml += "<detailFiled3></detailFiled3>"; resultxml += "<detailFiled4></detailFiled4>"; resultxml += "<detailFiled5>" + dt.Rows[0]["f_dz"] + "</detailFiled5>"; resultxml += "</Frame>"; resultxml += "</Body>"; resultxml += "</Out>"; //context.Response.ContentType = "text/plain"; context.Response.ContentType = "text/xml"; context.Response.ContentEncoding = System.Text.Encoding.GetEncoding("gbk"); context.Response.Charset = "gbk"; context.Response.Write(resultxml); } } } } else { //错误报文 错误的客户编号 string errxml = "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>"; errxml += "<Out>"; errxml += "<Head>"; errxml += "<FTranCode>" + FTranCode + "</FTranCode>"; errxml += "<InstID>" + InstID + "</InstID>"; errxml += "<TranDateTime>" + TranDateTime + "</TranDateTime>"; errxml += "<BankNum>" + BankNum + "</BankNum>"; errxml += "<AnsCode>ERR0000</AnsCode>"; errxml += "</Head>"; errxml += "<Body>"; errxml += "<ErrorCode>DEF0010</ErrorCode>"; errxml += "<ErrorInfo>错误的客户编号</ErrorInfo>"; errxml += "</Body>"; errxml += "</Out>"; context.Response.ContentType = "text/xml"; context.Response.Charset = "gbk"; context.Response.ContentEncoding = System.Text.Encoding.GetEncoding("gbk"); context.Response.Write(errxml); } } } catch (System.Exception ex) { //错误报文 错误的客户编号 string errxml = "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>"; errxml += "<Out>"; errxml += "<Head>"; errxml += "<FTranCode></FTranCode>"; errxml += "<InstID></InstID>"; errxml += "<TranDateTime></TranDateTime>"; errxml += "<BankNum></BankNum>"; errxml += "<AnsCode>ERR0000</AnsCode>"; errxml += "</Head>"; errxml += "<Body>"; errxml += "<ErrorCode>DEF0001</ErrorCode>"; errxml += "<ErrorInfo>" + ex.ToString() + "</ErrorInfo>"; errxml += "</Body>"; errxml += "</Out>"; context.Response.ContentType = "text/xml"; context.Response.Charset = "gbk"; context.Response.ContentEncoding = System.Text.Encoding.GetEncoding("gbk"); context.Response.Write(errxml); } }