Example #1
0
       public IList<MessagePool> Select(MessagePool data)
       {
 
               IList<MessagePool> datos = new List<MessagePool>();
               datos = GetHsql(data).List<MessagePool>();
               if (!Factory.IsTransactional)
                   Factory.Commit();
               return datos;
           
       }
        public override Boolean Equals(object obj)
        {
            if ((obj == null) || (obj.GetType() != this.GetType()))
            {
                return(false);
            }
            MessagePool castObj = (MessagePool)obj;

            return((castObj != null) &&
                   (this.RowID == castObj.RowID));
        }
Example #3
0
        public static bool SendEmail(MessagePool message, string[] attachments) {

            try
            {

                if (string.IsNullOrEmpty(message.MailTo))
                    return true;

                SetMailOptions();

                message.Message =  HtmlEnvelope.Replace("__CONTENT", message.Message);

                MailMessage objMessage = new MailMessage();

                objMessage.From = new MailAddress(message.MailFrom);

                try
                {
                    foreach (String address in message.MailTo.Split(';'))
                        objMessage.To.Add(address.Trim());
                }
                catch { return true; }
                
                objMessage.Subject = message.Subject;
                objMessage.Body = message.Message;

                // CAA [2010/07/27] adjuntos del correo}
                try
                {
                    foreach (string adj in attachments)
                    {
                        Attachment att = new Attachment(adj);
                        objMessage.Attachments.Add(att);
                    }
                }
                catch { }


                objMessage.IsBodyHtml = true;

                //objMessage.Priority = MailPriority.High;

                SmtpClient smtpClient = new SmtpClient(Server);

                if (string.IsNullOrEmpty(User))
                    smtpClient.UseDefaultCredentials = true;

                else
                {
                    smtpClient.UseDefaultCredentials = false;
                    smtpClient.Credentials = new NetworkCredential(User, Password, Domain);
                }


                if (EnableSSL)
                    smtpClient.EnableSsl = true;

                smtpClient.Send(objMessage);
                return true;
            }
            catch (Exception ex)
            {
                ExceptionMngr.WriteEvent("SendEmail: ", ListValues.EventType.Fatal, ex, null, ListValues.ErrorCategory.Messages);
                return false;
            }


        }
Example #4
0
 public MessagePool SelectById(MessagePool data)
 {
     return (MessagePool)base.SelectById(data);
 }
Example #5
0
 public Boolean Delete(MessagePool data)
 {
     return base.Delete(data);
 }
Example #6
0
 public Boolean Update(MessagePool data)
 {
     return base.Update(data);
 }
Example #7
0
 public MessagePool Save(MessagePool data)
 {
     return (MessagePool)base.Save(data);
 }