//
        public UtilRetorno enviar(Pedido OPedido)
        {
            ConfiguracaoNotificacao OConfiguracao = ConfiguracaoNotificacaoBL.getInstance.carregar(this.idOrganizacao);

            Dictionary <string, object> infos = new Dictionary <string, object>();

            infos["idPedido"]    = OPedido.id.ToString();
            infos["nomePessoa"]  = OPedido.nomePessoa;
            infos["valorPedido"] = OPedido.getValorTotal().ToString("C");

            infos["infoPgto"] = "";

            if (OPedido.TituloReceita != null)
            {
                infos["infoPgto"] = UtilConfig.linkPgtoTitulo(OPedido.TituloReceita.id);
            }

            string tituloEmail = OConfiguracao.tituloEmailFaturamentoPedido;

            if (tituloEmail.isEmpty())
            {
                tituloEmail = PedidoEmailsConst.tituloEmailFaturamentoPedido;
            }

            tituloEmail = tituloEmail.Replace("#ID_PEDIDO#", infos["idPedido"].ToString());

            return(this.enviar(infos, tituloEmail));
        }
        //Intercepta as exceções

        public override void OnException(ExceptionContext filterContext)
        {
            var User = HttpContextFactory.Current.User;


            try {
                var OErroDTO = new {
                    dominio               = HttpContext.Current.Request.Url.Host,
                    url                   = HttpContext.Current.Request.RawUrl,
                    dtErro                = DateTime.Now,
                    exceptionMessage      = filterContext.Exception.Message,
                    exceptionInnerMessage = filterContext.Exception.InnerException?.Message,
                    exceptionTrace        = filterContext.Exception.StackTrace,
                    metodo                = filterContext.Exception.TargetSite.ToString(),
                    ip = HttpContextFactory.Current.Request.UserHostAddress,
                    idUsuarioLogado = DAL.Permissao.Security.Extensions.SecurityExtensions.id(HttpContextFactory.Current.User)
                };

                UtilLog.saveError(filterContext.Exception, "");

                if (UtilConfig.emProducao())
                {
                    string dados       = JsonConvert.SerializeObject(OErroDTO);
                    string jsonRetorno = UtilHTTP.postSync(UtilConfig.linkAbsLogErro, dados);
                }
            } catch (Exception ex) {
                UtilLog.saveError(ex, "");
            }

            base.OnException(filterContext);
        }
Esempio n. 3
0
        /// <summary>
        /// Gerar o link do checkout para um titulo_receita
        /// </summary>
        public static MvcHtmlString linkPagamentoTitulo(this HtmlHelper helper, int idTituloReceita, string textoLink, string cssClass = "", string icon = "")
        {
            var linkHref = UtilConfig.linkPgtoTitulo(idTituloReceita);

            TagBuilder htmlLink = new TagBuilder("a");

            htmlLink.Attributes.Add("href", linkHref);

            htmlLink.Attributes.Add("target", "_blank");

            htmlLink.Attributes.Add("title", "Link de pagamento");

            htmlLink.Attributes.Add("data-toggle", "tooltip");

            if (!icon.isEmpty())
            {
                htmlLink.InnerHtml += $"<i class=\"{icon}\"></i> ";
            }

            htmlLink.InnerHtml += textoLink;

            if (!string.IsNullOrEmpty(cssClass))
            {
                htmlLink.AddCssClass(cssClass);
            }

            return(new MvcHtmlString(htmlLink.ToString()));
        }
        //Salvar o arquivo para o plugin FROALA EDITOR
        private object uploadArquivoFroala(HttpPostedFileBase OFile)
        {
            if (!UploadFileValidation.isAllowedExtension(OFile))
            {
                return(new JsonMessage {
                    error = true, message = "A extensão do arquivo não é válida."
                });
            }

            int idOrganizacao = User.idOrganizacao();

            string pathUpload   = Path.Combine(UtilConfig.pathAbsUpload(idOrganizacao), "froala");
            string extensao     = UploadFileValidation.getExtension(OFile);
            string fileName     = String.Concat(UtilString.onlyNumber(DateTime.Now.ToString()), Guid.NewGuid(), extensao);
            string fullPathFile = Path.Combine(pathUpload, fileName);

            if (!Directory.Exists(pathUpload))
            {
                UtilIO.createFolder(pathUpload);
            }

            OFile.SaveAs(fullPathFile);

            string linkArquivo = String.Concat(UtilConfig.linkAbsSistemaUpload(idOrganizacao), "froala/", fileName);

            return(new { link = linkArquivo });
        }
Esempio n. 5
0
        public FileResult exibirArquivo(int idArquivo)
        {
            ArquivoUpload OArquivo = this.OArquivoUploadBL.carregar(idArquivo);

            if (OArquivo == null)
            {
                Response.Write("O arquivo não foi encontrado.");

                return(null);
            }

            int idOrganizacao = OArquivo.idOrganizacao.toInt();

            string basePath = idOrganizacao > 0 ? UtilConfig.pathAbsUpload(idOrganizacao) : $"{UtilConfig.pathAbsUploadFiles}upload/";

            string pathArquivo = OArquivo.path.Replace("\\", "/");

            string pathCompletoArquivo = String.Concat(basePath, pathArquivo);

            if (!System.IO.File.Exists(pathCompletoArquivo))
            {
                Response.Write("O arquivo não foi encontrado.");

                return(null);
            }

            string nomeDownload = String.Concat((String.IsNullOrEmpty(OArquivo.titulo) ? "download" : OArquivo.titulo), OArquivo.extensao);

            return(File(pathCompletoArquivo, OArquivo.contentType, nomeDownload));
        }
        //
        public UtilRetorno enviar(TituloReceitaPagamento OPagamento)
        {
            Dictionary <string, object> infos = new Dictionary <string, object>();

            string urlPagamento = UtilConfig.linkPgtoParcela(OPagamento.id);

            infos["linkPgto"] = urlPagamento;

            infos["nomePessoa"] = OPagamento.TituloReceita.nomePessoa;

            infos["valor"] = OPagamento.valorTotalComDesconto().ToString("C");

            infos["valorRecebido"] = OPagamento.valorRecebido.GetValueOrDefault().ToString("C");

            infos["dtVencimento"] = OPagamento.dtVencimento.exibirData();

            infos["dtPagamento"] = OPagamento.dtPagamento.exibirData();

            string descricaoPagamento = OPagamento.TituloReceita.descricao;

            if (!string.IsNullOrEmpty(OPagamento.descricaoParcela))
            {
                descricaoPagamento = String.Concat(descricaoPagamento, " (", OPagamento.descricaoParcela, ")");
            }

            infos["descricaoPagamento"] = descricaoPagamento;

            string tituloEmail = $"{OConfiguracaoSistema.tituloSistema} - Pagamento recebido";

            return(this.enviar(infos, tituloEmail));
        }
        //Link completo da imagem
        public static string linkArquivo(this ArquivoUpload OArquivo)
        {
            int idOrganizacao = OArquivo.idOrganizacao.toInt();

            string basePath = idOrganizacao > 0 ? UtilConfig.linkAbsSistemaUpload(idOrganizacao) : $"{UtilConfig.linkAbsSistema}upload/";

            return(String.Concat(basePath, OArquivo.path));
        }
Esempio n. 8
0
        public static string getLogError(this ArgumentException ex, string message)
        {
            var completeMessage = $"{message} :: {ex.ParamName}, {ex.Source}, {ex.Message}, {ex.StackTrace}";

            ex.saveError(completeMessage);

            return(UtilConfig.emProducao() ? message : completeMessage);
        }
Esempio n. 9
0
        public static string getLogError(this WebException ex, string message)
        {
            var completeMessage = $"{message} :: {ex.Status}, {ex.Response}, {ex.Source}, {ex.Message}, {ex.StackTrace}";

            ex.saveError(completeMessage);

            return(UtilConfig.emProducao() ? message : completeMessage);
        }
        //Link completo da imagem
        public static string linkArquivo(this ReceitaDespesaArquivoVW OLancamento)
        {
            int idOrganizacao = OLancamento.idOrganizacao.toInt();

            string basePath = idOrganizacao > 0 ? UtilConfig.linkAbsSistemaUpload(idOrganizacao) : $"{UtilConfig.linkAbsSistema}upload/";

            return(String.Concat(basePath, OLancamento.path));
        }
        //Link completo da imagem
        public static string linkFisico(this ArquivoUpload OArquivo, string localThumb = "")
        {
            int idOrganizacao = OArquivo.idOrganizacao.toInt();

            string basePath = idOrganizacao > 0 ? UtilConfig.pathAbsUpload(idOrganizacao) : $"{UtilConfig.pathAbsRaiz}upload/";

            return(String.Concat(basePath, OArquivo.pathImagem(localThumb).Replace("\\", "/")));
        }
Esempio n. 12
0
        //Inclusao da biblioteca
        public static MvcHtmlString includeToastCSS(this HtmlHelper helper)
        {
            StringBuilder htm       = new StringBuilder();
            var           urlHelper = new UrlHelper(helper.ViewContext.RequestContext);

            htm.Append("<link href=\"").Append(urlHelper.Content("" + UtilConfig.linkResourses() + "js/associatec/plugins/toastr/toastr.css")).Append("\" rel=\"stylesheet\" />");

            return(new MvcHtmlString(htm.ToString()));
        }
Esempio n. 13
0
        //Inclusao da biblioteca
        public static MvcHtmlString includeToastJS(this HtmlHelper helper)
        {
            StringBuilder htm       = new StringBuilder();
            var           urlHelper = new UrlHelper(helper.ViewContext.RequestContext);

            htm.Append("<script src=\"").Append(urlHelper.Content("" + UtilConfig.linkResourses() + "js/associatec/plugins/toastr/toastr.min.js")).Append("\"></script>");

            return(new MvcHtmlString(htm.ToString()));
        }
Esempio n. 14
0
        // GET: Utils
        public ActionResult Comuna(string _region)
        {
            if (string.IsNullOrEmpty(_region))
            {
                return(PartialView(new List <Clases.Comuna>()));
            }
            List <Clases.Comuna> comunas = UtilConfig.Comunas().Where(x => x.IdRegion.Equals(int.Parse(_region))).ToList();

            return(PartialView(comunas));
        }
Esempio n. 15
0
        //Inclusao da biblioteca padrão dhtmlxDiagram
        public static MvcHtmlString includeDhtmlxDiagram(this HtmlHelper helper)
        {
            StringBuilder htm       = new StringBuilder();
            var           urlHelper = new UrlHelper(helper.ViewContext.RequestContext);

            htm.Append("<link href=\"").Append(urlHelper.Content("" + UtilConfig.linkResourses() + "js/associatec/plugins/dhtmlx-diagram/diagram.css")).Append("\" rel=\"stylesheet\" />");
            htm.Append("<script src=\"").Append(urlHelper.Content("" + UtilConfig.linkResourses() + "js/associatec/plugins/dhtmlx-diagram/diagram.js")).Append("\"></script>");

            return(new MvcHtmlString(htm.ToString()));
        }
Esempio n. 16
0
        //INclusao de JSs necessarios para modulo de Arquivos
        public static MvcHtmlString includeJSModuloArquivos(this HtmlHelper helper)
        {
            System.Text.StringBuilder htm = new System.Text.StringBuilder();
            var urlHelper = new UrlHelper(helper.ViewContext.RequestContext);

            htm.Append("<script src=\"").Append(urlHelper.Content("" + UtilConfig.linkResourses() + "Areas/Arquivos/js/plugins/bootstrap-editable/bootstrap3-editable/js/bootstrap-editable.min.js")).Append("\"></script>");
            htm.Append("<script src=\"").Append(urlHelper.Content("" + UtilConfig.linkResourses() + "Areas/Arquivos/js/plugins/bootstrap-fileinput/js/fileinput.min.js")).Append("\"></script>");
            htm.Append("<script src=\"").Append(urlHelper.Content("" + UtilConfig.linkResourses() + "Areas/Arquivos/js/plugins/jqueryFancybox/jquery.fancybox.js")).Append("\"></script>");
            return(new MvcHtmlString(htm.ToString()));
        }
Esempio n. 17
0
        //Excluir através do ID do registro
        public virtual JsonMessageStatus excluir(int id)
        {
            var ORetorno = new JsonMessageStatus();

            var Objeto = this.carregar(id);

            if (Objeto == null)
            {
                ORetorno.error = true;

                ORetorno.message = "O registro informado não foi encontrado.";

                return(ORetorno);
            }

            string basePath = Objeto.idOrganizacao > 0 ? UtilConfig.pathAbsUpload(Objeto.idOrganizacao.toInt()) : UtilConfig.pathAbsUploadFiles;

            string pathFile = Path.Combine(basePath, UtilString.notNull(Objeto.path));

            if (File.Exists(pathFile))
            {
                File.Delete(pathFile);
            }

            string folderThumb = Path.Combine(basePath, UtilString.notNull(Objeto.pathThumb));

            if (Directory.Exists(folderThumb))
            {
                string [] listaDiretorios = Directory.GetDirectories(folderThumb);

                foreach (string nomeDiretorio in listaDiretorios)
                {
                    string diretorioArquivoThumb = Path.Combine(nomeDiretorio, UtilString.notNull(Objeto.nomeArquivo));

                    if (File.Exists(diretorioArquivoThumb))
                    {
                        File.Delete(diretorioArquivoThumb);
                    }
                }
            }

            Objeto.dtExclusao = DateTime.Now;

            Objeto.idUsuarioExclusao = HttpContextFactory.Current.User.id();

            db.SaveChanges();

            //db.ArquivoUpload.Where(x => x.id == id).Delete();

            ORetorno.error = false;

            ORetorno.message = "O arquivo foi removido com sucesso.";

            return(ORetorno);
        }
Esempio n. 18
0
        protected static void Log(bool save, string action, object id, object data, Type type)
        {
            if (!save)
            {
                return;
            }
            string json = Jsonlizer.ToJson(data, 20, true, true);  // 序列化为json,并跳过复杂的属性
            string txt  = string.Format("{0}: ID={1}, Type={2}, Data={3}", action, id, type, json);

            UtilConfig.Log("Database", txt);
        }
Esempio n. 19
0
        //INclusao de JSs necessarios para modulo de Arquivos
        public static MvcHtmlString includeJSModuloArquivosFotos(this HtmlHelper helper)
        {
            System.Text.StringBuilder htm = new System.Text.StringBuilder();
            var urlHelper = new UrlHelper(helper.ViewContext.RequestContext);

            htm.Append("<script src=\"").Append(urlHelper.Content("" + UtilConfig.linkResourses() + "js/associatec/plugins/jQueryUI/jquery-ui.js")).Append("\"></script>");
            htm.Append(helper.includeJSModuloArquivos());
            htm.Append("<script src=\"").Append(urlHelper.Content("" + UtilConfig.linkResourses() + "Areas/Arquivos/js/arquivo-foto.js")).Append("\"></script>");

            return(new MvcHtmlString(htm.ToString()));
        }
Esempio n. 20
0
        //
        public static MvcHtmlString includeDateRangePicker(this HtmlHelper helper)
        {
            StringBuilder htm       = new StringBuilder();
            var           urlHelper = new UrlHelper(helper.ViewContext.RequestContext);

            htm.Append("\t<link href=\"").Append(urlHelper.Content("" + UtilConfig.linkResourses("js/associatec/plugins/bootstrap-daterangepicker/daterangepicker.css"))).Append("\" rel=\"stylesheet\" />\n");
            htm.Append("\t\t<script src=\"").Append(urlHelper.Content("" + UtilConfig.linkResourses("js/associatec/plugins/bootstrap-daterangepicker/moment.js"))).Append("\"></script>\n");
            htm.Append("\t\t<script src=\"").Append(urlHelper.Content("" + UtilConfig.linkResourses("js/associatec/plugins/bootstrap-daterangepicker/daterangepicker.js"))).Append("\"></script>\n");

            return(new MvcHtmlString(htm.ToString()));
        }
Esempio n. 21
0
        //
        public static MvcHtmlString includeBootstrapMultiselect(this HtmlHelper helper)
        {
            StringBuilder htm       = new StringBuilder();
            var           urlHelper = new UrlHelper(helper.ViewContext.RequestContext);

            htm.Append("<link href=\"").Append(urlHelper.Content("" + UtilConfig.linkResourses() + "js/associatec/plugins/bootstrap-multiselect/bootstrap-multiselect.css")).Append("\" rel=\"stylesheet\" />");
            htm.Append("<link href=\"").Append(urlHelper.Content("" + UtilConfig.linkResourses() + "css/associatec/multiselect-custom.css")).Append("\" rel=\"stylesheet\" />");
            htm.Append("<script src=\"").Append(urlHelper.Content("" + UtilConfig.linkResourses() + "js/associatec/plugins/bootstrap-multiselect/bootstrap-multiselect.js")).Append("\"></script>");

            return(new MvcHtmlString(htm.ToString()));
        }
Esempio n. 22
0
        //
        public static MvcHtmlString includeDatePicker(this HtmlHelper helper)
        {
            StringBuilder htm       = new StringBuilder();
            var           urlHelper = new UrlHelper(helper.ViewContext.RequestContext);

            htm.Append("<link href=\"").Append(urlHelper.Content("" + UtilConfig.linkResourses() + "js/associatec/plugins/bootstrap-datepicker/css/datepicker3.css")).Append("\" rel=\"stylesheet\" />");
            htm.Append("<script src=\"").Append(urlHelper.Content("" + UtilConfig.linkResourses() + "js/associatec/plugins/bootstrap-datepicker/js/bootstrap-datepicker.js?v=1")).Append("\"></script>");
            htm.Append("<script src=\"").Append(urlHelper.Content("" + UtilConfig.linkResourses() + "js/associatec/plugins/bootstrap-datepicker/js/locales/bootstrap-datepicker.pt-BR.js")).Append("\"></script>");

            return(new MvcHtmlString(htm.ToString()));
        }
Esempio n. 23
0
        //
        public static MvcHtmlString includeFroalaEditorJSCustom(this HtmlHelper helper)
        {
            StringBuilder htm = new StringBuilder();

            var urlHelper = new UrlHelper(helper.ViewContext.RequestContext);

            htm.Append(helper.includeFroalaEditorJS());

            htm.Append("<script src=\"").Append(urlHelper.Content(UtilConfig.linkResourses("js/associatec/froala-custom.js?v=1.0"))).Append("\"></script>");

            return(new MvcHtmlString(htm.ToString()));
        }
Esempio n. 24
0
        //
        public static MvcHtmlString includeSelect2(this HtmlHelper helper)
        {
            StringBuilder htm = new StringBuilder();

            var urlHelper = new UrlHelper(helper.ViewContext.RequestContext);

            htm.Append("<link href=\"").Append(urlHelper.Content("" + UtilConfig.linkResourses() + "js/associatec/plugins/autocomplete/select2-4.0/css/select2.css")).Append("\" rel=\"stylesheet\" />");
            htm.Append("<script src=\"").Append(urlHelper.Content("" + UtilConfig.linkResourses() + "js/associatec/plugins/autocomplete/select2-4.0/js/select2.full.js")).Append("\"></script>");
            htm.Append("<script src=\"").Append(urlHelper.Content("" + UtilConfig.linkResourses() + "js/associatec/plugins/autocomplete/autocomplete.js")).Append("\"></script>");

            return(new MvcHtmlString(htm.ToString()));
        }
Esempio n. 25
0
        //
        public static MvcHtmlString includeDataTable(this HtmlHelper helper)
        {
            StringBuilder htm = new StringBuilder();

            var urlHelper = new UrlHelper(helper.ViewContext.RequestContext);

            htm.Append("<link href=\"").Append(urlHelper.Content("" + UtilConfig.linkResourses() + "js/associatec/plugins/datatables/jquery.dataTables.css")).Append("\" rel=\"stylesheet\" />");
            htm.Append("<link href=\"").Append(urlHelper.Content("" + UtilConfig.linkResourses() + "js/associatec/plugins/datatables/extensions/ColVis/css/dataTables.colVis.min.css")).Append("\" rel=\"stylesheet\" />");
            htm.Append("<script src=\"").Append(urlHelper.Content("" + UtilConfig.linkResourses() + "js/associatec/plugins/datatables/jquery.dataTables.js")).Append("\"></script>");
            htm.Append("<script src=\"").Append(urlHelper.Content("" + UtilConfig.linkResourses() + "js/associatec/plugins/datatables/extensions/ColVis/js/dataTables.colVis.min.js")).Append("\"></script>");

            return(new MvcHtmlString(htm.ToString()));
        }
Esempio n. 26
0
    private bool CheckValueType()
    {
        bool bTypeConfig = true;

        for (int i = 0; i < m_arrTypes.Length; i++)
        {
            if (!UtilConfig.CheckType(m_arrTypes[i]))//数值类型输入不符合
            {
                bTypeConfig = false;
                Debug.LogError("导入表:" + m_strName + "变量" + m_arrVariables[i] + "类型配置" + m_arrTypes[i] + "有误");
            }
        }
        return(bTypeConfig);
    }
Esempio n. 27
0
        //Inclusao da biblioteca
        public static MvcHtmlString includeFileApiJS(this HtmlHelper helper)
        {
            StringBuilder htm = new StringBuilder();

            var urlHelper = new UrlHelper(helper.ViewContext.RequestContext);

            htm.Append("<script src=\"").Append(urlHelper.Content("" + UtilConfig.linkResourses() + "js/associatec/plugins/jquery.fileapi/jquery.fileapi.config.js")).Append("\"></script>");
            htm.Append("<script src=\"").Append(urlHelper.Content("" + UtilConfig.linkResourses() + "js/associatec/plugins/jquery.fileapi//FileAPI/FileAPI.min.js")).Append("\"></script>");
            htm.Append("<script src=\"").Append(urlHelper.Content("" + UtilConfig.linkResourses() + "js/associatec/plugins/jquery.fileapi/FileAPI/FileAPI.exif.js")).Append("\"></script>");
            htm.Append("<script src=\"").Append(urlHelper.Content("" + UtilConfig.linkResourses() + "js/associatec/plugins/jquery.fileapi/jquery.fileapi.min.js")).Append("\"></script>");
            htm.Append("<script src=\"").Append(urlHelper.Content("" + UtilConfig.linkResourses() + "js/associatec/plugins/jquery.fileapi/jcrop/jquery.Jcrop.min.js")).Append("\"></script>");

            return(new MvcHtmlString(htm.ToString()));
        }
Esempio n. 28
0
        //
        public UtilRetorno enviar(Pedido OPedido)
        {
            Dictionary <string, object> infos = new Dictionary <string, object>();

            infos["idPedido"] = OPedido.id.ToString();

            infos["linkPgto"] = UtilConfig.linkPgtoTitulo(OPedido.TituloReceita.id);

            infos["nomePessoa"] = OPedido.nomePessoa;

            string tituloEmail = string.Format("{0} - Pedido {1} recebido", OConfiguracaoSistema.tituloSistema, infos["idPedido"]);

            return(this.enviar(infos, tituloEmail));
        }
Esempio n. 29
0
        //Eventos

        //
        public FileResult index(int idNum, string idCrypt)
        {
            var idCryptCompare = UtilCrypt.SHA512(idNum.ToString());

            if (idCryptCompare != idCrypt)
            {
                Response.Write("A Url informada não é válida.");
                return(null);
            }

            if (User.idOrganizacao() == 0)
            {
                Response.Write("Você não tem permissão para acessar essa página.");
                return(null);
            }

            var OArquivo = this.OArquivoUploadBL.carregar(idNum);

            if (OArquivo == null)
            {
                Response.Write("O arquivo não foi encontrado.");
                return(null);
            }

            if (OArquivo.idOrganizacao != User.idOrganizacao())
            {
                Response.Write("Você não tem permissão para acessar essa página.");
            }

            int idOrganizacao = OArquivo.idOrganizacao.toInt();

            string basePath = idOrganizacao > 0 ? UtilConfig.pathAbsUpload(idOrganizacao) : $"{UtilConfig.pathAbsUploadFiles}upload/";

            string pathArquivo = OArquivo.path.Replace("\\", "/");

            string pathCompletoArquivo = String.Concat(basePath, pathArquivo);

            if (!System.IO.File.Exists(pathCompletoArquivo))
            {
                Response.Write("O arquivo não foi encontrado.");
                return(null);
            }

            string nomeDownload = string.Concat((OArquivo.titulo.isEmpty() ? "download" : OArquivo.titulo), OArquivo.extensao);

            return(File(pathCompletoArquivo, OArquivo.contentType, nomeDownload));
        }
Esempio n. 30
0
        // 日志
        private static void Log <T>(DbCommand command, DbCommandInterceptionContext <T> interceptionContext)
        {
            var duration = Stop(command);
            var txt      = string.Format("{0}\r\n耗时:{1} ms", command.GetCommandText(), duration.TotalMilliseconds);

            if (duration.TotalSeconds > 1 || interceptionContext.Exception != null)
            {
                // 异常日志
                txt = string.Format("数据库异常:{0} \r\n{1} ", txt, interceptionContext.Exception?.Message);
                UtilConfig.Log("Database", txt, 1);  // 注意不能存储在数据库中,会造成无限递归错误
            }
            else
            {
                // 普通日志
                //Logger.Log(txt);
            }
        }