private void FORMBarrowedBooks_Returned_Load(object sender, System.EventArgs e) { picLOGO.Image = MDIFORM.i32x32.Images[19]; cmdUpdateReturn = new OleDbCommand("UPDATE tblBarrowed SET DateRetured =@getDateRetured, DelayedDays =@getDelayedDays, Fines =@getFines, Notes =@getNotes, Returned =@getReturned, ModifyBy =@getModifyBy, DateModify =@getDateModify WHERE BookNo LIKE '" + sBookID + "' AND BarrowerID LIKE '" + sBarrowerID + "' AND DateBarrowed =#" + sDTBrrwd + "# AND DateDue =#" + sDTDue + "#", clsConnections.CN); FillFields(); cmdUpdateReturn.Parameters.Add("@getDateRetured", OleDbType.Date); cmdUpdateReturn.Parameters.Add("@getDelayedDays", OleDbType.Double); cmdUpdateReturn.Parameters.Add("@getFines", OleDbType.Double); cmdUpdateReturn.Parameters.Add("@getNotes", OleDbType.VarChar); cmdUpdateReturn.Parameters.Add("@getReturned", OleDbType.Boolean); cmdUpdateReturn.Parameters.Add("@getModifyBy", OleDbType.VarChar); cmdUpdateReturn.Parameters.Add("@getDateModify", OleDbType.Date); publicReturnList = this; }
private void bttnReturned_Click(object sender, System.EventArgs e) { if (lvBarrowed.Items.Count > 0) { try { FORMBarrowedBooks_Returned.sBookID = lvBarrowed.Items[lvBarrowed.FocusedItem.Index].SubItems[0].Text; FORMBarrowedBooks_Returned.sBookTitle = lvBarrowed.Items[lvBarrowed.FocusedItem.Index].SubItems[1].Text; FORMBarrowedBooks_Returned.sBarrowerID = lvBarrowed.Items[lvBarrowed.FocusedItem.Index].SubItems[2].Text; FORMBarrowedBooks_Returned.sBarrowerName = lvBarrowed.Items[lvBarrowed.FocusedItem.Index].SubItems[3].Text; FORMBarrowedBooks_Returned.sDTBrrwd = lvBarrowed.Items[lvBarrowed.FocusedItem.Index].SubItems[4].Text; FORMBarrowedBooks_Returned.sDTDue = lvBarrowed.Items[lvBarrowed.FocusedItem.Index].SubItems[5].Text; FORMBarrowedBooks_Returned sForm = new FORMBarrowedBooks_Returned(); sForm.ShowDialog(); } catch (ArgumentOutOfRangeException aooreE) { MessageBox.Show("" + aooreE.Message); } catch (NullReferenceException nreE) {} } else { MessageBox.Show("No record/book to return.", clsVariables.sMSGBOX, MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } }
private void bttnReturned_Click(object sender, System.EventArgs e) { FORMBarrowedBooks_Returned sForm = new FORMBarrowedBooks_Returned(); sForm.ShowDialog(); }