Beispiel #1
0
        public bool BorraDocumento(string User, string Password, int DocId)
        {
            int  session = 0;
            Ewsm ePower  = null;

            try
            {
                log = new Bitacorizador();
                log.LogInfo("DeleteDocument con los siguientes parámetros:");
                //Cargado de los parametros del config.
                //string epUser = Properties.Settings.Default.epowerUser;
                //string epPass = Properties.Settings.Default.epowerPassword;
                int appId   = Properties.Settings.Default.appId;
                int doctype = Properties.Settings.Default.doctype;
                int query   = Properties.Settings.Default.query;
                log.LogInfo("Usuario: " + User + "appId: " + appId + " Doctype: " + doctype + " Query: " + query);
                log.LogInfo("Con los siguientes Indices: ");
                log.LogInfo("DocId: " + DocId);
                ePower = new Ewsm();
                log.LogInfo("Inicia Login hacia ePower");
                try
                {
                    session = ePower.doLogin(User, Password, "eAccess");
                }
                catch (Exception ex)
                {
                    throw new Exception("Error al autenticarse con ePower: Imposible autenticarse con ePower, verifique sus credenciales y conexión a ePower. " + ex.Message);
                }
                log.LogInfo("Eliminando Documento...");
                ePower.delFullDocument(session, appId, doctype, query, DocId);
                return(true);
            }
            catch (Exception ex)
            {
                log = new Bitacorizador();
                log.LogError("Error al ejecutar el método: DeleteDocument, Detalles " + "Mensaje: " + ex.Message + " StackTrace: " + ex.StackTrace);
                throw new Exception("Error al ejecutar el método: DeleteDocument, Detalles " + "Mensaje: " + ex.Message + " StackTrace: " + ex.StackTrace);
            }
            finally
            {
                ePower.doLogout(session);
            }
        }