public ActionResult Index() { var company = _repository.Settings.FirstOrDefault(s => s.Key.ToLower() == "companyname"); var logo = _repository.Settings.FirstOrDefault(s => s.Key.ToLower() == "logopath"); if (company == null) { company = new Setting { Key = "CompanyName", Value = "CompanyName" }; _repository.Settings.Add(company); _repository.SaveChanges(); } if (logo == null) { logo = new Setting { Key = "LogoPath", Value = "" }; _repository.Settings.Add(logo); _repository.SaveChanges(); } var model = new LandingViewModel { CompanyName = company.Value, CompanyLogoPath = logo.Value }; return(View(model)); }
public ActionResult Landing() { if (!_userRepository.Queryable.Any(a => a.Id == CurrentUser.Identity.Name && a.IsActive)) { Message = "You are currently not an active user for this program. If you believe this is incorrect contact your departmental administrator to add you."; return(this.RedirectToAction <ErrorController>(a => a.NotAuthorized())); } using (var conn = _dbService.GetConnection()) { var viewModel = new LandingViewModel { PendingOrders = conn.Query <OrderHistoryBase>( "SELECT * FROM [dbo].[udf_GetPendingOrdersForLogin] (@login) ORDER BY lastactiondate DESC", new { login = CurrentUser.Identity.Name }), YourOpenOrders = conn.Query <OrderHistoryBase>( "SELECT * FROM [dbo].[udf_GetOpenOrderInfoForLogin] (@login) ORDER BY lastactiondate DESC", new { login = CurrentUser.Identity.Name }) }; return(View(viewModel)); } }
protected async override void OnAppearing() { base.OnAppearing(); App.ReadUnread = "null"; App.OrderByText = Constants.LastPostDateText; App.SelectedTitle = string.Empty; var leftSwipeGesture = new SwipeGestureRecognizer { Direction = SwipeDirection.Left }; if (Application.Current.Properties.ContainsKey("NAME")) { var name = Convert.ToString(Application.Current.Properties["NAME"]); txtName.Text = App.SelectedUserData.name; } //_headerList.Add(new LandingModel { Date = "Date", Borrower = "Borrower", Amount = "Amount" }); //headerList.ItemsSource = _headerList; ViewModel = new LandingViewModel(); this.BindingContext = ViewModel; if (NetworkCheck.IsInternet()) { await ViewModel.FetchClosingData(); //await ViewModel.FetchDecisionDueData(); } else { await DisplayAlert("Simon", "No network is available.", "OK"); } }
private static LandingViewModel MapUmbracoContentToViewModel(IPublishedContent content, ILatestService latestService, ISocialMediaService socialMediaService, IEastSussex1SpaceService eastSussex1SpaceService, IWebChatSettingsService webChatSettingsService, IRelatedLinksService relatedLinksService, IContentExperimentSettingsService contentExperimentSettingsService, IEscisService escisService) { var model = new LandingViewModel(); model.Navigation.Sections = BuildLandingLinksViewModelFromUmbracoContent(content, relatedLinksService); model.Navigation.LandingNavigationLayout = LandingNavigationLayout.ThreeColumn; var selectedLayout = content.GetPropertyValue <string>("layout_Content"); if (!String.IsNullOrEmpty(selectedLayout)) { var selectedOption = umbraco.library.GetPreValueAsString(Int32.Parse(selectedLayout, CultureInfo.InvariantCulture)); if (selectedOption.ToUpperInvariant().Contains("TWO")) { model.Navigation.LandingNavigationLayout = LandingNavigationLayout.TwoColumn; } } // Add common properties to the model var modelBuilder = new BaseViewModelBuilder(); modelBuilder.PopulateBaseViewModel(model, content, contentExperimentSettingsService, UmbracoContext.Current.InPreviewMode); modelBuilder.PopulateBaseViewModelWithInheritedContent(model, latestService, socialMediaService, eastSussex1SpaceService, webChatSettingsService, escisService); return(model); }
protected async override void OnAppearing() { base.OnAppearing(); App.ReadUnread = "null"; App.FollowUp = "null"; App.OrderByText = Constants.LastPostDateText; App.SelectedTitle = string.Empty; App.SelectedName = string.Empty; var leftSwipeGesture = new SwipeGestureRecognizer { Direction = SwipeDirection.Left }; ViewModel = new LandingViewModel(); this.BindingContext = ViewModel; if (App.IsFirstTime) { App.IsFirstTime = false; ViewModel.FooterNavigation(SessionService.BaseFooterItems[0]); } txtName.Text = Settings.LoggedInUser.name; if (NetworkCheck.IsInternet()) { await ViewModel.FetchClosingData(); } else { await DisplayAlert("Simon", "No network is available.", "OK"); } }
public LandingPage(LoginModel model) { InitializeComponent(); BindingContext = _viewModel = new LandingViewModel(this.Navigation); if (model != null) { } }
public IActionResult Index() { var user = HttpContext.Session.Get <User>("User"); var lvm = new LandingViewModel(user); //Set current weather in session HttpContext.Session.Set <RootObject>("CurrentWeather", lvm.GetCurrentWeather()); return(View(lvm)); }
public LandingPage() { this.InitializeComponent(); var vm = new LandingViewModel(); foreach (var item in vm.LandingItems.SelectMany(l => l)) { item.TitleId = loader.GetString(item.TitleId); } DataContext = vm; }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { var view = inflater.Inflate(Resource.Layout.fragment_landing, null); ViewHolder = new FragmentLandingViewHolder(view); ViewModel = App.ViewModelLocator.CreateLandingViewModel(); ViewHolder.SpendingsLayout.Click += SpendingsLayout_Click; ViewHolder.LayoutAttachments.Click += LayoutAttachments_Click; ViewHolder.TakePhotoLayout.Click += TakePhotoLayout_Click; SetBindings(); return(view); }
public Landing () { InitializeComponent (); this.Title = "Coffee"; var vm = new LandingViewModel (); this.btnContinue.Clicked += async (sender, e) => { await this.Navigation.PushAsync (new CoffeeList ()); this.Navigation.RemovePage (this); }; this.BindingContext = vm; }
public IActionResult Index() { List <Course> courses = (List <Course>)_coursedb.GetFiveCourses(); List <LandingViewModel> courseList = new List <LandingViewModel>(); foreach (Course entry in courses) { LandingViewModel viewCourse = new LandingViewModel() { Name = entry.Name, TeacherName = entry.TeacherFirstName + " " + entry.TeacherLastName, EstimatedDuration = entry.EstimatedDuration, Image = entry.Image }; courseList.Add(viewCourse); } return(View(courseList)); }
public LandingPage() { InitializeComponent(); BindingContext = _viewModel = new LandingViewModel(this.Navigation); }
public LandingView() { InitializeComponent(); BindingContext = new LandingViewModel(); }
public LandingPage() { InitializeComponent(); // BindingContext = new LandingViewModel(ServiceLocator.Current.GetInstance<IEmployeeService>(), Navigation); BindingContext = new LandingViewModel(Navigation); }
public IActionResult Index(LandingViewModel model) { return(View()); }
public LandingController(IPredictionRepository predictionRepository, IStatisticsRepository statisticsRepository) { this.predictionRepository = predictionRepository; this.statisticsRepository = statisticsRepository; viewModel = new LandingViewModel(); }