예제 #1
0
 public bool AddSemester(Semester s)
 {
     try
     {
         return ExecuteQuery("AddSemester", new { sDate = s.StartDate });
     }
     catch(SqlException e)
     {
         throw e;
     }
 }
예제 #2
0
 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();
     }
 }
예제 #3
0
 /// <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;
 }