private void borrowButton_Click(object sender, EventArgs e) { try { if (mediaLogic.ListBorrow(media.MediaId).Count <= 0) { DateTime todayDate = DateTime.Today; string todaysDate = todayDate.ToString("dd/MM/yyyy"); //change this according to the computers date layout either dd/MM/yyyy or MM/dd/yyyy DateTime expDate = todayDate.AddDays(30); string expiryDate = expDate.ToString("dd/MM/yyyy"); //change this according to the computers date layout either dd/MM/yyyy or MM/dd/yyyy int affectedRows = mediaLogic.InsertBorrow(CurrentUser.UserID, media.MediaId, todaysDate, expiryDate); MessageBox.Show("You have borrowed " + media.MediaName); //NEED CONDITION TO DELETE RESERVE int affectedRows2 = mediaLogic.DeleteReserveOnReturn(media.MediaId); } else { MessageBox.Show(media.MediaName + " is already borrowed"); } returnComboBox.DataSource = mediaLogic.ListReturn(CurrentUser.UserID); returnComboBox.DisplayMember = "PairName"; returnComboBox.ValueMember = "PairId"; RefreshUserList(); } catch (Exception ex) { MessageBox.Show("Please select a media"); } }