Exemplo n.º 1
0
        public static MagazineInfo FromRecord
        (
            MarcRecord record
        )
        {
            int marsCode = NumericUtility.ParseInt32(CM.AppSettings["mars-code"]);
            int marsFlag = NumericUtility.ParseInt32(CM.AppSettings["mars-flag"]);

            MagazineInfo result = new MagazineInfo
            {
                Title    = record.FM(200, 'a'),
                Index    = record.FM(903),
                MarsCode = record.FM(marsCode),
                Flag     = record.FM(marsFlag),
                Mfn      = record.Mfn
            };

            return(result);
        }
Exemplo n.º 2
0
        static Dictionary <string, MagazineInfo> LoadMagazines()
        {
            Dictionary <string, MagazineInfo> result
                = new Dictionary <string, MagazineInfo>();

            MarcRecord[] records = Client.SearchRead("MARS=$");
            foreach (MarcRecord record in records)
            {
                MagazineInfo magazine = MagazineInfo.FromRecord(record);
                if ((magazine != null) && (magazine.MarsCode != null))
                {
                    result.Add
                    (
                        magazine.MarsCode,
                        magazine
                    );
                }
            }

            return(result);
        }