protected void txtNotes_ClickCellButton(object sender, CellEventArgs e)
 {
     if (txtNoteID.Value.ToString() != "")
     {
         Purchase.Note oNote = new Purchase.Note(Session["CompanyID"].ToString(), txtIdPurchase.Value.ToString(), oMySql);
         oNote.Find(Convert.ToInt32(txtNoteID.Value.ToString()));
     }
 }
 protected void txtDelete_Click(object sender, EventArgs e)
 {
     if (txtNoteID.Value.ToString() != "")
     {
         Purchase.Note oNote = new Purchase.Note(txtTeacherID.Value.ToString(), txtTeacherID.Value.ToString(), oMySql);
         if (oNote.Find(Convert.ToInt32(txtNoteID.Value.ToString())))
         {
             oNote.Delete();
         }
     }
     LoadPurchase();
     txtNote.Text = "";
 }
 protected void txtChange_Click(object sender, EventArgs e)
 {
     if (txtNote.Text != "")
     {
         Purchase.Note oNote = new Purchase.Note(txtTeacherID.Value.ToString(), txtStudentID.Value.ToString(), oMySql);
         if (txtNoteID.Value.ToString() != "")
         {
             oNote.Find(Convert.ToInt32(txtNoteID.Value.ToString()));
         }
         oNote._Note = txtNote.Text;
         oNote.Date  = DateTime.Now;
         if (txtNoteID.Value.ToString() != "")
         {
             oNote.Update();
         }
         else
         {
             oNote.Insert();
         }
     }
     LoadPurchase();
     txtNote.Text = "";
 }