コード例 #1
0
        /// <summary>
        /// projclassstate向后流转
        /// </summary>
        /// <param name="sys_ids"></param>
        /// <param name="str_facterid"></param>
        /// <param name="ds_facter"></param>
        /// <param name="str_txt_bak_message"></param>
        /// <param name="clientInf"></param>
        /// <returns></returns>
        ///

        public string get_result_1_1(string sys_ids)
        {
            //string str_result = "";

            //str_result = get_resultmorethanonesysid(sys_ids);

            //if (str_result != "")
            //{
            //    return str_result;
            //}

            //return str_result;
            //验证所选客户是否可以进流程
            string result = "";
            string sql    = "select f_value1 from tbl_ld_xgsbds where fk_tbl_maintable_sys_id='" + sys_ids + "'";
            string value1 = "";
            object o      = _iAccessData.GetSingle(sql);

            if (o != null)
            {
                value1 = o.ToString();
            }
            if (value1 == "")
            {
                result = "数据未分析";
            }
            else
            {
                result = "";
            }


            return(result);
        }
コード例 #2
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));
        }
コード例 #3
0
        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));
        }
コード例 #4
0
ファイル: assemblyfunction7.cs プロジェクト: wangnan2323/code
        /// <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);
        }
コード例 #5
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));
        }
コード例 #6
0
        /// <summary>
        /// 删除时验证
        /// </summary>
        /// <param name="sys_ids"></param>
        /// <returns></returns>
        public string get_del(string sys_ids)
        {
            string str_result = "";

            str_result = get_resultonlyonesysid(sys_ids);

            #region businesscode
            //businesscode
            //在此处添加针对projclassid = 3的业务代码
            //删除时判断子表是否存在数据
            if (str_result != "")
            {
                return(str_result);
            }
            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 + "')";
            string count = "0";
            object o     = _iAccessData.GetSingle(sql);
            if (o != null)
            {
                count = o.ToString();
            }
            if (count != "0")
            {
                str_result = "请先删除子表中的数据。";
            }
            else
            {
                str_result = "";
            }
            #endregion
            return(str_result);
        }
コード例 #7
0
        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));
        }
コード例 #8
0
ファイル: filecontrol.cs プロジェクト: wangnan2323/code
        /// <summary>
        /// 获取新的FILEID
        /// </summary>
        /// <returns></returns>
        public static string GetNewFileId(Eva.Library.Data.AccessDataTrans.IAccessDataTrans t)
        {
            string sql = "select max(id) from tbl_file_menu ";
            object o;
            string fileid = "";

            if (t == null)
            {
                fileid = ((o = _iAccessData.GetSingle(sql)) == null ? "0" : o.ToString());
            }
            else
            {
                fileid = ((o = t.GetSingle(sql)) == null ? "0" : o.ToString());
            }
            if (fileid == "")
            {
                fileid = "0";
            }
            fileid = (int.Parse(fileid) + 1).ToString();
            sql    = "insert into tbl_file_menu(id,hascontent) values('" + fileid + "','1')";
            if (t == null)
            {
                _iAccessData.ExecuteSql(sql);
            }
            else
            {
                t.ExecuteSql(sql);
            }

            return(fileid);
        }
コード例 #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));
        }
コード例 #10
0
ファイル: app_version.asmx.cs プロジェクト: wangnan2323/code
        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));
        }
コード例 #11
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
                //验证所选客户是否可以进流程
                string sql    = "select f_value1 from tbl_ld_xgsbds where fk_tbl_maintable_sys_id='" + sys_ids + "'";
                string value1 = "";
                object o      = _iAccessData.GetSingle(sql);
                if (o != null)
                {
                    value1 = o.ToString();
                }
                if (value1 == "")
                {
                    result = "数据未分析";
                }
                else
                {
                    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);
        }
コード例 #12
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));
        }
コード例 #13
0
        /// <summary>
        /// 重写获取count
        /// </summary>
        /// <param name="whereString"></param>
        /// <param name="clientInf"></param>
        /// <returns></returns>
        public string GetCount(string whereString, Eva.Library.Data.AccessDataTrans.IAccessDataTrans t)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select count(*) from tbl_ld_cben");
            if (whereString.Trim() != "")
            {
                strSql.Append(" where " + whereString);
            }
            string count = "0";

            if (t == null)
            {
                count = int.Parse(_iAccessData.GetSingle(strSql.ToString()).ToString()).ToString();
            }
            else
            {
                count = int.Parse(t.GetSingle(strSql.ToString()).ToString()).ToString();
            }
            return(count);
        }
コード例 #14
0
        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));
        }
コード例 #15
0
        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));
        }
コード例 #16
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));
        }
コード例 #17
0
        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));
        }
コード例 #18
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));
        }
コード例 #19
0
ファイル: app_version.asmx.cs プロジェクト: wangnan2323/code
        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));
        }
コード例 #20
0
        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));
        }
コード例 #21
0
        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));
        }
コード例 #22
0
        public string AddDiscuss(string newsIdString, string contentString, string discussNodeIdString, 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 userid   = userInfDic["userid"].ToString();
                    string username = userInfDic["username"].ToString();
                    string userimg  = userInfDic["userimg"].ToString();

                    _iAccessData = commonclass.commonclass.CreateIAccessData();
                    string nodeid = _iAccessData.GetSingle(GetNodeIdSqlString(discussNodeIdString)).ToString();

                    if (nodeid.Length == 1)
                    {
                        nodeid = "000" + nodeid;
                    }
                    else if (nodeid.Length == 2)
                    {
                        nodeid = "00" + nodeid;
                    }
                    else if (nodeid.Length == 3)
                    {
                        nodeid = "0" + nodeid;
                    }

                    sara.dd.ldsw.model.tbl_app_news_discuss model = new sara.dd.ldsw.model.tbl_app_news_discuss();
                    model.fk_tbl_app_news_sys_id = newsIdString.Trim();
                    model.f_discusscontent       = commonclass.emojiclass.encodeEmoji(contentString);
                    model.fk_t_user_id           = userid;
                    model.f_username             = username;
                    model.f_userimg         = userimg;
                    model.f_nodeid          = nodeid;
                    model.sys_creatdate     = System.DateTime.Now;
                    model.sys_creatuserid   = userid;
                    model.sys_creatusername = username;

                    model.sys_lasteditdate     = System.DateTime.Now;
                    model.sys_lastedituserid   = userid;
                    model.sys_lasteditusername = username;

                    model.sys_delflag = "0";

                    _idal_tbl_app_news_discuss.Add(model, null);

                    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));
        }
コード例 #23
0
        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));
        }
コード例 #24
0
        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));
        }
コード例 #25
0
        public string ycDHQuery(string khbh)
        {
            Dictionary <string, string> result = new Dictionary <string, string>();

            try
            {
                _iAccessData = sara.dd.ldsw.commonclass.commonclass.CreateIAccessData();

                //判断该用户是否处于建行托收
                string sql   = "select count(*) as count from TBL_LD_JFB  where f_lyid='08080002' and f_ztid='0' and f_khbh='" + khbh + "'";
                string count = _iAccessData.GetSingle(sql).ToString();

                if (Eva.Library.Text.NumberTool.Parse(count) > 0)
                {
                    //处于建行托收不能缴费
                    result["ret"] = "50";
                }
                else
                {
                    sara.dd.ldsw.idal.Itbl_ld_cbiao _idal_tbl_ld_cbiao = new sara.dd.ldsw.dal.tbl_ld_cbiao();
                    //sara.dd.ldsw.idal.Itbl_ld_khb _idal_tbl_ld_khb = new sara.dd.ldsw.dal.tbl_ld_khb();
                    List <sara.dd.ldsw.model.tbl_ld_cbiao> modellist = _idal_tbl_ld_cbiao.GetList(" f_khbh='" + khbh + "' and f_ztid='2' and (f_cbbh like 'DH%' or f_cbbh like 'ZB%')", "false", "", "*", "", "", null);
                    //List<sara.dd.ldsw.model.tbl_ld_khb> khmodellist = _idal_tbl_ld_khb.GetList(" f_khbh='" + khbh + "'", "", "*", "", "", null);

                    if (modellist.Count == 1)
                    {
                        sara.dd.ldsw.model.tbl_ld_cbiao model = modellist[0];


                        //客户名
                        result["custname"] = model.f_yhm;

                        //地址
                        result["custaddr"] = model.f_dz;


                        double bqje    = Eva.Library.Text.NumberTool.Parse(model.f_bqje);
                        string bqjestr = Eva.Library.Text.NumberTool.GetNumberByLength((bqje * 100), 0);
                        //应收金额
                        result["amount"] = model.f_bqje;


                        double sl     = Eva.Library.Text.NumberTool.Parse(model.f_bqsl);
                        double sf     = Eva.Library.Text.NumberTool.Parse(model.f_sf);
                        string sfstr  = Eva.Library.Text.NumberTool.GetNumberByLength(sf * 100, 0);
                        double pwf    = Eva.Library.Text.NumberTool.Parse(model.f_pwf);
                        string pwfstr = Eva.Library.Text.NumberTool.GetNumberByLength(pwf * 100, 0);
                        string sfdj   = Eva.Library.Text.NumberTool.GetNumberByLength((sf / sl), 0);
                        string pwfdj  = Eva.Library.Text.NumberTool.GetNumberByLength((pwf / sl), 0);

                        result["begincode"] = model.f_sqzm;
                        result["endcode"]   = model.f_bqzm;
                        result["wateruse"]  = model.f_bqsl;
                        result["wateramt"]  = sfdj;
                        result["pwamt"]     = pwfdj;
                        result["ret"]       = "49";
                    }
                    else
                    {
                        //抄表记录不唯一
                        //返回码不存在
                        result["ret"] = "50";
                    }
                }

                return(Eva.Library.Format.FormatEntityTool.FormatDicToJson(result));
            }
            catch (Exception ex)
            {
                //程序异常
                result["ret"] = "50";
                return(Eva.Library.Format.FormatEntityTool.FormatDicToJson(result));
            }
        }
コード例 #26
0
        public string CalcVesion(string sysIdString, string columnsString, string fileIdString, string appType, string clientInf)
        {
            Dictionary <string, string> resultDic = new Dictionary <string, string>();

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

            try
            {
                _iAccessData = commonclass.commonclass.CreateIAccessData();
                string sqlString = "";
                string result    = "";
                string version   = "";
                #region 通用版本计算代码

                //计算版本号部分
                sqlString = "select kk from(select " + columnsString + " as kk from tbl_app_version where f_apptypeid='" + appType + "' order by " + columnsString + " desc) where rownum=1";
                object o = _iAccessData.GetSingle(sqlString);
                if (o == null)
                {
                    version = "1.0.0";
                }
                else
                {
                    result = o.ToString();

                    if (result == "")
                    {
                        version = "1.0.0";
                    }
                    else
                    {
                        string[] subs = result.Split('.');
                        if (int.Parse(subs[2]) < 9)
                        {
                            int total = int.Parse(subs[2]) + 1;
                            version = subs[0] + "." + subs[1] + "." + total.ToString();
                        }
                        else if (int.Parse(subs[1]) < 9)
                        {
                            int total = int.Parse(subs[1]) + 1;
                            version = subs[0] + "." + total.ToString() + ".0";
                        }
                        else
                        {
                            int total = int.Parse(subs[0]) + 1;
                            version = total.ToString() + ".0.0";
                        }
                    }
                }



                //update部分

                sqlString = "update tbl_app_version set " + columnsString + "='" + version + "' where sys_id='" + sysIdString + "'";
                _iAccessData.ExecuteSql(sqlString);


                #endregion

                //数据返回部分
                resultDic["message"] = version.Replace(".", "^");
                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));
        }
コード例 #27
0
ファイル: app_version.asmx.cs プロジェクト: wangnan2323/code
        public string GetColorResource(string appVersionString, string colorVersionString, 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 rootpath       = Eva.Library.Format.FormatTextTool.GetMapPath(Eva.Library.Configuration.ConfigurationManager.AppSettings["AppResourceRootPath"].ToString() + "color/", Server);
                    string currentVersion = "1.0.1";
                    #region 读取最新版本号
                    _iAccessData = commonclass.commonclass.CreateIAccessData();
                    string sqlString = "select f_colorversion 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 != colorVersionString)
                    {
                        List <String> colorfiles = new List <String>();
                        sqlString = "select distinct(f_resourcename) as resourcename from tbl_app_version_color ";
                        DataSet ds = _iAccessData.Query(sqlString);
                        for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                        {
                            colorfiles.Add(ds.Tables[0].Rows[i]["resourcename"].ToString());
                        }

                        sqlString = "select f_resourcename,f_resourcekey,f_resourcevalue from tbl_app_version_color";
                        ds        = _iAccessData.Query(sqlString);


                        IList <IDictionary <string, string> > colorList = new List <IDictionary <string, string> >();

                        #region colorDic
                        foreach (string colorfile in colorfiles)
                        {
                            DataRow[] drs = ds.Tables[0].Select(" f_resourcename = '" + colorfile + "'");
                            Dictionary <string, string> colorContent = new Dictionary <string, string>();

                            for (int i = 0; i < drs.Length; i++)
                            {
                                colorContent[drs[i]["f_resourcekey"].ToString()] = drs[i]["f_resourcevalue"].ToString();
                            }
                            Dictionary <string, string> colorDic = new Dictionary <string, string>();
                            colorDic["name"]  = colorfile;
                            colorDic["value"] = Eva.Library.Format.FormatEntityTool.FormatDicToJson(colorContent);
                            colorList.Add(colorDic);
                        }

                        #endregion


                        Dictionary <string, string> htmlResourceDic = new Dictionary <string, string>();
                        htmlResourceDic["version"] = currentVersion;
                        htmlResourceDic["content"] = Eva.Library.Format.FormatEntityTool.FormatDicListToJson(colorList);

                        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));
        }
コード例 #28
0
        /*
         *                   CREATE OR REPLACE FUNCTION f_checktoken(arg_token    in varchar2, --token
         *                              arg_service  in varchar2, --定义参数变量
         *                              arg_function in varchar2)
         * return varchar2 as
         * v_result varchar2(200);
         * v_count  number;
         *
         * BEGIN
         * --定义返回值
         * v_result := 'true';
         * --私有变量
         * v_count := 0;
         * --0、验证有效性
         * select count(*)
         * into v_count
         * from t_token_list t, t_token_function f, t_token_relation r
         * where t.sys_id = r.fk_t_token_list_sys_id
         * and f.sys_id = r.fk_t_token_function_sys_id
         * and t.f_token = arg_token
         * and t.sys_delflag = '0'
         * and t.f_enable = 'true'
         * and sysdate between t.f_startdate and t.f_enddate
         * and f.f_service = arg_service
         * and f.f_function = arg_function
         * and f.sys_delflag = '0';
         *
         * if v_count > 0 then
         * v_result := 'true';
         *
         * else
         * --v_result := 'false';
         * --1、验证token是否存在
         * select count(*)
         * into v_count
         * from t_token_list
         * where f_token = arg_token;
         * if v_count <= 0 then
         * v_result := '传入的token不存在于Token列表中';
         * else
         * --2、验证token是否已停用
         * select count(*)
         * into v_count
         * from t_token_list
         * where f_token = arg_token
         * and sys_delflag = '0';
         * if v_count <= 0 then
         * v_result := '传入的token已经停用';
         * else
         * --3、验证token是否超时
         * select count(*)
         * into v_count
         * from t_token_list
         * where f_token = arg_token
         * and sys_delflag = '0'
         * and sysdate between f_startdate and f_enddate;
         * if v_count <= 0 then
         * v_result := '传入的token已超时';
         * else
         * --4、验证function和service是否存在
         * select count(*)
         *  into v_count
         *  from t_token_function
         * where f_service = arg_service
         *   and f_function = arg_function;
         *
         * if v_count <= 0 then
         *  v_result := 'function或者service不存在于服务列表中';
         * else
         *  --5、验证function和service是否已停用
         *  select count(*)
         *    into v_count
         *    from t_token_function
         *   where f_service = arg_service
         *     and f_function = arg_function
         *     and sys_delflag = '0';
         *
         *  if v_count <= 0 then
         *    v_result := 'function或者service已停用';
         *  else
         *     v_result := '当前token不具备对此服务或方法的操作权限';
         *  end if;
         *
         * end if;
         *
         * end if;
         * end if;
         * end if;
         * end if;
         *
         * RETURN(v_result);
         *
         * END f_checktoken;
         *
         *
         */

        #endregion

        protected void Application_BeginRequest(object sender, EventArgs e)
        {
            try
            {
                //请求服务的路径
                string path = this.Request.Path;
                //请求的方法
                string function = this.Request.PathInfo.Replace("/", "");
                //请求的service
                string service = path.Replace(function, "");
                //执行消息
                string message = "";



                //webservice采集器
                if (ConfigWebServiceCollect == "true")
                {
                    #region  输通道加密算法-采集
                    Eva.Library.Data.AccessDataTrans.IAccessDataTrans t = null;
                    try
                    {
                        if (function != "")
                        {
                            if (service != "")
                            {
                                t = commonclass.commonclass.CreateIAccessDataTrans();

                                t.getTrans().begin();

                                string sql = "select count(*) from t_token_function  where f_function = '" + function + "' and f_service = '" + service + "' and  f_appname = '" + ConfigAppName + "'";

                                if (t.GetSingle(sql).ToString() == "0")
                                {
                                    sara.platform.operation.token.model.t_token_function m = new sara.platform.operation.token.model.t_token_function();
                                    m.sys_creatdate    = DateTime.Now;
                                    m.sys_lasteditdate = DateTime.Now;
                                    m.sys_deldate      = DateTime.Parse("1900-01-01");
                                    m.sys_delflag      = "0";
                                    m.f_appcode        = ConfigAppCode;
                                    m.f_appname        = ConfigAppName;
                                    m.f_appnameen      = ConfigAppName;
                                    m.f_function       = function;
                                    m.f_service        = service;
                                    m.f_isencrypt      = "true";
                                    m.f_istoken        = "true";

                                    sara.platform.operation.token.idal.It_token_function d = sara.platform.operation.commonclass.platformdalfactory.Create <sara.platform.operation.token.idal.It_token_function>();
                                    string id = d.Add(m, t);

                                    sara.platform.operation.token.model.t_token_relation rm = new sara.platform.operation.token.model.t_token_relation();
                                    rm.fk_t_token_function_sys_id = id;
                                    rm.fk_t_token_list_sys_id     = ConfigDefaultTokenId;

                                    sara.platform.operation.token.idal.It_token_relation rd = sara.platform.operation.commonclass.platformdalfactory.Create <sara.platform.operation.token.idal.It_token_relation>();
                                    rd.Add(rm, t);
                                }
                                t.getTrans().commit();
                            }
                        }
                    }
                    catch (Exception ex)
                    {
                        if (t != null)
                        {
                            t.getTrans().rollback();
                        }
                    }
                    finally
                    {
                    }
                    #endregion
                }

                //是否开启token
                if (ConfigWebServiceToken == "true")
                {
                    #region  输通道令牌管理
                    //是否为webservice调用
                    //if (this.Request.CurrentExecutionFilePathExtension != ".asmx")
                    //{
                    //    return;
                    //}


                    //如果是直接打开webSerivce页面,function参数会为空
                    if (function != "")
                    {
                        //检查是否例外
                        DataRow[] drs = _dt_token_function_istoken.Select(" f_function='" + function + "' and f_service='" + service + "'");
                        if (drs.Length == 0)
                        {
                            //获取token
                            object token = this.Request.QueryString["token"];
                            if (token != null)
                            {
                                object result = _iAccessData.GetSingle("select f_checktoken('" + token + "','" + service + "','" + function + "') from dual");
                                if (result != null)
                                {
                                    if (result.ToString() == "true")
                                    {
                                    }
                                    else
                                    {
                                        message = result.ToString();//token的验证信息
                                    }
                                }
                                else
                                {
                                    message = "其他未知错误";
                                }
                            }
                            else
                            {
                                message += "必须传入token";
                            }
                        }
                    }
                    #endregion
                }

                //如果不满足令牌,则直接退出,不进行后边的验证
                if (message != "")
                {
                    Response.Write(message);
                    Response.End();
                }

                //是否开启悲观锁
                if (ConfigWebServiceLock == "true")
                {
                    #region 防并发悲观锁

                    DataRow[] drs_lock = _dt_token_function_islock.Select(" f_function='" + function + "' and f_service='" + service + "'");
                    if (drs_lock.Length != 0)
                    {
                        string functionName = drs_lock[0]["f_value10"].ToString();
                        string lockResult   = lockFunction(functionName);
                        switch (lockResult)
                        {
                        case "true":

                            break;

                        case "false":
                            message = "访问超时,请稍后再试";
                            break;

                        case "error":
                            message = "访问异常";
                            break;
                        }
                    }


                    #endregion
                }


                //如果不满足令牌,则直接退出,不进行后边的验证
                if (message != "")
                {
                    Response.Write(message);
                    Response.End();
                }
            }
            catch
            {
            }
        }
コード例 #29
0
        public string Delete(string whereString, string clientInf)
        {
            Dictionary <string, string> resultDic = new Dictionary <string, string>();

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

                //删除子表的方法

                //加入删除子表附件文件的方法
                //sk??!!
                _iAccessData = sara.dd.ldsw.commonclass.commonclass.CreateIAccessData();
                string sql = "select count(*) from tbl_ld_sbb where f_sbfzid in (select sys_id from tbl_ldbm_sbfz where " + whereString + ")";
////                _iAccessData.ExecuteSql update,insert,delete
//                //_iAccessData.Query,select
//                DataSet ds = _iAccessData.Query("select * from tbl_ld_sbb");

//                for (int i = 0; i < ds.Tables[0].Rows.Count;i++ )
//                {
//                    ds.Tables[0].Rows[i]["sys_id"].ToString();

//                    DataRow[] drs = ds.Tables[0].Select(" sys_id in  ('1000','1002')");
//                    for (int ii = 0; ii < drs.Length; ii++)
//                    {
//                        drs[ii]["sys_id"].ToString();
//                    }
//                }



                string count = "0";
                object o     = _iAccessData.GetSingle(sql);
                if (o != null)
                {
                    count = o.ToString();
                }

                if (count != "0")
                {
//                    //不能删除
                    resultDic["result"]  = "false";
                    resultDic["message"] = "您所选定的信息,在客户表中存在引用,所以不能删除。";
                }
                else
                {
                    resultDic["result"]  = "true";
                    resultDic["message"] = _idal_tbl_ldbm_sbfz.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));
        }
コード例 #30
0
        public string GetNodeid(string baseSysId, string operType, string clientInf)
        {
            Dictionary <string, string> resultDic = new Dictionary <string, string>();

            resultDic["result"]  = "";
            resultDic["message"] = "";
            try
            {
                _iAccessData = sara.dd.ldsw.commonclass.commonclass.CreateIAccessData();
                string sql = "";
                sql = "select sys_orderid from tbl_ldbm_dycq where sys_id = '" + baseSysId + "'";
                object o = _iAccessData.GetSingle(sql);
                if (o == null || baseSysId == "")
                {
                    sql = "select max(sys_orderid) from tbl_ldbm_dycq where length(sys_orderid) = 4";
                    o   = _iAccessData.GetSingle(sql);
                    string childNodeid = "";
                    if (o == null || o.ToString() == "")
                    {
                        childNodeid = "0001";
                    }
                    else
                    {
                        childNodeid = o.ToString();
                        childNodeid = (int.Parse(childNodeid) + 1).ToString();
                        while (childNodeid.Length < 4)
                        {
                            childNodeid = "0" + childNodeid;
                        }
                    }
                    resultDic["result"]  = "true";
                    resultDic["message"] = childNodeid;
                }
                else
                {
                    string baseNodeid   = o.ToString();
                    string parentNodeid = "";
                    if (operType == "child")
                    {
                        parentNodeid = baseNodeid;
                    }
                    else
                    {
                        parentNodeid = baseNodeid.Substring(0, baseNodeid.Length - 4);
                    }

                    if (parentNodeid == "")
                    {
                        sql = "select max(sys_orderid) from tbl_ldbm_dycq where sys_orderid like  '" + parentNodeid + "%' and length(sys_orderid) = 4";
                    }
                    else
                    {
                        sql = "select max(sys_orderid) from tbl_ldbm_dycq where sys_orderid like  '" + parentNodeid + "%' and length(sys_orderid) = length('" + parentNodeid + "')+4";
                    }

                    o = _iAccessData.GetSingle(sql);
                    string childNodeid = "";
                    if (o == null || o.ToString() == "")
                    {
                        childNodeid = "0001";
                    }
                    else
                    {
                        childNodeid = o.ToString().Substring(parentNodeid.Length, 4);

                        childNodeid = (int.Parse(childNodeid) + 1).ToString();
                        while (childNodeid.Length < 4)
                        {
                            childNodeid = "0" + childNodeid;
                        }
                    }

                    resultDic["result"]  = "true";
                    resultDic["message"] = parentNodeid + childNodeid;
                }

                NewLog("获取Nodeid成功,条件为,baseSysId:" + baseSysId + "_operType:" + operType, "sql_select", clientInf);
            }
            catch (Exception ex)
            {
                resultDic["result"]  = "false";
                resultDic["message"] = Eva.Library.Format.FormatTextTool.ErrorMessageFormat(ex.Message + ex.StackTrace);

                NewLog("获取Nodeid失败,条件为,baseSysId:" + baseSysId + "_operType:" + operType + ",异常信息:" + Eva.Library.Format.FormatTextTool.ErrorMessageFormat(ex.Message + ex.StackTrace), "sql_select", clientInf);
            }
            return(Eva.Library.Format.FormatEntityTool.FormatDicToJson(resultDic));
        }