示例#1
0
        public string CheckResource(string sysIdString, string clientInf)
        {
            Dictionary <string, string> resultDic = new Dictionary <string, string>();

            resultDic["result"]  = "";
            resultDic["message"] = "";
            try
            {
                Eva.Library.Data.AccessData.IAccessData _iAccessData = Eva.Library.Data.AccessData.AccessDataFactory.CreateDataAccess(DataBaseType.oracledal, Eva.Library.Configuration.ConfigurationManager.AppSettings["DataBaseConnectionString"].ToString());

                string maxSize       = "500000";
                string titleString   = "";
                string contentString = "";

                string sqlString = "";
                sqlString += " select wm_concat(replace(filerealname, ' ', ',')) from tbl_file_content where menuid in ";
                sqlString += " (";
                sqlString += " select f_titleresource from tbl_app_news where sys_id = '" + sysIdString + "'";
                sqlString += " )";
                sqlString += " and filesize > " + maxSize;
                object o = _iAccessData.GetSingle(sqlString);

                if (o != null)
                {
                    if (o.ToString() != "")
                    {
                        titleString = o.ToString();
                    }
                }

                sqlString  = "";
                sqlString += " select wm_concat(replace(filerealname, ' ', ',')) from tbl_file_content where menuid in ";
                sqlString += " (";
                sqlString += " select f_contentresource from tbl_app_news where sys_id = '" + sysIdString + "'";
                sqlString += " )";
                sqlString += " and filesize > " + maxSize;
                o          = _iAccessData.GetSingle(sqlString);

                if (o != null)
                {
                    if (o.ToString() != "")
                    {
                        contentString = o.ToString();
                    }
                }

                string result = "{\"title\":\"" + titleString + "\",\"content\":\"" + contentString + "\"}";

                resultDic["result"]  = "true";
                resultDic["message"] = result;
            }
            catch (Exception ex)
            {
                resultDic["result"]  = "false";
                resultDic["message"] = Eva.Library.Format.FormatTextTool.ErrorMessageFormat(ex.Message + ex.StackTrace);

                NewLog("查询Tags:异常信息:" + Eva.Library.Format.FormatTextTool.ErrorMessageFormat(ex.Message + ex.StackTrace), "sql_select", clientInf);
            }
            return(Eva.Library.Format.FormatEntityTool.FormatDicToJson(resultDic));
        }
        public string GetShpidString(string sysIdString, string clientInf)
        {
            Dictionary <string, string> resultDic = new Dictionary <string, string>();

            resultDic["result"]  = "";
            resultDic["message"] = "";
            try
            {
                string shpidString = "";
                string sqlString   = " select distinct(m.shpid) from tbl_maintable m,up_shape_dl s";
                sqlString += " where m.shpid = s.sys_shpid";
                sqlString += " and m.sys_id = '" + sysIdString + "'";
                Eva.Library.Data.AccessData.IAccessData _iAccessData = commonclass.commonclass.CreateIAccessData();
                object o = _iAccessData.GetSingle(sqlString);
                if (o != null)
                {
                    shpidString = o.ToString();
                }
                resultDic["result"]  = "true";
                resultDic["message"] = shpidString;
                NewLog("shpid查询成功,sys_id为:" + sysIdString, "sql_select", clientInf);
            }
            catch (Exception ex)
            {
                resultDic["result"]  = "false";
                resultDic["message"] = Eva.Library.Format.FormatTextTool.ErrorMessageFormat(ex.Message + ex.StackTrace);
                NewLog("shpid查询成功,sys_id为:" + sysIdString + ",异常信息:" + Eva.Library.Format.FormatTextTool.ErrorMessageFormat(ex.Message + ex.StackTrace), "sql_select", clientInf);
            }
            return(Eva.Library.Format.FormatEntityTool.FormatDicToJson(resultDic));
        }
        public string Export(string whereString, string orderByString, string column, string columnname, string clientInf)
        {
            Dictionary <string, string> resultDic = new Dictionary <string, string>();

            resultDic["result"]  = "";
            resultDic["message"] = "";
            _iAccessData         = sara.dd.ldsw.commonclass.commonclass.CreateIAccessData();
            try
            {
                IDictionary <string, string> clientInfoDic = Eva.Library.Format.FormatEntityTool.FormatJsonToDic(clientInf);
                //string sql = "select " + column;
                //sql += " from tbl_ld_jmb";
                //sql += " where" + whereString + "";
                //DataTable dt = _iAccessData.Query(sql).Tables[0];
                DataTable dt = _idal_tbl_ld_jmb.GetDataTableForPC(whereString, orderByString, column, "", "", null);

                string file = report.ReportExcel(dt, column, columnname);
                resultDic["result"]  = "true";
                resultDic["message"] = file;
            }
            catch (Exception ex)
            {
                resultDic["result"]  = "false";
                resultDic["message"] = Eva.Library.Format.FormatTextTool.ErrorMessageFormat(ex.Message + ex.StackTrace);
            }
            return(Eva.Library.Format.FormatEntityTool.FormatDicToJson(resultDic));
        }
示例#4
0
        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]));
        }
示例#5
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));
        }
示例#6
0
        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));
        }
示例#7
0
        public string Update(string json, string columns, string clientInf)
        {
            Dictionary <string, string> resultDic = new Dictionary <string, string>();

            resultDic["result"]  = "";
            resultDic["message"] = "";
            try
            {
                _iAccessData = sara.dd.ldsw.commonclass.commonclass.CreateIAccessData();
                sara.dd.ldsw.model.tbl_ldbm_expdata model = Eva.Library.Format.FormatEntityTool.FormatJsonToModel <sara.dd.ldsw.model.tbl_ldbm_expdata>(json);
                model.sys_lasteditdate = DateTime.Now;
                columns = FormatColumns(columns).Replace("^", ",");
                if (model.f_khbh != "")
                {
                    string sql = "select wm_concat(sys_id) from tbl_ld_khb where f_khbh in (" + model.f_khbh + ")";
                    model.f_khbhid = _iAccessData.GetSingle(sql).ToString();
                }
                else
                {
                    model.f_khbhid = "";
                }
                resultDic["result"]  = "true";
                resultDic["message"] = _idal_tbl_ldbm_expdata.Update(model, columns, null);

                NewLog("数据更新成功,更新的数据为:json:" + json + ",columns:" + columns, "sql_update", clientInf);
            }
            catch (Exception ex)
            {
                resultDic["result"]  = "false";
                resultDic["message"] = Eva.Library.Format.FormatTextTool.ErrorMessageFormat(ex.Message + ex.StackTrace);

                NewLog("数据更新失败,更新的数据为:json:" + json + ",columns:" + columns + ",异常信息:" + Eva.Library.Format.FormatTextTool.ErrorMessageFormat(ex.Message + ex.StackTrace), "sql_update", clientInf);
            }
            return(Eva.Library.Format.FormatEntityTool.FormatDicToJson(resultDic));
        }
示例#8
0
        public string AddAndroidAppLog(string message, string clientInf)
        {
            Dictionary <string, string> resultDic = new Dictionary <string, string>();

            resultDic["result"]  = "";
            resultDic["message"] = "";
            try
            {
                _iAccessData = commonclass.commonclass.CreateIAccessData();

                if (message.Length > 2100)
                {
                    message = message.Substring(message.Length - 2100);
                }

                string sqlString = "insert into TBL_ANDROIDAPP_LOG (sys_id, message, clientinfo, sys_creatdate, value1, value2, value3, value4, value5)";
                sqlString += "values ((select nvl(max(sys_id),0)+1 from TBL_ANDROIDAPP_LOG), '" + message + "', '" + clientInf + "', sysdate, '', '', '', '', '')";

                _iAccessData.ExecuteSql(sqlString);

                resultDic["result"]  = "true";
                resultDic["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));
        }
示例#9
0
        public string GetUserLoginNameCount(string userLoginNameString, 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
                {
                    Eva.Library.Data.AccessData.IAccessData ia = commonclass.commonclass.CreateIAccessData();

                    string sql   = "select count(*) from t_user where u_code = '" + userLoginNameString + "'";
                    string count = ia.GetSingle(sql).ToString();
                    resultDic["result"]  = "true";
                    resultDic["message"] = count;
                }
            }
            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 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));
        }
示例#12
0
        public string GetCodeResource(string appVersionString, string codeVersionString, 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.1";


                    #region 读取最新版本号
                    _iAccessData = commonclass.commonclass.CreateIAccessData();
                    string sqlString = "select f_codeversion from tbl_app_version  where f_apptypeid = '" + userInfDic["devicetype"] + "' and f_appversion = '" + appVersionString + "'";
                    object o         = _iAccessData.GetSingle(sqlString);
                    if (o != null)
                    {
                        currentVersion = o.ToString();
                    }
                    #endregion

                    if (currentVersion != codeVersionString)
                    {
                        Dictionary <string, string> htmlResourceDic = new Dictionary <string, string>();
                        htmlResourceDic["version"] = currentVersion;
                        htmlResourceDic["content"] = Eva.Library.Format.FormatEntityTool.FormatDicToJson(GetCode("sara.dd.ldsw"));

                        string htmlResourceString = Eva.Library.Format.FormatEntityTool.FormatDicToJson(htmlResourceDic);

                        resultDic["result"]  = "true";
                        resultDic["message"] = htmlResourceString;
                    }
                    else
                    {
                        Dictionary <string, string> htmlResourceDic = new Dictionary <string, string>();
                        htmlResourceDic["version"] = currentVersion;
                        htmlResourceDic["content"] = "";

                        string htmlResourceString = Eva.Library.Format.FormatEntityTool.FormatDicToJson(htmlResourceDic);
                        resultDic["result"]  = "true";
                        resultDic["message"] = htmlResourceString;
                    }
                }
            }
            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 Delete(string whereString, string clientInf)
        {
            Dictionary <string, string> resultDic = new Dictionary <string, string>();

            resultDic["result"]  = "";
            resultDic["message"] = "";
            try
            {
                //删除附件的功能
                string fileIDs       = "";
                string columnsString = "";

                columnsString += "f_drwj,";

                columnsString += "f_bcfj,";

                columnsString += "f_lcfj,";

                columnsString = columnsString.TrimEnd(',');
                List <sara.dd.ldsw.model.tbl_ld_xgsbds> l_tbl_ld_xgsbds = _idal_tbl_ld_xgsbds.GetList(whereString, "", columnsString, "", "", null);
                foreach (sara.dd.ldsw.model.tbl_ld_xgsbds model in l_tbl_ld_xgsbds)
                {
                    fileIDs += model.f_drwj + ",";

                    fileIDs += model.f_bcfj + ",";

                    fileIDs += model.f_lcfj + ",";
                }
                fileIDs = fileIDs.TrimEnd(',');
                sara.dd.ldsw.commonclass.filecontrol.deleteByFileName(fileIDs, null);

                //删除子表的方法
                _iAccessData = sara.dd.ldsw.commonclass.commonclass.CreateIAccessData();
                string sqlString = "";

                sqlString = "delete from tbl_ld_xgsbdszb where fk_tbl_ld_xgsbds_sys_id in (select sys_id from tbl_ld_xgsbds where " + whereString + ")";
                _iAccessData.ExecuteSql(sqlString);


                //加入删除子表附件文件的方法

                resultDic["result"]  = "true";
                resultDic["message"] = _idal_tbl_ld_xgsbds.Delete(whereString, null);
                NewLog("数据删除成功,删除的数据条件为:" + whereString, "sql_delete", clientInf);
            }
            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));
        }
        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));
        }
        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));
        }
示例#16
0
        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
            {
            }
        }
示例#17
0
        /// <summary>
        /// 验证是不是能启动流程
        /// </summary>
        /// <param name="sys_ids"></param>
        /// <param name="str_facterid"></param>
        /// <param name="ds_facter"></param>
        /// <param name="str_resultmessage"></param>
        /// <param name="clientInf"></param>
        /// <param name="userInfoJsonString"></param>
        /// <returns></returns>
        public string get_startworkflow(string sys_ids, string str_facterid, DataSet ds_facter, ref string str_resultmessage, string clientInf, string userInfoJsonString)
        {
            string result = "";

            try
            {
                Eva.Library.ServiceAdapter.IAdapter.IWorkFlow w = Eva.Library.ServiceAdapter.AdapterFactory.WorkFlowFactory.CreateService(Eva.Library.Configuration.ConfigurationManager.AppSettings["AppCode"]);
                string  lcdyid = _cc.GetWorkFlowLCDYID(str_facterid, ds_facter, clientInf, userInfoJsonString);
                DataSet ds;
                if (sara.dd.ldsw.commonclass.commonclass.GetPlatformServiceModel() == "dll")
                {
                    ds = sara.platform.service.workflow.Service.GetUserOperationStartByDylcid(lcdyid);
                }
                else
                {
                    ds = w.GetUserOperationStartByDylcid(lcdyid);
                }
                #region businesscode
                //businesscode
                //在此处添加针对projclassid = 3的业务代码
                _iAccessData = sara.dd.ldsw.commonclass.commonclass.CreateIAccessData();
                string sql   = "select count(*) from tbl_ld_xhhbtzb where fk_tbl_ld_xhhbt_sys_id = (select sys_id from tbl_ld_xhhbt  where fk_tbl_maintable_sys_id='" + sys_ids + "') and f_khbh is null";
                string count = "0";
                object o     = _iAccessData.GetSingle(sql);
                if (o != null)
                {
                    count = o.ToString();
                }
                string total = "0";
                sql = "select count(*) from tbl_ld_xhhbtzb where fk_tbl_ld_xhhbt_sys_id = (select sys_id from tbl_ld_xhhbt  where fk_tbl_maintable_sys_id='" + sys_ids + "')";
                object res = _iAccessData.GetSingle(sql);
                if (res != null)
                {
                    total = res.ToString();
                }
                if (count != "0" || total == "0")
                {
                    result = "请先选定客户在进行操作";
                }
                #endregion
                str_resultmessage = Eva.Library.Format.FormatEntityTool.FormatDataTableToJson(ds.Tables[0]);
            }
            catch (Exception ex)
            {
                result = Eva.Library.Format.FormatTextTool.ErrorMessageFormat(ex.Message + ex.StackTrace);
            }
            return(result);
        }
示例#18
0
        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));
        }
示例#19
0
        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));
        }
示例#20
0
        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 Delete(string whereString, string clientInf)
        {
            _iAccessData = sara.dd.ldsw.commonclass.commonclass.CreateIAccessData();
            Dictionary <string, string> resultDic = new Dictionary <string, string>();

            resultDic["result"]  = "";
            resultDic["message"] = "";
            try
            {
                //删除附件的功能

                //删除子表的方法

                //加入删除子表附件文件的方法

                string sql = "";
                sql += " select count(*) from tbl_ld_yhb";
                sql += " where (f_dyid is not null and f_dyid in (select sys_id from tbl_ldbm_dycq where " + whereString + "))";
                sql += " or(f_scid is not null and f_scid in(select sys_id from tbl_ldbm_dycq where " + whereString + "))";
                sql += " or(f_qyid is not null and f_qyid in(select sys_id from tbl_ldbm_dycq where " + whereString + "))";
                sql += " or(f_pqid is not null and f_pqid in(select sys_id from tbl_ldbm_dycq where " + whereString + "))";
                string count = _iAccessData.GetSingle(sql).ToString();
                if (count != "0")
                {
                    resultDic["result"]  = "false";
                    resultDic["message"] = "您所选定的信息,在用户表中存在引用,所以不能删除。";
                }
                else
                {
                    resultDic["result"]  = "true";
                    resultDic["message"] = _idal_tbl_ldbm_dycq.Delete(whereString, null);
                    NewLog("数据删除成功,删除的数据条件为:" + whereString, "sql_delete", clientInf);
                }
            }
            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));
        }
示例#22
0
        public string GetTags(string clientInf)
        {
            Dictionary <string, string> resultDic = new Dictionary <string, string>();

            resultDic["result"]  = "";
            resultDic["message"] = "";
            try
            {
                Eva.Library.Data.AccessData.IAccessData _iAccessData = Eva.Library.Data.AccessData.AccessDataFactory.CreateDataAccess(DataBaseType.oracledal, Eva.Library.Configuration.ConfigurationManager.AppSettings["DataBaseConnectionString"].ToString());

                string re = _iAccessData.GetSingle("select wm_concat(replace(f_tag,' ',',')) from tbl_app_news ").ToString();

                List <string> l_re     = re.Split(',').ToList();
                List <string> l_result = new List <string>();
                string        result   = "";
                for (int i = 0; i < l_re.Count; i++)
                {
                    if (!l_result.Contains(l_re[i]))
                    {
                        l_result.Add(l_re[i]);
                    }
                }

                for (int i = 0; i < l_result.Count; i++)
                {
                    result += l_result[i] + "^";
                }
                result = result.Trim('^');

                resultDic["result"]  = "true";
                resultDic["message"] = result;

                NewLog("查询Tags:", "sql_select", clientInf);
            }
            catch (Exception ex)
            {
                resultDic["result"]  = "false";
                resultDic["message"] = Eva.Library.Format.FormatTextTool.ErrorMessageFormat(ex.Message + ex.StackTrace);

                NewLog("查询Tags:异常信息:" + Eva.Library.Format.FormatTextTool.ErrorMessageFormat(ex.Message + ex.StackTrace), "sql_select", clientInf);
            }
            return(Eva.Library.Format.FormatEntityTool.FormatDicToJson(resultDic));
        }
示例#23
0
        public string IsCanRollBack(string sys_id, string clientInf)
        {
            Dictionary <string, string> resultDic = new Dictionary <string, string>();

            resultDic["result"]  = "";
            resultDic["message"] = "";
            string sql   = "";
            string count = "";

            try
            {
                _iAccessData = sara.dd.ldsw.commonclass.commonclass.CreateIAccessData();
                sql          = "select count(*) from tbl_ld_pgb where sys_id > '" + sys_id + "' and f_value1 = (select f_value1 from tbl_ld_pgb  where sys_id = '" + sys_id + "') and f_ztid='1'";
                count        = _iAccessData.GetSingle(sql).ToString();
                if (count != "0")
                {
                    resultDic["result"]  = "true";
                    resultDic["message"] = "false";
                }
                else
                {
                    sql   = "select count(*) from tbl_ld_cbiao where f_pgbhid='" + sys_id + "'and f_ztid!='2'";
                    count = _iAccessData.GetSingle(sql).ToString();
                    if (count != "0")
                    {
                        resultDic["result"]  = "true";
                        resultDic["message"] = "false";
                    }
                    else
                    {
                        resultDic["result"]  = "true";
                        resultDic["message"] = "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 UpdateStatus(string notificationIdsString, string userIdString, 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
                {
                    _iAccessData = commonclass.commonclass.CreateIAccessData();
                    string sqlString = "";
                    if (notificationIdsString != "-1")
                    {
                        sqlString = "update tbl_app_pushnotification set f_statusid = '2' , f_status = '已接受' where sys_id in ('" + notificationIdsString.Replace("^", "','") + "')";
                    }
                    else
                    {
                        sqlString = "update tbl_app_pushnotification set f_statusid = '2' , f_status = '已接受' where f_recive_userid  = '" + userIdString + "'";
                    }


                    _iAccessData.ExecuteSql(sqlString);

                    string count = _idal_tbl_app_pushnotification.GetCount(" f_recive_userid = '" + userIdString + "' and f_statusid = '1'", null);
                    resultDic["result"]  = "true";
                    resultDic["message"] = count;
                }
            }
            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 getXmmcByMaintableSysId(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 xmmc from tbl_maintable where sys_id='" + maintable_sys_id + "'";

                string xmmc = _ia.GetSingle(sql).ToString();
                resultDic["message"] = xmmc;
            }
            catch (Exception e)
            {
                resultDic["result"]   = "false";
                resultDic["messaget"] = Eva.Library.Format.FormatTextTool.ErrorMessageFormat(e.Message);
            }
            return(Eva.Library.Format.FormatEntityTool.FormatDicToJson(resultDic));
        }
示例#26
0
        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));
        }
示例#27
0
        public string UpdateUserPassword(string userLoginNameString, string newPassword, 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 sql = "update t_user set u_pwd = '" + sara.platform.service.auth.Service.PassWordEncrypt(newPassword) + "' where u_code = '" + userLoginNameString + "'";

                    _iAccessData = commonclass.commonclass.CreateIAccessData();

                    if (_iAccessData.ExecuteSql(sql) > 0)
                    {
                        resultDic["result"]  = "true";
                        resultDic["message"] = "密码修改成功";
                    }
                    else
                    {
                        resultDic["result"]  = "false";
                        resultDic["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));
        }
示例#28
0
        public string GetSingleSqls(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);

                foreach (string key in sqlStringDic.Keys)
                {
                    object o = _iAccessData.GetSingle((sqlStringDic[key].ToString()));

                    if (o != null)
                    {
                        //发现少引号,怀疑是bug--sk
                        message += "\"" + key + "\":\"" + o.ToString() + "\",";
                    }
                    else
                    {
                        //发现少引号,怀疑是bug--sk
                        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));
        }
示例#29
0
        public string GetAppStatus(string appVersionString, 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";

                    _iAccessData = commonclass.commonclass.CreateIAccessData();

                    string sqlString = "select f_appstatusid from tbl_app_version  where f_apptypeid = '" + userInfDic["devicetype"] + "' and f_appversion = '" + appVersionString + "'";

                    object o = _iAccessData.GetSingle(sqlString);
                    if (o != null)
                    {
                        currentVersion = o.ToString();
                    }
                    resultDic["result"]  = "true";
                    resultDic["message"] = currentVersion;
                }
            }
            catch (Exception ex)
            {
                resultDic["result"]  = "error";
                resultDic["message"] = Eva.Library.Format.FormatTextTool.ErrorMessageFormat(ex.Message + ex.StackTrace);
            }
            return(Eva.Library.Format.FormatEntityTool.FormatDicToJson(resultDic));
        }
示例#30
0
        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));
        }