public bool AddSemester(Semester s) { try { return ExecuteQuery("AddSemester", new { sDate = s.StartDate }); } catch(SqlException e) { throw e; } }
private void btnSave_Click(object sender, EventArgs e) { Semester s = new Semester { StartDate = DateTime.Parse(semesterDate.Text).Date }; if (!db.AddSemester(s)) { MessageBox.Show("Error adding semester.", "Error"); } else { Close(); } }
/// <summary> /// Equalses the specified p. /// </summary> /// <param name="p">The p.</param> /// <returns></returns> public bool Equals(Semester p) { return Id == p.Id && StartDate == p.StartDate; }