示例#1
0
        public bool ExportSessions(string sExportFormat, Session[] oSessions, Dictionary <string, object> dictOptions, EventHandler <ProgressCallbackEventArgs> evtProgressNotifications)
        {
            IList <string> attachments = new List <string>();

            foreach (Session item in oSessions)
            {
                string file = Path.Combine(Path.GetTempPath(), item.id + ".txt");
                File.WriteAllText(file, item.ToString());
                attachments.Add(file);


                XmlDocument doc = new XmlDocument();
                try {
                    doc.Load(new MemoryStream(item.RequestBody));

                    file = Path.Combine(Path.GetTempPath(), "request_" + item.id + ".xml");
                    doc.Save(file);

                    attachments.Add(file);

                    doc.Load(new MemoryStream(item.ResponseBody));

                    file = Path.Combine(Path.GetTempPath(), "response_" + item.id + ".xml");
                    doc.Save(file);

                    attachments.Add(file);
                } catch
                {
                    //dann nicht :-);
                }
            }


            Application oApp      = new Application();
            _MailItem   oMailItem = (_MailItem)oApp.CreateItem(OlItemType.olMailItem);


            foreach (var item in attachments)
            {
                oMailItem.Attachments.Add((object)item, OlAttachmentType.olEmbeddeditem, 1, (object)"Attachment");
            }

            oMailItem.Display();

            return(true);
        }
示例#2
0
 public static void OpenEmail(string address)
 {
     if (IsOutLookOpen() == false)
     {
         Helpers.DefaultMessegeBox("תוכנת האאוטלוק סגורה, אנא פתח אותה", "IBJJL", System.Windows.Forms.MessageBoxIcon.Stop);
         return;
     }
     try
     {
         Application oApp      = new Application();
         _MailItem   oMailItem = (MailItem)oApp.CreateItem(OlItemType.olMailItem);
         oMailItem.To      = address;
         oMailItem.Subject = "הודעה מ IBJJL";
         oMailItem.Display(true);
     }
     catch
     {
     }
 }
示例#3
0
 public void enviaCorreo(bool _enviar, string _recipient, List <string> _olCCrecipients, string _subject, string _body)
 {
     try
     {
         char[] chArray = new char[1] {
             ';'
         };
         string[] strArray = (string[])null;
         // ISSUE: variable of a compiler-generated type
         Microsoft.Office.Interop.Outlook.Application instance = (Microsoft.Office.Interop.Outlook.Application)Activator.CreateInstance(Type.GetTypeFromCLSID(new Guid("0006F03A-0000-0000-C000-000000000046")));
         // ISSUE: reference to a compiler-generated field
         if (EnviarCorreo.\u003CenviaCorreo\u003Eo__SiteContainer6.\u003C\u003Ep__Site7 == null)
         {
             // ISSUE: reference to a compiler-generated field
             EnviarCorreo.\u003CenviaCorreo\u003Eo__SiteContainer6.\u003C\u003Ep__Site7 = CallSite <Func <CallSite, object, _MailItem> > .Create(Microsoft.CSharp.RuntimeBinder.Binder.Convert(CSharpBinderFlags.ConvertExplicit, typeof(_MailItem), typeof(EnviarCorreo)));
         }
         // ISSUE: reference to a compiler-generated field
         // ISSUE: reference to a compiler-generated field
         // ISSUE: reference to a compiler-generated method
         // ISSUE: variable of a compiler-generated type
         _MailItem mailItem = EnviarCorreo.\u003CenviaCorreo\u003Eo__SiteContainer6.\u003C\u003Ep__Site7.Target((CallSite)EnviarCorreo.\u003CenviaCorreo\u003Eo__SiteContainer6.\u003C\u003Ep__Site7, instance.CreateItem(OlItemType.olMailItem));
         // ISSUE: variable of a compiler-generated type
         Inspector getInspector = mailItem.GetInspector;
         // ISSUE: variable of a compiler-generated type
         Recipients recipients = mailItem.Recipients;
         foreach (string olCcrecipient in _olCCrecipients)
         {
             if (!string.IsNullOrEmpty(olCcrecipient))
             {
                 // ISSUE: reference to a compiler-generated method
                 // ISSUE: variable of a compiler-generated type
                 Recipient recipient = recipients.Add(olCcrecipient);
                 recipient.Type = 2;
                 // ISSUE: reference to a compiler-generated method
                 recipient.Resolve();
             }
         }
         if (!string.IsNullOrEmpty(_recipient))
         {
             strArray = _recipient.Split(chArray);
         }
         if (strArray != null && strArray.Length != 0)
         {
             foreach (string Name in strArray)
             {
                 // ISSUE: reference to a compiler-generated method
                 // ISSUE: variable of a compiler-generated type
                 Recipient recipient = recipients.Add(Name);
                 recipient.Type = 1;
                 // ISSUE: reference to a compiler-generated method
                 recipient.Resolve();
             }
         }
         mailItem.Subject  = _subject;
         mailItem.HTMLBody = _body + mailItem.HTMLBody;
         if (_enviar)
         {
             // ISSUE: reference to a compiler-generated method
             mailItem.Send();
         }
         else
         {
             // ISSUE: reference to a compiler-generated method
             mailItem.Display((object)true);
         }
     }
     catch (Exception ex)
     {
         int num = (int)MessageBox.Show("Error durante el proceso del Envío del Correo: " + ex.Message, "Error Interno", MessageBoxButtons.OK, MessageBoxIcon.Hand);
     }
     Thread.Sleep(10000);
 }
示例#4
0
 public void enviaCorreo(ObservableCollection <Entidad> _olBCCRecipients, string _recipient, string _subject, string _body)
 {
     try
     {
         char[] chArray = new char[1] {
             ';'
         };
         // ISSUE: variable of a compiler-generated type
         Microsoft.Office.Interop.Outlook.Application instance = (Microsoft.Office.Interop.Outlook.Application)Activator.CreateInstance(Type.GetTypeFromCLSID(new Guid("0006F03A-0000-0000-C000-000000000046")));
         // ISSUE: reference to a compiler-generated field
         enviaCorreo.c
         if (EnviarCorreo.\u003CenviaCorreo\u003Eo__SiteContainer0.\u003C\u003Ep__Site1 == null)
         {
             // ISSUE: reference to a compiler-generated field
             EnviarCorreo.\u003CenviaCorreo\u003Eo__SiteContainer0.\u003C\u003Ep__Site1 = CallSite <Func <CallSite, object, _MailItem> > .Create(Microsoft.CSharp.RuntimeBinder.Binder.Convert(CSharpBinderFlags.ConvertExplicit, typeof(_MailItem), typeof(EnviarCorreo)));
         }
         // ISSUE: reference to a compiler-generated field
         // ISSUE: reference to a compiler-generated field
         // ISSUE: reference to a compiler-generated method
         // ISSUE: variable of a compiler-generated type
         _MailItem mailItem = EnviarCorreo.\u003CenviaCorreo\u003Eo__SiteContainer0.\u003C\u003Ep__Site1.Target((CallSite)EnviarCorreo.\u003CenviaCorreo\u003Eo__SiteContainer0.\u003C\u003Ep__Site1, instance.CreateItem(OlItemType.olMailItem));
         // ISSUE: variable of a compiler-generated type
         Inspector getInspector = mailItem.GetInspector;
         bool      flag         = true;
         string    str1         = "";
         // ISSUE: variable of a compiler-generated type
         Recipients recipients = mailItem.Recipients;
         using (IEnumerator <Entidad> enumerator = _olBCCRecipients.GetEnumerator())
         {
             while (((IEnumerator)enumerator).MoveNext())
             {
                 Entidad current = enumerator.Current;
                 if (string.IsNullOrEmpty(current.get_ENTC_EMail()))
                 {
                     flag = false;
                     str1 = str1 + "* " + current.get_ENTC_NomCompleto() + Environment.NewLine;
                 }
                 else
                 {
                     string[] strArray = current.get_ENTC_EMail().Split(chArray);
                     if (strArray != null && strArray.Length != 0)
                     {
                         foreach (string str2 in strArray)
                         {
                             if (!string.IsNullOrEmpty(str2.Trim()))
                             {
                                 // ISSUE: reference to a compiler-generated method
                                 // ISSUE: variable of a compiler-generated type
                                 Recipient recipient = recipients.Add(str2.Trim());
                                 recipient.Type = 3;
                                 // ISSUE: reference to a compiler-generated method
                                 recipient.Resolve();
                             }
                         }
                     }
                 }
             }
         }
         if (!flag)
         {
             int num = (int)Dialogos.MostrarMensajeInformacion("Entidades sin Email", "A las siguientes Entidad no fueron incluidos para el envio de este correo por no tener un Email (Ver Detalles).", str1);
         }
         // ISSUE: reference to a compiler-generated method
         // ISSUE: variable of a compiler-generated type
         Recipient recipient1 = recipients.Add(_recipient.Trim());
         // ISSUE: reference to a compiler-generated method
         recipient1.Resolve();
         mailItem.Subject  = _subject;
         mailItem.HTMLBody = _body + mailItem.HTMLBody;
         // ISSUE: reference to a compiler-generated method
         mailItem.Display((object)true);
     }
     catch (Exception ex)
     {
         int num = (int)MessageBox.Show("Error durante el proceso del Envío del Correo: " + ex.Message, "Error Interno", MessageBoxButtons.OK, MessageBoxIcon.Hand);
     }
 }