示例#1
0
        public ActionResult Manifest(string id, string number, string package)
        {
            string filepath;
            var    packages = new PackageManager(id, number);

            if (!packages.Exists(package, out filepath))
            {
                return(HttpNotFound());
            }

            var plist     = new InfoPlistExtractor().ExtractFromPackage(filepath);
            var viewModel = new ManifestViewModel
            {
                BundleIdentifier = GetPropertyValue(plist, "CFBundleIdentifier"),
                BundleVersion    = GetPropertyValue(plist, "CFBundleVersion"),
                Title            = GetPropertyValue(plist, "CFBundleDisplayName"),
                DisplayImage     =
                    GetApplicationPath(Request) +
                    Url.Action("DisplayImage",
                               new { id, number, package, image = GetArrayValues(plist, "CFBundleIconFiles")[0] }),
                FullSizeImage   = GetApplicationPath(Request) + Url.Content("~/Content/512x512.png"),
                SoftwarePackage = GetApplicationPath(Request) + Url.Action("Package", new { id, number, package }),
            };


            Response.ContentType = "text/xml";
            return(View(viewModel));
        }
示例#2
0
        public IActionResult ManifestSearchResults(ManifestViewModel mvm, int DepartCityID, int ArriveCityID, int FlightNumber)
        {
            var query = from f in _db.Flights
                        select f;

            query = query.Include(f => f.FlightInfo);

            if (mvm.DepartCityID != 0)
            {
                query = query.Where(f => f.FlightInfo.Route.CityFrom.CityID == DepartCityID);
            }

            if (mvm.ArriveCityID != 0)
            {
                query = query.Where(f => f.FlightInfo.Route.CityTo.CityID == ArriveCityID);
            }

            if (mvm.FlightNumber != null)
            {
                query = query.Where(f => f.FlightInfo.FlightNumber == mvm.FlightNumber);
            }

            List <Flight> SelectedFlights = query.ToList();

            return(View("ManifestSearchResults", SelectedFlights.OrderBy(f => f.Date)));
        }
示例#3
0
        public async Task <ManifestViewModel> GetPagedList(DateTime start, DateTime end, int pageIndex, int pageSize)
        {
            var pagedList = await _manifestService.GetManifests(start, end, pageIndex, pageSize);

            var result = new ManifestViewModel(pagedList.PageIndex, pagedList.PageSize, pagedList.Count, pagedList.Items)
            {
                Start = start,
                End   = end
            };

            return(result);
        }
示例#4
0
        public override void OnResume()
        {
            base.OnResume();

            // Refresh the view to ensure that any instructions that have changed status (e.g. not-started to in-progress)
            // are shown in the correct section
            ManifestViewModel viewModel = this.DataContext as ManifestViewModel;

            if (viewModel != null)
            {
                viewModel.RefreshStatusesCommand.Execute(null);
            }
        }
        private void LoadData()
        {
            _reader = new PackageReader();
               _reader.Read(PathToFile);

            PackageViewModel = new PackageViewModel(_reader);
            MetadataViewModel = new MetadataViewModel(_reader);
            ManifestViewModel = new ManifestViewModel(_reader);
            RequiresViewModel = new RequiresViewModel(_reader);
            DefineViewModel = new DefineViewModel(_reader);
            SigningViewModel = new SigningViewModel(_reader);
            LicenseViewModel = new LicenseViewModel(_reader);
            CompatibilityPolicy = new CompatibilityPolicyViewModel(_reader);
            ApplicationRoleViewModel = new ApplicationRoleViewModel(_reader);
            AssemblyRoleViewModel = new AssemblyRoleViewModel(_reader);
            FilesViewModel = new FilesViewModel(_reader);
            //PackageCompositionViewModel = new PackageCompositionViewModel(_reader);
            //_allViewModels.Add(PackageViewModel);
        }