using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; using YARTE.UI.Buttons; namespace FEQ0000.Purchase { public partial class fMailForm : Form { string Cate = string.Empty; public fMailForm(string cate) { InitializeComponent(); Properties.Settings.Default["gwcs"] = FCOMMON.info.CS; Properties.Settings.Default["EEEntities"] = FCOMMON.info.CS; PredefinedButtonSets.SetupDefaultButtons(this.htmlEditor1); Cate = cate; } public fMailForm(string subject, string body, string to, string cc, string bcc) { InitializeComponent(); Properties.Settings.Default["gwcs"] = FCOMMON.info.CS; Properties.Settings.Default["EEEntities"] = FCOMMON.info.CS; Cate = ""; this.tbSubject.Text = subject; this.tbTo.Text = to; this.tbCC.Text = cc; this.tbBcc.Text = bcc; htmlEditor1.Html = body; } private void fMailForm_Load(object sender, EventArgs e) { if (Cate.isEmpty() == false) { var db = new DataClasses1DataContext(); var mailform = db.MailForm.Where(t => t.gcode == FCOMMON.info.Login.gcode && t.cate == Cate).ToList(); this.cmbForm.DataSource = mailform; this.cmbForm.DisplayMember = "title"; this.cmbForm.ValueMember = "idx"; } else this.cmbForm.Enabled = false; } private void comboBox1_SelectedIndexChanged(object sender, EventArgs e) { var item = this.cmbForm.SelectedItem as MailForm; this.tbSubject.Text = item.subject; this.tbTo.Text = item.tolist; this.tbCC.Text = item.cc; this.tbBcc.Text = item.bcc; this.htmlEditor1.Html = item.body; } private void button1_Click(object sender, EventArgs e) { DialogResult = DialogResult.OK; } } }