Esempio n. 1
0
        public ActionResult Index(OverviewViewModel model)
        {
            this.apps.Add(model.Created.Name, this.User.Identity.GetUserId());
            this.TempData["Notification"] = "App successfully created";

            return this.RedirectToAction(x => x.Index());
        }
Esempio n. 2
0
 public IActionResult Meta(string className)
 {
     return(new ContentResult()
     {
         Content = JsonSerializer.Serialize(OverviewViewModel.create(_storage, className).Class),
         ContentType = "application/json"
     });
 }
Esempio n. 3
0
        public ActionResult Overview()
        {
            List <Task> task  = Db.GetAll();
            var         model = new OverviewViewModel(task);

            model.Contacts = Db.GetAllContacts();

            return(View(model));
        }
Esempio n. 4
0
        public void ViewFullScheduleCommand_Executed_NavigatesToSessionsView()
        {
            var viewModel = new OverviewViewModel(Messenger, CodeCampService);

            viewModel.ViewFullScheduleCommand.Execute(null);

            Assert.AreEqual(1, Dispatcher.ShowViewModelRequests.Count);
            Assert.AreEqual(typeof(SessionsViewModel), Dispatcher.ShowViewModelRequests.First().ViewModelType);
        }
Esempio n. 5
0
        public DetailView(OverviewViewModel overviewViewModel, Activity activity)
        {
            InitializeComponent();

            this.overviewViewModel = overviewViewModel;

            viewModel      = new DetailViewViewModel(this, activity);
            BindingContext = viewModel;
        }
Esempio n. 6
0
        public ActionResult Index()
        {
            var model = new OverviewViewModel();
            var user = this.User.Identity.GetUserId();

            model.CreatedApps = this.apps.GetMyApps(user).To<AppViewModel>().ToList();
            model.ContributingApps = this.apps.GetCollaboratorApps(user).To<AppViewModel>().ToList();

            return this.View(model);
        }
        public IActionResult Index()
        {
            OverviewViewModel viewModel = new OverviewViewModel();

            viewModel.MarkerTypes = Enum.GetValues(typeof(MarkerType)).Cast <MarkerType>().Select(s => new MappedMarkerType {
                Value = (int)s,
                Name  = s.ToString()
            }).ToList();
            return(View(viewModel));
        }
Esempio n. 8
0
        public OverviewView(Models.Match match)
        {
            OVM            = new OverviewViewModel(match);
            Match          = match;
            BindingContext = OVM;
            InitializeComponent();

            //Fulltime_Label.SetBinding(Label.BindingContextProperty, OVM.Match.Result.ScoreInfo.Score[0].Name);
            //Halftime_Label.SetBinding(Label.BindingContextProperty,OVM.Match.Result.ScoreInfo.Score[1].Name);
        }
 public LineUpView(Models.Match match)
 {
     OVM            = new OverviewViewModel(match);
     BindingContext = OVM;
     ImageField     = new Image {
         Aspect = Aspect.AspectFit
     };
     ImageField.Source = ImageSource.FromResource("SportCCAPItesting.Field.png", typeof(LineUpView).GetTypeInfo().Assembly);
     InitializeComponent();
 }
Esempio n. 10
0
        public OverviewWindow(MainViewModel mainMV)
        {
            InitializeComponent();

            OverviewMV = new OverviewViewModel(this, mainMV);
            OverviewsComboBox.ItemsSource   = OverviewMV.Overviews;
            OverviewsComboBox.SelectedIndex = (int)OverviewViewModel.OverviewItem.CommonlyExpenses;

            _ = ShowDialog();
        }
 public IActionResult UserEdit(int UserId)
 {
     if (HttpContext.Session.GetString("UserId") != null)
     {
         Queries           GetUsersForUpdate = new Queries();
         OverviewViewModel SingleUser        = new OverviewViewModel();
         SingleUser.UsersList = GetUsersForUpdate.RetrieveUser(UserId);
         return(View(SingleUser));
     }
     return(RedirectToAction("Login", "Home"));
 }
Esempio n. 12
0
        private async void Grid_Initialized(object sender, EventArgs e)
        {
            if (viewModel == null)
            {
                viewModel = new OverviewViewModel();
                await viewModel.Init();

                DataContext = viewModel;
                comboboxModes.SelectedIndex = (int)GameModes.Competitive;
            }
        }
Esempio n. 13
0
        public async Task <IActionResult> Overview()
        {
            var temperatureMeasurements = await temperatureMeasurementRepository.GetAllSensorsLastTemperatureMeasurementAsync();

            var vm = new OverviewViewModel()
            {
                LastSensorTemperatureMeasurements = temperatureMeasurements
            };

            return(View("Overview", vm));
        }
        public IActionResult UserControl(OverviewViewModel OverviewModel)
        {
            if (HttpContext.Session.GetString("UserId") != null)
            {
                Queries GetUserOverview = new Queries();
                OverviewModel.UsersList = GetUserOverview.RetrieveUsers();
                return(View(OverviewModel));
            }

            return(RedirectToAction("Login", "Home"));
        }
Esempio n. 15
0
        // GET: Vehiclestatus
        public ActionResult Index(string vin, string sort)
        {
            var viewmodel = new OverviewViewModel("DESC", sort)
            {
                Lasttrip = db.LastTrips,
                Alltrips = db.AllTripsList,
                VIN      = vin
            };

            return(View(viewmodel));
        }
Esempio n. 16
0
        // GET: Overview
        public ActionResult Index()
        {
            ApplicationUser user = System.Web.HttpContext.Current.GetOwinContext().GetUserManager <ApplicationUserManager>().FindById(System.Web.HttpContext.Current.User.Identity.GetUserId());

            var viewModel = new OverviewViewModel()
            {
                Organizations = organizationInformationRepository.GetOrganizationInformationByUserId(Guid.Parse(user.Id)),
                User          = user,
            };

            return(View(viewModel));
        }
Esempio n. 17
0
        /// <summary>
        /// Initializes a new instance of the <see cref="OverviewTabbedPage"/> class.
        /// </summary>
        public OverviewTabbedPage()
        {
            InitializeComponent();

            BindingContext = _viewModel = new OverviewViewModel();
            _viewModel.PlansLoadedMethod += () =>
            {
                if (_viewModel.Plans == null || _viewModel.Plans.Count <= 0)
                {
                    _showPlans = false;
                }
            };
        }
        public OverviewTabbedPage()
        {
            InitializeComponent();

            BindingContext = _viewModel = new OverviewViewModel();
            _viewModel.PlansLoadedMethod += () =>
            {
                if (_viewModel.Plans == null || _viewModel.Plans.Count <= 0)
                {
                    ToolbarItems.Remove(tiPlans);
                }
            };
        }
Esempio n. 19
0
        public ActionResult overview()
        {
            OverviewViewModel model = new OverviewViewModel()
            {
                Logo            = xml.loadline("siteSetting/logo"),
                fivicon         = xml.loadline("siteSetting/fivicon"),
                SiteDiscription = xml.loadline("siteSetting/siteDiscription"),
                SiteKeyWord     = xml.loadline("siteSetting/sitekeywords"),
                SiteName        = xml.loadline("siteSetting/siteName")
            };

            return(PartialView(model));
        }
Esempio n. 20
0
        public async Task <IActionResult> Overview()
        {
            var user = await _userManager.GetUserAsync(User);

            var model = new OverviewViewModel
            {
                CountProducts = (from p in _context.Products where p.CompanyId == user.CompanyId select p).Count() *
                                (from p in _context.Products where p.CompanyId == user.CompanyId select p.Existence).Sum(),
                SumSalary = (from s in _context.Employees where s.CompanyId == user.CompanyId select s.Salary).Sum()
            };

            return(View(model));
        }
        // GET: OverView
        public async Task <ActionResult> Index()
        {
            var viewModel = new OverviewViewModel();

            using (var client = new MyCouchClient("http://db-couchdb.cloudapp.net:5984", "bekk4"))
            {
                var query  = new QueryViewRequest("test", "measurepoints").Configure(x => x.Group(true));
                var result = await client.Views.QueryAsync(query);

                viewModel.MeasurementPoints = result.Rows.Select(x => x.Key);
            }
            return(View(viewModel));
        }
        public void OverviewViewModel_LoadAllSensorTypes()
        {
            //Arrange
            ObservableCollection <SensorType> sensorTypes         = null;
            ObservableCollection <SensorType> expectedSensorTypes = sensorTypeDataService.GetAllSensorTypes();

            //act
            OverviewViewModel viewModel = GetViewModel();

            sensorTypes = viewModel.SensorTypeList;

            //assert
            CollectionAssert.AreEqual(expectedSensorTypes, sensorTypes);
        }
Esempio n. 23
0
        private void reinitializeChildViewModels()
        {
            OverviewViewModel = new OverviewViewModel(Messenger, _campService);
            OverviewViewModel.Init();

            SessionsViewModel = new SessionsViewModel(Messenger, _campService);
            SessionsViewModel.Init();

            SpeakersViewModel = new SpeakersViewModel(Messenger, _campService);
            SpeakersViewModel.Init();

            SponsorsViewModel = new SponsorsViewModel(Messenger, _campService);
            SponsorsViewModel.Init();
        }
Esempio n. 24
0
        public ActionResult Overview()
        {
            var model = new OverviewViewModel
            {
                ExampleFileSelector = new ExampleFileSelector
                {
                    Id          = "exampleFileSelector",
                    InitialFile = "JPG Image.jpg"
                }
            };

            model.ImagePath = model.ExampleFileSelector.SelectedFile;

            using (var imageInfo = new ImageInfo(model.ImagePath))
            {
                model.ImageData.Add("Format", imageInfo.Format);
                model.ImageData.Add("Width", imageInfo.Width);
                model.ImageData.Add("Height", imageInfo.Height);
                model.ImageData.Add("DpiX", imageInfo.DpiX);
                model.ImageData.Add("DpiY", imageInfo.DpiY);
                model.ImageData.Add("ColorSpace", imageInfo.ColorSpace);
                model.ImageData.Add("ColorType", imageInfo.ColorType);
                model.ImageData.Add("BitDepth", imageInfo.BitDepth);
                model.ImageData.Add("HasAlpha", imageInfo.HasAlpha);
                model.ImageData.Add("ChannelCount", imageInfo.ChannelCount);

                foreach (var entry in imageInfo.ExifDictionary)
                {
                    model.ImageExifMetadata.Add(entry.Tag.ToString(), Tuple.Create(entry.Value, entry.Description));
                }

                if (model.ImageExifMetadata.Count == 0)
                {
                    model.ImageExifMetadata.Add("", Tuple.Create("", ""));
                }

                foreach (var entry in imageInfo.IptcDictionary)
                {
                    model.ImageIptcMetadata.Add(entry.Tag.ToString(), Tuple.Create(entry.Value, entry.Description));
                }

                if (model.ImageIptcMetadata.Count == 0)
                {
                    model.ImageIptcMetadata.Add("", Tuple.Create("", ""));
                }
            }

            return(View(model));
        }
Esempio n. 25
0
 public MessageDialog(OverviewViewModel overviewViewModel, DialogMode dialogMode, string message, Dispatcher dispatcher)
     : base(overviewViewModel, dialogMode, dispatcher)
 {
     InvokeUICall(() =>
     {
         _messageTextBlock = new TextBlock
         {
             Text = message,
             HorizontalAlignment = HorizontalAlignment.Center,
             VerticalAlignment   = VerticalAlignment.Center,
             TextWrapping        = TextWrapping.Wrap,
         };
         SetContent(_messageTextBlock);
     });
 }
Esempio n. 26
0
        private OverviewViewModel GetOverviewViewModel(List <Cocktail> cocktails)
        {
            if (cocktails != null)
            {
                cocktailsServiceMock.Setup(e => e.GetAllCocktails())
                .Returns(Task.FromResult(cocktails.AsQueryable()));
            }

            var vm = new OverviewViewModel(appSettingsMock.Object, cocktailsServiceMock.Object, seederServiceMock.Object)
            {
                CoreMethods = coreMethodsMock.Object
            };

            return(vm);
        }
        public OverviewView()
        {
            InitializeComponent();

            BindingContext = new OverviewViewModel();

            InsertButton.Clicked += (async(sender, args) =>
            {
                await Navigation.PushAsync(new InsertView(), false);
            });

            MealsList.ItemSelected += (async(sender, args) =>
            {
                await Navigation.PushAsync(new InsertView((Meal)args.SelectedItem));
            });
        }
Esempio n. 28
0
        public async Task <IActionResult> Overview(string id)
        {
            var user = await _userManager.FindByNameAsync(id);

            if (user == null)
            {
                return(NotFound());
            }
            var courses = _dbContext.Courses.Where(t => t.OwnerId == user.Id).Take(6);
            var model   = new OverviewViewModel
            {
                CoursesDisplaying = courses.Take(6)
            };
            await model.Restore(user, 0, _dbContext, await GetCurrentUserAsync());

            return(View(model));
        }
Esempio n. 29
0
        public IActionResult Index()
        {
            int               id      = Convert.ToInt32(this.User.FindFirstValue(ClaimTypes.NameIdentifier));
            List <Book>       Books   = BookRepo.GetUserBacklog(id);
            List <Review>     Reviews = ReviewRepo.GetAllReviewsByUserID(id);
            OverviewViewModel VM      = new OverviewViewModel();

            foreach (Book B in Books)
            {
                VM.UserBacklog.Books.Add(BookConverter.BookToBookViewModel(B));
            }
            foreach (Review R in Reviews)
            {
                VM.UserReviews.Reviews.Add(ReviewConverter.ReviewToReviewViewModel(R));
            }
            return(View(VM));
        }
Esempio n. 30
0
        public IActionResult Index(string className)
        {
            var o = _storage.getClasses().Find(c => c.Name.ToLower().Equals(className.ToLower()));

            Template.RegisterSafeType(typeof(OverviewViewModel), new[] { "Class", "Elements", "Options" });
            Template.RegisterSafeType(typeof(OptionViewModel), new[] { "Id", "Value" });

            var v        = OverviewViewModel.create(_storage, className);
            var template = Template.Parse(o.OverviewTemplate);

            var render = template.Render(Hash.FromAnonymousObject(new { Model = v }));

            return(new ContentResult()
            {
                Content = render, ContentType = "text/html"
            });
        }
Esempio n. 31
0
        protected async override void OnNavigatedTo(NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);

            OverviewParameter parameter = (OverviewParameter)e.Parameter;

            string categoryName = parameter.CategoryKey.IsEmpty
                ? "All"
                : await queryDispatcher.QueryAsync(new GetCategoryName(parameter.CategoryKey));

            categoryKey = parameter.CategoryKey;
            object period = null;

            if (parameter.Month != null)
            {
                month  = parameter.Month;
                period = parameter.Month;
            }

            if (parameter.Year != null)
            {
                year   = parameter.Year;
                period = parameter.Year;
            }

            ViewModel         = new OverviewViewModel(navigator, parameter.CategoryKey, categoryName, period);
            ViewModel.Reload += OnViewModelReload;

            handlers.Add(eventHandlers.AddUiThread <OutcomeCreated>(ViewModel, Dispatcher));
            handlers.Add(eventHandlers.AddUiThread <OutcomeAmountChanged>(ViewModel, Dispatcher));
            handlers.Add(eventHandlers.AddUiThread <OutcomeDescriptionChanged>(ViewModel, Dispatcher));
            handlers.Add(eventHandlers.AddUiThread <OutcomeWhenChanged>(ViewModel, Dispatcher));

            if (userPreferences.TryLoad("Overview.SortDescriptor", out SortDescriptor <OverviewSortType> sortDescriptor))
            {
                SortDescriptor = sortDescriptor;
            }
            else
            {
                SortDescriptor = new SortDescriptor <OverviewSortType>(OverviewSortType.ByDate, SortDirection.Ascending);
            }

            await ReloadAsync();

            ContentLoaded?.Invoke(this, EventArgs.Empty);
        }
Esempio n. 32
0
        protected DialogBase(OverviewViewModel overviewViewModel, DialogMode dialogMode, Dispatcher dispatcher)
        {
            _overviewViewModel = overviewViewModel;
            _dispatcher        = dispatcher;
            Mode          = dialogMode;
            CloseBehavior = DialogCloseBehavior.AutoCloseOnButtonClick;

            OkText     = "Ok";
            CancelText = "Cancel";
            YesText    = "Yes";
            NoText     = "No";

            switch (dialogMode)
            {
            case DialogMode.None:
                break;

            case DialogMode.Ok:
                CanOk = true;
                break;

            case DialogMode.Cancel:
                CanCancel = true;
                break;

            case DialogMode.OkCancel:
                CanOk     = true;
                CanCancel = true;
                break;

            case DialogMode.YesNo:
                CanYes = true;
                CanNo  = true;
                break;

            case DialogMode.YesNoCancel:
                CanYes    = true;
                CanNo     = true;
                CanCancel = true;
                break;

            default:
                throw new ArgumentOutOfRangeException("dialogMode");
            }
        }
Esempio n. 33
0
        public async Task <PartialViewResult> ShowOverview(string searchQuery = "2673730") //Default startsida är stockholm
        {
            var httpClient = new WeatherHTTPClientController();
            var result     = httpClient.GetByCityToday(searchQuery);

            var viewModel = new OverviewViewModel()
            {
                Day         = result.Date,
                Date        = result.Date.ToString("dd/MMM", new CultureInfo("en-US")),
                CityId      = result.CityId,
                CityName    = result.CityName,
                CurrentTemp = Convert.ToInt32(result.Temperature.CurrentTemperature),
                Weather     = result.Weather[0].WeatherDescription,
                WeatherUrl  = result.Weather[0].IconImageUrl
            };

            return(PartialView("ShowOverviewPartial", viewModel));
        }
        public OverviewView()
        {
            InitializeComponent();

            BindingContext = new OverviewViewModel();

            ItemTemplate = new DataTemplate(() => new OverviewDetailsView());
            ItemsSource = viewModel.Weeks;

            this.CurrentPageChanged += async (sender, args) =>
            {
                if (viewModel != null && ((Week)this.SelectedItem).WeekNumber > this.lastWeekNumber)
                {
                    await viewModel.LoadMore();
                }
            };

            this.PagesChanged += (object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e) =>
            {
                //App.AppManager.LastVisibleWeekNumber = ((Week)this.SelectedItem).WeekNumber;
                App.AppManager.LastVisibleWeekNumber = e.OldStartingIndex;
            };
        }