public void ReturnFormular(Formular frm) { frm.BookLink.RemoveFormular(frm); frm.ReaderLink.RemoveFormular(frm); linkedFC.RemoveFormular(frm); OnChangingBookList?.Invoke(null, null); OnChangingTicket?.Invoke(null, null); }
private void buttonReturnBook_Click(object sender, EventArgs e) { if (selectedFormularItemIndex < 0) { notify("Чтобы отметить возврат книги, вам необходимо выбрать книгу."); return; } Formular frm = selectedTicket.FormularsHave[selectedFormularItemIndex]; linkedModel.ReturnFormular(frm); notify("Книга возвращена в библиотеку."); }
public void AddFormular(Book b, ReadersTicket rt) { if (b.FreeExemplarsCount == 0) { throw new ReturningException("У этой книги больше нет свободных экземпляров."); } if (rt.Quote == 0) { throw new ReturningException("У этого читателя закончилась квота, он не может брать больше книг."); } Formular frm = new Formular(b, rt, DateTime.Now, rt.GiveDays); linkedFC.AddFormular(frm); b.AddFormular(frm); rt.AddFormular(frm); OnChangingBookList?.Invoke(null, null); OnChangingTicket?.Invoke(null, null); }
private void buildFormularsFromData() { foreach (Tuple <int, int, DateTime> tup in linkedFC.LoadDataFromFile(filenameFormulars)) { Book b = linkedBC.GetBookByID(tup.Item1); if (b == null) { throw new WrongIDException("Loading formulars: no such book in catalog", tup.Item1); } ReadersTicket rt = linkedTC.GetTicketByID(tup.Item2); if (rt == null) { throw new WrongIDException("Loading formulars: no such ticket in catalog", tup.Item2); } Formular frm = new Formular(b, rt, tup.Item3); b.AddFormular(frm); rt.AddFormular(frm); linkedFC.AddFormular(frm); } }
public void RemoveFormular(Formular frm) { formularList.Remove(frm); }
public void AddFormular(Formular frm) { formularList.Add(frm); }
public void RemoveFormular(Formular takenFormular) { FormularsHave.Remove(takenFormular); Quote++; }
public void AddFormular(Formular frm) { FormularsHave.Add(frm); Quote--; }