Exemple #1
0
 private void btnBorrow_Click(object sender, EventArgs e)
 {
     try
     {
         mediaLogic.InsertBorrowMedia(CurrentUser.UserID, int.Parse(txtMediaID.Text), DateTime.Today.ToShortDateString(), DateTime.Today.AddDays(7).ToString(), txtTitle.Text);
         dgvListBorrow.DataSource = mediaLogic.ListMediaBorrowUser(CurrentUser.UserID);
     }
     catch (Exception ex)
     {
         MessageBox.Show("Can not Borrow media.\n" + ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
         throw;
     }
     MessageBox.Show("Borrow complete");
 }
Exemple #2
0
        public int InsertBorrowMedia(int UserID, int MediaID, String DateBorrow, String DateReturn, String MediaTitle)
        {
            MediaLogic mediaLogic = new MediaLogic();

            return(mediaLogic.InsertBorrowMedia(UserID, MediaID, DateBorrow, DateReturn, MediaTitle));
        }