Esempio n. 1
0
        public static eAjax fnEliminaDocumento(int sCodigo, string sRuta)
        {
            eAjax oeAjax = new eAjax();

            System.Web.HttpContext context = System.Web.HttpContext.Current;
            context.Response.ContentType = "application/json";
            if (HttpContext.Current.Session["leSeguridad"] == null)
            {
                oeAjax.iTipoResultado = 99;
                oeAjax.sMensajeError  = "Fin Session";
                return(oeAjax);
            }
            try
            {
                DocumentosDAO dao    = new DocumentosDAO();
                var           result = dao.fnEliminaDocumento(sCodigo);
                if (result >= 1)
                {
                    DeleteFile("ftp://ftp.site4now.net" + sRuta, "xxeguxx-001", "tornadesco.1");
                    oeAjax.iTipoResultado = 1;
                }
                else
                {
                    oeAjax.iTipoResultado = -1;
                    oeAjax.sMensajeError  = "Ocurrio Un Error Al Eliminar Documento";
                }
            }
            catch (Exception ex) {
                oeAjax.sMensajeError = ex.Message;
            }

            return(oeAjax);
        }