public async Task <ActionResult> Owner(string ownerId) { if (string.IsNullOrEmpty(ownerId)) { return(RedirectToAction("Index", "Home")); } try { var ownerSettings = await _ownerSettingsStore.GetOwnerSettingsAsync(ownerId); var portalViewModel = new PortalViewModel(ownerSettings); // repos try { var repos = await _repoSettingsStore.GetRepoSettingsForOwnerAsync(ownerId); portalViewModel.RepoIds = repos.Select(r => r.RepositoryId).ToList(); } catch (Exception e) { Log.Error(e, "Error getting repositories for {0}", ownerId); } return(View("Index", portalViewModel)); } catch (OwnerSettingsNotFoundException) { //redirect to a friendly warning page return(View("OwnerNotFound")); } }
public ActionResult Portal() { PortalViewModel model = new PortalViewModel(); model.OperationData = _domainManager.GetOperationData(DomainContext.Domain.Id, DomainContext.AppId, DateTime.Now); return(View(model)); }
public ActionResult Index(string city) { NewsService newsService = new NewsService(); WeatherService weatherService = new WeatherService(); SportsService sportsService = new SportsService(); PortalViewModel model = new PortalViewModel { News = newsService.GetNews(city), Weather = weatherService.GetWeather(city), Sports = sportsService.GetScores(city) }; return(View(model)); }
public PortalViewModel GetStartingAdjuster(int portalId) { PortalViewModel ret = (from p in _context.Portals where p.PortalID == portalId && p.IsDeleted != true select new PortalViewModel { StartingAdjuster = p.StartingAdjuster, Pid = p.Pid }).FirstOrDefault(); return(ret); //return _context.Portals.Where(x => x.PortalID == portalId).Select(x => new Portal { StartingAdjuster = x.StartingAdjuster,Pid=x.Pid}).FirstOrDefault(); }
public PortalModel(WidgetStatusHost widgetStatusHost, Dispatcher dispatcher) { InitializeComponent(); CultureResources.registerDataProvider(this); _viewModel = new PortalViewModel(); createStatusObjects(); this.VehicleStatus = VehicleType.Small_Vehicle; _Dispatcher = dispatcher; _WidgetStatusHost = widgetStatusHost; _WidgetStatusHost.WidgetUpdateEvent += new WidgetUpdateHandler(WidgetUpdate); _WidgetStatusHost.ErrorMessageUpdate += new UpdateErrorMessageHandler(_WidgetStatusHost_ErrorMessageUpdate); }
public async Task <ActionResult> Index(string city) { NewsService newsService = new NewsService(); WeatherService weatherService = new WeatherService(); SportsService sportsService = new SportsService(); var newsTask = newsService.GetNewsAsync(city); var weatherTask = weatherService.GetWeatherAsync(city); var sportsTask = sportsService.GetScoresAsync(city); await Task.WhenAll(newsTask, weatherTask, sportsTask); PortalViewModel model = new PortalViewModel { News = newsTask.Result, Weather = weatherTask.Result, Sports = sportsTask.Result }; return(View(model)); }
public async Task <ActionResult> Portal(string userEmailId) { if (string.IsNullOrEmpty(userEmailId)) { return(StatusCode(404)); } // var cabinCrewData = await CabinCrewPlansHelper.MonthsPlan("10055"); // ${Debugging} var cabinCrewData = await CabinCrewPlansHelper.MonthsPlan(userEmailId, configuration); if (cabinCrewData == null) { return(StatusCode(404)); } List <Duty> duties = new List <Duty>(); var colour = new[] { "pink", "org", "blue" }; foreach (var item in cabinCrewData) { duties.Add(item.vacationPlan == true?new Duty() { Date = item.vacationDate, isDayOff = item.isDayOff, vacationPlan = item.vacationPlan, Details = new Details() { DisplayText = "AL", Colour = colour[1] } }:item.isDayOff == true?new ViewModels.Duty() { Date = item.date, isDayOff = item.isDayOff, vacationPlan = item.vacationPlan, Details = new Details() { DisplayText = "OFF", Colour = colour[0] } } :new Duty() { Date = Convert.ToDateTime(item.flightDetails.flightStartDate), isDayOff = item.isDayOff, vacationPlan = item.vacationPlan, Details = new Details() { DisplayText = item.flightDetails.sourceCode, Colour = colour[2] } }); } PortalViewModel viewModel = new PortalViewModel(DateTime.Today, 30, 2, duties); viewModel.UserEmailId = userEmailId; return(View(viewModel)); }
public PortalPage(UserDetails user) { InitializeComponent(); BindingContext = new PortalViewModel(user); StackLayout stack = new StackLayout(); foreach (var t in user.AppModel) { Button btn = new Button(); btn.Text = t.Name; btn.SetBinding(Button.CommandProperty, new Binding("ShowCommandParameter")); // btn.CommandParameter = t.UrlAndroid; btn.CommandParameter = t; stack.Children.Add(btn); } Content = stack; }
public PortalModel(WidgetStatusHost widgetStatusHost, Dispatcher dispatcher) { InitializeComponent(); Map(updateInterlockDoor, "INTERLOCK_DOOR"); Map(updateEStops, "ESTOP"); Map(updateMDSSensor, "MDS"); Map(updateLightCurtainEmitters, "INTERLOCK_LC"); Map(updateTrafficLight, "TRAFFIC_LIGHT_STATUS"); Map(updateVehicleSensor, "VEHICLE_SENSOR"); CultureResources.registerDataProvider(this); _viewModel = new PortalViewModel(); this.VehicleStatus = VehicleType.Small_Vehicle; _Dispatcher = dispatcher; _WidgetStatusHost = widgetStatusHost; _WidgetStatusHost.WidgetUpdateEvent += new WidgetUpdateHandler(WidgetUpdate); _WidgetStatusHost.ErrorMessageUpdate += new UpdateErrorMessageHandler(_WidgetStatusHost_ErrorMessageUpdate); }
public ActionResult Index() { var mgr = new UserPortalRepository(); PortalViewModel vm = new PortalViewModel(); vm.ExpirationItems = mgr.GetAllExpirationItems(int.Parse(User.Identity.Name)); vm.Categories = mgr.GetAllCategories(); vm.NonExpirationItems = mgr.GetAllNonExpirationItems(int.Parse(User.Identity.Name)).ToList(); vm.Courses = mgr.GetAllCourses(int.Parse(User.Identity.Name)); vm.CoreCourses = mgr.GetAllCoreCourses(int.Parse(User.Identity.Name)); vm.Reminders = mgr.GetAllReminders(int.Parse(User.Identity.Name)); vm.UserOrganizations = mgr.GetAllUserRelationships(int.Parse(User.Identity.Name)); if (Request.Cookies["tour"].Value == User.Identity.Name) { vm.InitialLogin = false; } else { vm.InitialLogin = true; } return(View(vm)); }
public ActionResult Portal(string domainId) { PortalViewModel model = new PortalViewModel(); if (DomainContext.StyleSettings.PortalMode == Infrastructure.EnumPortalMode.Template) { if (DomainContext.StyleSettings.PortalPresetTemplate == null) { model.ViewHtml = "模版配置异常"; } else { model.ViewHtml = _portalTemplatePool.Render( DomainContext.StyleSettings.PortalPresetTemplate, DomainContext, MemberContext); } } else { model.ViewHtml = _portalTemplatePool.Render( DomainContext.StyleSettings.PortalCustomTemplate, DomainContext, MemberContext); } return(View(model)); }
public void Initialize() { this.logger = new Logger(KanColleClient.Current.Proxy); this.logViewerViewModel = new PortalViewModel(); }
public void Initialize() { viewerViewModel = new PortalViewModel(KanColleClient.Current); }
public PortalView(PortalViewModel vm) { this.DataContext = vm; InitializeComponent(); }