public ModelClass.Reader AddReader(string name, string sorname, string adress, int telNumber) { var newReader = new ModelClass.Reader() { ItemId = GenId(Model.Readers), Name = name, Sorname = sorname, Adress = adress, TelNumber = telNumber }; Model.Readers.Add(newReader); return(newReader); }
protected string DisplayReader(ModelClass.Reader reader) { var s = new StringBuilder(); s.AppendLine("id: " + reader.ItemId.ToString()); s.AppendLine("Имя: " + reader.Name); s.AppendLine("Фамилия: " + reader.Sorname); s.AppendLine("Телефон: " + reader.TelNumber); s.AppendLine("Адресс: " + reader.Adress); s.AppendLine("Взятые книги (" + reader.OnHand.Count.ToString() + "): "); foreach (var copyid in reader.OnHand) { var copy = controller.GetCopy(copyid); s.AppendLine(copy.DateTaken.ToString() + " " + DisplayBookShort(controller.GetBook(copy.Book))); } return(s.ToString()); }
protected string DisplayReaderShort(ModelClass.Reader reader) { return(reader.Name + " " + reader.Sorname); }