示例#1
0
        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);
        }
示例#2
0
        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());
        }
示例#3
0
 protected string DisplayReaderShort(ModelClass.Reader reader)
 {
     return(reader.Name + " " + reader.Sorname);
 }