コード例 #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;
 }