예제 #1
0
        private void ValidDocumentSE(string documentIdPrimary, out int status)
        {
            try
            {
                documentDataReturn documentDataReturn = seClient.viewDocumentData(documentIdPrimary, "", "", "");

                if (documentDataReturn.ERROR == null)
                {
                    eletronicFile[] eletronicFiles = seClient.downloadEletronicFile(documentDataReturn.IDDOCUMENT, "", "", "", "", "", "", "1");

                    if (!eletronicFiles.Any(x => x.ERROR != null))
                    {
                        status = 3;//Document exists with file
                    }
                    else
                    {
                        status = 2;//Document exists without file
                    }
                }
                else
                {
                    status = 1;//Document does not exist
                }
            }
            catch (Exception ex)
            {
                File.AppendAllText(string.Format("{0}\\Error_{1}.txt", pathLog, DateTime.Now.ToString("yyyyMMdd")), string.Format("**** Método: ValidDocumentSE. Arquivo sendo enviado para o SE (Erro {0}): {1}. Fim: {2} ****", ex.Message, documentIdPrimary, DateTime.Now.ToString("dd/MM/yyyy HH:mm:ss")) + Environment.NewLine);
                throw new Exception("ValidDocumentSE");
            }
        }
예제 #2
0
 public static string DeletDocument(string IDCATEGORY, string IdDocumento)
 {
     try
     {
         //string caminho = "C:\Tecfy2SE-RH";
         SEClient SeachDoc = Conection.GetConnection();
         var      strijjj  = SeachDoc.downloadEletronicFile(IdDocumento, "", "", "", "", "", "", "");
         return("false");
     }
     catch (Exception ex)
     {
         var logpath = ConfigurationManager.AppSettings["PastaDestinoLog"].ToString();
         File.AppendAllText(logpath + @"\" + "log_Excluir_Documentos.txt", "\r\n" + DateTime.Now + @" | DeletDoc " + ex.Message.ToString() + @";");
         return("");
     }
 }