Пример #1
0
        /// <summary>
        /// Populate dropdown values on create order page
        /// </summary>
        /// <returns></returns>
        public TerritoryLanguage GetDropDownValue()
        {
            var _context = new DeluxeOrderManagementEntities();
            TerritoryLanguage territoryLanguage = new TerritoryLanguage();
            var orderCategory = (from og in _context.OrderGrids
                                 where !string.IsNullOrEmpty(og.Category)
                                 select og.Category.ToString()
                                 ).Distinct().ToList();
            var territory = _context.Territories.Select(x => new DeluxeOM.Models.Territory()
            {
                TerritoryID   = x.Id,
                TerritoryName = x.WBTerritory
            }).Distinct().OrderBy(x => x.TerritoryName).ToList();
            var language = _context.Languages.Select(x => new DeluxeOM.Models.Language()
            {
                LanguageID   = x.Id,
                LanguageName = x.Name
            }).Distinct().OrderBy(x => x.LanguageName).ToList();

            var title = _context.VIDs.Select(x => new DeluxeOM.Models.Title()
            {
                VideoVersion = x.VideoVersion,
                Name         = x.TitleName
            }).GroupBy(x => x.VideoVersion).Select(g => g.FirstOrDefault()).OrderBy(x => x.Name).ToList();
            var orderTypes = _context.OrderGrids.Where(x => x.FileType != null).Select(x => x.FileType.ToString()).Distinct().ToList();

            territoryLanguage.Territory     = territory;
            territoryLanguage.Language      = language;
            territoryLanguage.Title         = title;
            territoryLanguage.orderCategory = orderCategory;
            territoryLanguage.OrderTypes    = orderTypes;
            return(territoryLanguage);
        }
Пример #2
0
        public TerritoryLanguage GetDropDownValue()
        {
            var _context = new DeluxeOrderManagementEntities();
            TerritoryLanguage territoryLanguage = new TerritoryLanguage();
            var orderCategory = (from og in _context.OrderGrids
                                 where !string.IsNullOrEmpty(og.Category)
                                 select og.Category.ToString()
                                 ).Distinct().ToList();
            var territory = _context.Territories.Select(x => new DeluxeOM.Models.Territory()
            {
                TerritoryID   = x.Id,
                TerritoryName = x.WBTerritory
            }).Distinct().OrderBy(x => x.TerritoryName).ToList();
            var language = _context.Languages.Select(x => new DeluxeOM.Models.Language()
            {
                LanguageID   = x.Id,
                LanguageName = x.Name
            }).Distinct().OrderBy(x => x.LanguageName).ToList();

            var title = _context.AnnouncementGrids.Select(x => new DeluxeOM.Models.Title()
            {
                //TitleID = x.Id,
                Name = x.Title
            }).Distinct().OrderBy(x => x.Name).ToList();

            territoryLanguage.Territory     = territory;
            territoryLanguage.Language      = language;
            territoryLanguage.Title         = title;
            territoryLanguage.orderCategory = orderCategory;
            return(territoryLanguage);
        }