Exemplo n.º 1
0
        private void RegisterWineDict(WineDataContext db)
        {
            var wines = from w in db.Wine
                        select new
            {
                w.WineId,
                w.WineType
            };
            Dictionary <int, string> WineDict = wines.ToDictionary(w => w.WineId, w => w.WineType);

            Application[ConstName.WineDict] = WineDict;
        }
Exemplo n.º 2
0
        private void RegisterGrapedict(WineDataContext db)
        {
            var grapes = from g in db.Grape
                         select new
            {
                g.GrapeId,
                g.GrapeType
            };
            Dictionary <int, string> GrapeDict = grapes.ToDictionary(g => g.GrapeId, g => g.GrapeType);

            Application[ConstName.GrapeDict] = GrapeDict;
        }
Exemplo n.º 3
0
        private void RegisterProducerDict(WineDataContext db)
        {
            var producers = from p in db.Producer
                            select new
            {
                p.ProducerId,
                p.ProducerName
            };
            Dictionary <int, string> ProducerDict = producers.ToDictionary(p => p.ProducerId, p => p.ProducerName);

            Application[ConstName.ProducerDict] = ProducerDict;
        }
Exemplo n.º 4
0
        private void RegisterTasteDict(WineDataContext db)
        {
            var tastes = from t in db.Taste
                         select new
            {
                t.TasteType,
                t.TasteDesc
            };
            Dictionary <string, string> TasteDict = tastes.ToDictionary(t => t.TasteType.Trim(), p => p.TasteDesc);

            Application[ConstName.TasteDict] = TasteDict;
        }
Exemplo n.º 5
0
        private void InitialDictionary()
        {
            WineDataContext db = new WineDataContext();

            RegisterCountryDict(db);
            RegisterRegionDict(db);
            RegisterSubRegionDict(db);
            RegisterGrapedict(db);
            RegisterWineDict(db);
            RegisterProducerDict(db);
            RegisterTasteDict(db);
        }
Exemplo n.º 6
0
        private void RegisterSubRegionDict(WineDataContext db)
        {
            var subRegions = from s in db.SubRegion
                             select new
            {
                s.SubRegionCode,
                s.SubRegionName
            };
            Dictionary <string, string> SubRegionDict = subRegions.ToDictionary(s => s.SubRegionCode.Trim(), s => s.SubRegionName);

            SubRegionDict.Add("", "Not Found");
            Application[ConstName.SubRegionDict] = SubRegionDict;
        }
Exemplo n.º 7
0
        private void RegisterRegionDict(WineDataContext db)
        {
            var regions = from r in db.Region
                          select new
            {
                r.RegionCode,
                r.RegionName
            };
            Dictionary <string, string> RegionDict = regions.ToDictionary(r => r.RegionCode.Trim(), r => r.RegionName);

            RegionDict.Add("", "Not Found");
            Application[ConstName.RegionDict] = RegionDict;
        }
Exemplo n.º 8
0
        private void RegisterCountryDict(WineDataContext db)
        {
            var countries = from c in db.Country
                            select new
            {
                c.CountryCode,
                c.CountryName
            };

            Dictionary <string, string> CountryDict = countries.ToDictionary(c => c.CountryCode.Trim(), c => c.CountryName);

            CountryDict.Add("", "Not Found");
            Application[ConstName.CountryDict] = CountryDict;
        }