Exemple #1
0
        private void Send_SummaryReport_ExecuteCode(object sender, EventArgs e)
        {
            string nazwaBiura = DB.admSetup.GetValue(workflowProperties.Web, "BR_NAZWA");

            StringBuilder sb = new StringBuilder();

            foreach (Recipient recipient in alRecipients)
            {
                sb.Append(recipient.GetBody(string.Empty));
                sb.Append("<hr>");
            }

            if (!oMsg.Body.Contains("[[Body]]"))
            {
                oMsg.Body = oMsg.Body + "[[Body]]";
            }
            StringBuilder sb2 = new StringBuilder(oMsg.Body);

            sb2.Replace("[[Body]]", sb.ToString());

            sb2.Replace("[[NazwaBiura]]", nazwaBiura);

            oMsg.Body       = sb2.ToString();
            oMsg.IsBodyHtml = true;

            SPListItem m = WysylkaMonitu.Send(workflowProperties.Web, oMsg, 0);

            HistoryDescription = string.Format("Raport zbiorczy wysłany do {0}", oMsg.To[0].Address);
            HistoryOutcome     = string.Format("MessageId={0}", m.ID);
        }
Exemple #2
0
        private void Create_RecipientsReports_ExecuteCode(object sender, EventArgs e)
        {
            string nazwaBiura = DB.admSetup.GetValue(workflowProperties.Web, "BR_NAZWA");

            foreach (Recipient recipient in alRecipients)
            {
                MailMessage msg = new MailMessage()
                {
                    Subject = recipient.GetSubject(),
                    Body    = recipient.GetBody(WysylkaMonitu.Get_MessageLayout(workflowProperties.Web)),
                };
                foreach (MailAddress ma in recipient.To())
                {
                    msg.To.Add(ma);
                }

                StringBuilder sb = new StringBuilder(msg.Body);
                sb.Replace("[[NazwaBiura]]", nazwaBiura);

                msg.Body       = sb.ToString();
                msg.IsBodyHtml = true;

                //add standard layout
                sb = new StringBuilder(BLL.dicSzablonyKomunikacji.Get_HTMLByKod(workflowProperties.Web, "EMAIL_DEFAULT_BODY"));
                sb.Replace("___FOOTER___", string.Empty);
                sb.Replace("___BODY___", msg.Body);
                msg.Body = sb.ToString();

                SPListItem m = WysylkaMonitu.Send(workflowProperties.Web, msg, recipient.ID);
            }
        }
Exemple #3
0
        private void Validate_Recipients_ExecuteCode(object sender, EventArgs e)
        {
            Array aKlienci = WysylkaMonitu.Get_ListaAktywnychKlientow(workflowProperties.Web);

            alRecipients = new ArrayList();
            foreach (int r in alRecipientIds)
            {
                foreach (SPListItem item in aKlienci)
                {
                    if (item.ID == r)
                    {
                        // dodaj do listy odbiorców
                        Models.Recipient newRecipient = new Models.Recipient
                        {
                            ID               = r,
                            Email            = Tools.GetText(item, "colEmail"),
                            NazwaWyswietlana = Tools.GetText(item, "_NazwaPrezentowana")
                        };

                        if (!string.IsNullOrEmpty(newRecipient.Email))
                        {
                            alRecipients.Add(newRecipient);
                        }
                    }
                }
            }

            alRecipientIds = null;
        }
Exemple #4
0
        private MailMessage InitMessage(string subject)
        {
            oMsg = new MailMessage()
            {
                Subject = subject,
                Body    = WysylkaMonitu.Get_MessageLayout(workflowProperties.Web)
            };
            oMsg.To.Add(new MailAddress(workflowProperties.OriginatorEmail));

            return(oMsg);
        }
Exemple #5
0
 private void Select_TargetList_ExecuteCode(object sender, EventArgs e)
 {
     aNierozliczoneRekordy = WysylkaMonitu.Get_NierozliczoneRekordy(workflowProperties.Web);
 }