Example #1
0
        public SendEmail(Form1 f1, DataGridView d, string num)
        {
            InitializeComponent();
            this.f1     = f1;
            reader      = new DBWork.dbReader(int.Parse(num));
            label1.Text = reader.Surname + " " + reader.Name + " " + reader.SecondName;
            label2.Text = "Дата последней отправки письма: " + f1.dbw.GetLastEmailDate(num);
            if (d.Rows.Count == 0)
            {
                MessageBox.Show("За читателем не числится долгов!");
                canshow = false;
                return;
            }
            rtb.Text = "";
            Email    = reader.GetEmail();

            if (Email == "")
            {
                MessageBox.Show("Email не существует или имеет неверный формат!");
                canshow = false;
                return;
            }
            canshow = true;
            GetTextBoxText(reader, d);
            //richTextBox1.Select(10, 10);
            //richTextBox1.SelectionFont = new Font(richTextBox1.Font, FontStyle.Bold);
            foreach (int i in bold)
            {
                rtb.Select(i, 10);
                rtb.SelectionFont = new Font(rtb.Font, FontStyle.Bold);
            }
            htmltext = SendEmail.ConvertRtfToHtml(rtb.Rtf);
        }