public frmHandleAnnoucement(Form announce, Announcement _Announcement = null)
 {
     InitializeComponent();
     Announcement         = _Announcement;
     txtTitle.Text        = Announcement.title;
     txtContent.Text      = Announcement.content;
     dtpAnnouceDate.Value = new DateTime(Announcement.senddate.Year, Announcement.senddate.Month, Announcement.senddate.Day);
     announcer            = (frmAnnouncer)announce;
     if (Announcement.recipient == "All")
     {
         chkAll.Checked          = true;
         chklstRecipient.Enabled = false;
     }
     else
     {
         string[] recipients = Announcement.recipient.Split(';');
         foreach (string rec in recipients)
         {
             if (rec != "")
             {
                 for (int a = 0; a < chklstRecipient.Items.Count; a++)
                 {
                     if (chklstRecipient.Items[a].ToString() == "Grade" + rec)
                     {
                         chklstRecipient.SetItemChecked(int.Parse(rec) - 7, true);
                     }
                 }
             }
         }
     }
     IsAdd = false;
 }
Beispiel #2
0
        private void frmLogin_Load(object sender, EventArgs e)
        {
            frm = new frmAnnouncer();
            frmAttendanceSender frmAttendance = new frmAttendanceSender();

            frm.Show();
            frmAttendance.Show();
        }