Ejemplo n.º 1
0
 private void butDeleteTemplate_Click(object sender, System.EventArgs e)
 {
     if (listTemplates.SelectedIndex == -1)
     {
         MessageBox.Show(Lan.g(this, "Please select an item first."));
         return;
     }
     if (MessageBox.Show(Lan.g(this, "Delete e-mail template?"), "", MessageBoxButtons.OKCancel)
         != DialogResult.OK)
     {
         return;
     }
     EmailTemplates.Delete(EmailTemplates.List[listTemplates.SelectedIndex]);
     EmailTemplates.Refresh();
     templatesChanged = true;
     FillList();
 }
Ejemplo n.º 2
0
        private void listTemplates_DoubleClick(object sender, System.EventArgs e)
        {
            if (listTemplates.SelectedIndex == -1)
            {
                return;
            }
            FormEmailTemplateEdit FormE = new FormEmailTemplateEdit();

            FormE.ETcur = EmailTemplates.List[listTemplates.SelectedIndex];
            FormE.ShowDialog();
            if (FormE.DialogResult != DialogResult.OK)
            {
                return;
            }
            EmailTemplates.Refresh();
            templatesChanged = true;
            FillList();
        }
Ejemplo n.º 3
0
 private void butOK_Click(object sender, System.EventArgs e)
 {
     if (textSubject.Text == "" && textBodyText.Text == "")
     {
         MsgBox.Show(this, "Both the subject and body of the template cannot be left blank.");
         return;
     }
     if (textDescription.Text == "")
     {
         MsgBox.Show(this, "Please enter a description.");
         return;
     }
     ETcur.Subject     = textSubject.Text;
     ETcur.BodyText    = textBodyText.Text;       //always save as plain text version. We will translate to html on loading.
     ETcur.Description = textDescription.Text;
     if (!webBrowserHtml.Visible)
     {
         ETcur.TemplateType = EmailType.Regular;
     }
     else
     {
         ETcur.TemplateType = EmailType.Html;
         if (_isRaw)
         {
             ETcur.TemplateType = EmailType.RawHtml;
         }
     }
     if (IsNew)
     {
         EmailTemplates.Insert(ETcur);
     }
     else
     {
         EmailTemplates.Update(ETcur);
     }
     foreach (EmailAttach attachment in _listEmailAttachDisplayed)
     {
         attachment.EmailTemplateNum = ETcur.EmailTemplateNum;
     }
     //Sync the email attachments and pass in an emailMessageNum of 0 because we will be providing _listEmailAttachOld.
     EmailAttaches.Sync(0, _listEmailAttachDisplayed, _listEmailAttachOld);
     DialogResult = DialogResult.OK;
 }
Ejemplo n.º 4
0
 private void butOK_Click(object sender, System.EventArgs e)
 {
     if (textSubject.Text == "" && textBodyText.Text == "")
     {
         MessageBox.Show(Lan.g(this, "Both can not be left blank."));
         return;
     }
     ETcur.Subject  = textSubject.Text;
     ETcur.BodyText = textBodyText.Text;
     if (IsNew)
     {
         EmailTemplates.Insert(ETcur);
     }
     else
     {
         EmailTemplates.Update(ETcur);
     }
     DialogResult = DialogResult.OK;
 }