private void btnNewEntry_Click(object sender, EventArgs e)
 {
     CtrlCurEntry ctrlEntry = new CtrlCurEntry(ClassId, PeriodId, EntryRemoved);
     ctrlEntry.Dock = DockStyle.Top;
     ctrlEntry.Width = pnlMain.ClientSize.Width;
     pnlMain.Controls.Add(ctrlEntry);
     ctrlEntry.BringToFront();
     ResizeControl();
 }
 private void Init()
 {
     SuspendLayout();
     pnlMain.Controls.Clear();
     string query = string.Format("SELECT * FROM class_period WHERE CLASS_PERIOD_ID={0}", PeriodId);
     DataTable dt = MySQLHelper.ExecuteQuery(query);
     if(dt.Rows.Count > 0)
     {
         int semester = Int32.Parse(dt.Rows[0]["TERM_ID"].ToString());
         DateTime begin = DateTime.Parse(dt.Rows[0]["CLASS_PERIOD_BEGIN"].ToString());
         DateTime end = DateTime.Parse(dt.Rows[0]["CLASS_PERIOD_END"].ToString());
         bool praxis = Int32.Parse(dt.Rows[0]["CLASS_PERIOD_TYP"].ToString()).Equals("1");
         string praxisString = praxis ? Properties.Resources.Praxisphase : Properties.Resources.Theoriephase;
         gbSemester.Text = string.Format("{0} {1}: {2} - {3} ({4})", Properties.Resources.Semester, semester, begin.ToShortDateString(), end.ToShortDateString(), praxisString);
     }
     query = string.Format("SELECT CUR_ID FROM curriculum WHERE CLASS_ID={0} AND CLASS_PERIOD_ID={1} AND MOD_GROUP_ID IS NULL", ClassId, PeriodId);
     dt = MySQLHelper.ExecuteQuery(query);
     foreach (DataRow dr in dt.Rows)
     {
         int curId = Int32.Parse(dr["CUR_ID"].ToString());
         CtrlCurEntry ctrlEntry = new CtrlCurEntry(curId, EntryRemoved);
         ctrlEntry.Dock = DockStyle.Top;
         ctrlEntry.Width = pnlMain.ClientSize.Width;
         pnlMain.Controls.Add(ctrlEntry);
         ctrlEntry.BringToFront();
     }
     ResizeControl();
     ResumeLayout();
 }