コード例 #1
0
        public JsonResult GetTextoWordDocModelo(long IdModeloDoc)
        {
            bool          resp    = false;
            StringBuilder texto   = new StringBuilder();
            string        message = string.Empty;

            try
            {
                string serverPath = Server.MapPath("~");

                using (AppServiceAtos appServ = new AppServiceAtos(this.UfwCartNew, this.IdCtaAcessoSist))
                {
                    texto = appServ.GetTextoWordDocModelo(IdModeloDoc, serverPath);
                }

                resp = true;
            }
            catch (Exception ex)
            {
                TypeInfo t = this.GetType().GetTypeInfo();
                IOFunctions.GerarLogErro(t, ex);
                message = "Falha GetTextoWordDocModelo[" + ex.Message + "]";
            }

            var resultado = new
            {
                resposta  = resp,
                msg       = message,
                TextoHtml = texto.ToString()
            };

            return(Json(resultado));
        }