コード例 #1
0
        private void renewBook(string id, TimeSpan ts, DateTime dueDate, string timesRenewed)
        {
            if (ts.Days > 0)
            {
                MessageBox.Show("Sorry you cannot renew the book when its due date has already passed.");
                return;
            }
            if (int.Parse(timesRenewed) >= maxRenewTimes)
            {
                MessageBox.Show("Sorry you can only renew a maximum of " + maxRenewTimes + " time(s).");
                return;
            }
            BookControl bc = new BookControl();

            bc.renewBook(int.Parse(id), LoginInfo.LoggedInId, dueDate.AddDays(dueDateExtendDays));
            MessageBox.Show(bc.Message);
            loadData();
        }