private void button11_Click(object sender, EventArgs e) { AddNote an = new AddNote(1); an.ShowDialog(); DateTime ndatetime = Convert.ToDateTime(an.returned["Date"].ToString()); if (an.returned != null) { int nid = Classes.Note.Add(Convert.ToInt32(an.returned["LessonID"]), an.returned["StudentID"].ToString(), Convert.ToInt32(an.returned["NoteType"]), CurrentUser.ID.ToString(), Convert.ToBoolean(an.returned["Justified"]), an.returned["Text"].ToString(), new DateTime(ndatetime.Year, ndatetime.Month, ndatetime.Day, Convert.ToInt32(an.returned["Time"]), 0, 0)); ReloadNotes(); MessageBox.Show("!הערת משמעת מספר #" + nid + " נוספה בהצלחה", "הוספת הערה", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
private void button6_Click(object sender, EventArgs e) { if (comboBox3.SelectedIndex == -1) { Classes.App.Error("עליך לבחור שכבת לימוד לפני הוספת הערות משמעת."); } else if (comboBox1.SelectedIndex == -1) { Classes.App.Error("עליך לבחור קבוצת לימוד לפני הוספת הערות משמעת."); } else { AddNote an = new AddNote(0, startums[comboBox3.SelectedIndex], groups[comboBox1.SelectedIndex], dateTimePicker1.Value.ToShortDateString(), (int)numericUpDown3.Value); an.ShowDialog(); if (an.returned != null) { notes.Add(an.returned); listBox1.Items.Add(an.returned["StudentName"].ToString() + ": " + an.returned["NoteTypeName"].ToString() + (Convert.ToBoolean(an.returned["Justified"]) ? " (מוצדק)" : "")); } } }