public static void SetTitles(this ViewContext page, PageKeys pageKey, string title, string subTitle = null, string browserTitle = null) { page.ViewBag.PageKey = pageKey; page.ViewBag.Title = browserTitle ?? title; page.ViewBag.PageTitle = title; page.ViewBag.PageSubTitle = subTitle; }
public static void NavigateTo( this INavigationService navigationService, PageKeys pageKey, params object[] parameters) { navigationService.NavigateTo(pageKey.ToString(), parameters); }
private async Task <IActionResult> RawContactRecordInfo(int id, PageKeys pageKey, string viewName, Action <ContactModel> preView = null) { var contact = await FindContactByIdAsync(id); if (contact == null) { return(NotFound()); } var address = await FindAddressByIdAsync(contact.ContactDetails.AddressId); if (address != null) { contact.Address = address; } SetHeroLayoutViewData(contact, pageKey); var model = new ContactModel(contact); if (contact.ContactId == 0) { ViewData.SetTitleAndHeading($"Create {model.Contact.ContactType}"); } preView?.Invoke(model); await SetViewBagEmailTemplateItems(); return(View(viewName, model)); }
private void LoadDriverDocumentDetails() { long docId = FetchDocumentIdFromQueryString(); DriverDocument doc = usrSvc.GetDocumentById(docId); if (doc == null) { throw new Exception("Document not found with the ID provided"); } lblFirstName.Text = doc.User.Firstname; lblLastName.Text = doc.User.Lastname; lblEmail.Text = doc.User.Email; lblDocumentId.Text = doc.Id.ToString(); lblLicenseNumber.Text = doc.LicenseNumber; lblSSN.Text = doc.SSN.ToString(); lblVehicleNumber.Text = doc.VehicleNumber; imgPreviewVehicleImage1.ImageUrl = PageKeys.GetImageHandlerUrl(PageKeys.ImageHandlerActions.Document) + "type=" + DocumentType.VehicleImage1.ToString() + "&docId=" + docId; imgPreviewVehicleImage2.ImageUrl = PageKeys.GetImageHandlerUrl(PageKeys.ImageHandlerActions.Document) + "type=" + DocumentType.VehicleImage2.ToString() + "&docId=" + docId; imgPreviewVehicleImage3.ImageUrl = PageKeys.GetImageHandlerUrl(PageKeys.ImageHandlerActions.Document) + "type=" + DocumentType.LicenseImage.ToString() + "&docId=" + docId; SetActionButtonStatus((DocumentStatus)doc.Status); }
public static Type GetPageTypeByKey(PageKeys pageKey) { string pageKeyName = pageKey.ToString(); var pageMemberInfo = _memberInfos.Single(x => x.Name == pageKeyName); return(GetTypeByMemberInfo(pageMemberInfo)); }
/// <summary> /// Постраничная навигация /// </summary> /// <param name="pageKeys">Страница</param> /// <param name="vm">ViewModel страницы</param> /// <returns>Результат перехода</returns> public bool Navigate(PageKeys pageKeys, IViewModel vm) { Page page = index[pageKeys.ToString()]; page.DataContext = vm; Type type = page.GetType(); return(frame.Navigate(type)); }
private void SetHeroLayoutViewData(Contact contact, PageKeys pageKey) { ViewData["ContactId"] = contact.ContactId; ViewData["ContactName"] = contact.FullName; ViewData["ContactType"] = contact.ContactType; ViewData["ContactEmailAddress"] = contact.PrimaryEmail; if (contact.ContactType == ContactTypes.Person) { ViewData["ContactGender"] = contact.AsPerson.Gender; } SetHeroLayoutViewData(contact.ContactId, contact.FullName, pageKey, contact.ContactType); }
private void SetHeroLayoutViewData(Tenant tenant, PageKeys pageKey) { ViewData["TenantId"] = tenant.TenantId; ViewData["TenantName"] = tenant.TenantName; var applicationNameById = new Dictionary <int, string>(); foreach (var a in tenant.TenantApps) { applicationNameById[a.AppId] = a.AppName; } ViewData["ApplicationTitleById"] = applicationNameById; SetHeroLayoutViewData(tenant.TenantId, tenant.TenantName, pageKey); }
private void LoadProfile() { User user = GetUserData(); if (user != null) { txtFirstname.Text = user.Firstname; txtLastname.Text = user.Lastname; txtMiddlename.Text = user.Middlename; txtEmail.Text = user.Email; txtPhone.Text = user.Phone; ddlCity.SelectedValue = user.City; //Profile picture imgPPPreview.ImageUrl = PageKeys.GetImageHandlerUrl(PageKeys.ImageHandlerActions.ProfilePicture) + "userId=" + user.Id; } }
protected void grdDriverDocuments_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { DriverDocument doc = ((DriverDocument)e.Row.DataItem); long documentId = doc.Id; Image imgVehImg1 = e.Row.FindControl("imgVehImg1") as Image; imgVehImg1.ImageUrl = PageKeys.GetImageHandlerUrl(PageKeys.ImageHandlerActions.Document) + "type=" + DocumentType.VehicleImage1.ToString() + "&docId=" + documentId; Image imgVehImg2 = e.Row.FindControl("imgVehImg2") as Image; imgVehImg2.ImageUrl = PageKeys.GetImageHandlerUrl(PageKeys.ImageHandlerActions.Document) + "type=" + DocumentType.VehicleImage2.ToString() + "&docId=" + documentId; Image imgVehImg3 = e.Row.FindControl("imgVehImg3") as Image; imgVehImg3.ImageUrl = PageKeys.GetImageHandlerUrl(PageKeys.ImageHandlerActions.Document) + "type=" + DocumentType.LicenseImage.ToString() + "&docId=" + documentId; Label lblStatus = e.Row.FindControl("lblDocumentStatus") as Label; lblStatus.Text = GetDocumentStatus(doc.Status); } }
private void LoadDriverDocuments() { DriverDocument doc = GetDriverDocument(); if (doc == null) { pnlDriverDocuments.Enabled = false; } else { txtSSN.Text = doc.SSN; txtLicenseNumber.Text = doc.LicenseNumber; txtVehicleNumber.Text = doc.VehicleNumber; string imageHandlerUrl = PageKeys.GetImageHandlerUrl(PageKeys.ImageHandlerActions.Document); imgPreviewVehPic1.ImageUrl = imageHandlerUrl + "type=" + DocumentType.VehicleImage1.ToString() + "&docId=" + doc.Id; imgPreviewVehPic2.ImageUrl = imageHandlerUrl + "type=" + DocumentType.VehicleImage2.ToString() + "&docId=" + doc.Id; imgPreviewLicense.ImageUrl = imageHandlerUrl + "type=" + DocumentType.LicenseImage.ToString() + "&docId=" + doc.Id; pnlDriverDocuments.Enabled = true; } }
public async Task NavigateTo(PageKeys pageKey, object parameter) { switch (pageKey) { case PageKeys.PRODUCTS: await App.Current.MainPage.Navigation.PushAsync(new ProductsView()); break; case PageKeys.ORDERS: await App.Current.MainPage.Navigation.PushAsync(new OrdersView()); break; case PageKeys.HISTORY: await App.Current.MainPage.Navigation.PushAsync(new HistoryView()); break; case PageKeys.ALERTS: await App.Current.MainPage.Navigation.PushAsync(new AlertsView()); break; case PageKeys.CONTACTS: await App.Current.MainPage.Navigation.PushAsync(new ContactsView()); break; case PageKeys.ABOUT: await App.Current.MainPage.Navigation.PushAsync(new AboutView()); break; default: break; } }
public HomeViewModel(IShellEvents shellEvents, INavigationService navigationService) { Destinations = new ObservableCollection <string>(); foreach (string str in PageKeys.GetValues()) { Destinations.Add(str); } Navigate = ReactiveCommand.Create <string>( page => navigationService.NavigateTo(page)); this.WhenActivated((CompositeDisposable disposable) => { shellEvents.SetTitle("Home"); Disposable .Create(() => { // This is called when the view model is out of view. }) .DisposeWith(disposable); }); }
private Task <IActionResult> ContactHealthItemList <THealthItem>(int contactId, string sortCol, string sortDir, int?page, int?pageSize, PageKeys pageKey, string viewName, Func <long, IQueryable <THealthItem> > createModel, string defaultSortCol = null) where THealthItem : ITraffkTenanted => ContactHealthItemList <THealthItem>(contactId, sortCol, sortDir, page, pageSize, pageKey, viewName, c => createModel(c.ContactId), defaultSortCol);
public void NavigateTo(PageKeys pageKey, object @params = null) { _pagePair = new NavigationPageHelper(pageKey, @params); OnPageChanged?.Invoke(pageKey, @params); }
public NavigationPageHelper(PageKeys pageKey, object @params = null) { PageKey = pageKey; Params = @params; }
private void SetHeroLayoutViewData(ApplicationUser user, PageKeys pageKey) { SetHeroLayoutViewData(user.Id, user.UserName, pageKey); }
private async Task <IActionResult> ContactHealthItemDetail <THealthItem>(int contactId, PageKeys pageKey, string viewName, Func <Contact, IQueryable <THealthItem> > createModel) where THealthItem : ITraffkTenanted { var contact = await FindContactByIdAsync(contactId); if (contact == null) { return(NotFound()); } SetHeroLayoutViewData(contact, pageKey); var items = createModel(contact); items = items.Where(i => i.TenantId == this.TenantId); return(View(viewName, items.FirstOrDefault())); }
private async Task <IActionResult> ContactHealthItemList <THealthItem>(int contactId, string sortCol, string sortDir, int?page, int?pageSize, PageKeys pageKey, string viewName, Func <Contact, IQueryable <THealthItem> > createModel, string defaultSortCol = null) where THealthItem : ITraffkTenanted { var contact = await FindContactByIdAsync(contactId); if (contact == null) { return(NotFound()); } SetHeroLayoutViewData(contact, pageKey); var items = createModel(contact); items = items.Where(i => i.TenantId == this.TenantId); items = ApplyBrowse(items, sortCol ?? defaultSortCol, sortDir, page, pageSize); if (typeof(THealthItem) == typeof(MedicalClaimLine)) { var firstItem = items.FirstOrDefault() as MedicalClaimLine; ViewData[AspHelpers.ViewDataKeys.MedicalClaimNumber] = firstItem?.MedicalClaim.MedicalClaimNumber; } if (typeof(THealthItem) == typeof(MedicalClaimLineDiagnose)) { var firstItem = items.FirstOrDefault() as MedicalClaimLineDiagnose; ViewData[AspHelpers.ViewDataKeys.MedicalClaimNumber] = firstItem?.MedicalClaimLine.MedicalClaim.MedicalClaimNumber; ViewData[AspHelpers.ViewDataKeys.MedicalClaimLineNumber] = firstItem?.MedicalClaimLine.MedicalClaimLineNumber; } return(View(viewName, items)); }
private Task <IActionResult> ContactHealthItemDetail <THealthItem>(int contactId, PageKeys pageKey, string viewName, Func <long, IQueryable <THealthItem> > createModel) where THealthItem : ITraffkTenanted => ContactHealthItemDetail(contactId, pageKey, viewName, c => createModel(c.ContactId));
public void AddEntryNavigation(PageKeys addPage, PageKeys editPage, PageKeys viewPage, NavigationParameter parameter) { Configure(addPage.ToString(), typeof(AddEntryPage), parameter); Configure(editPage.ToString(), typeof(EditEntryPage), parameter); Configure(viewPage.ToString(), typeof(ViewEntryPage), parameter); }
private void CustomNavigationServiceOnOnPageChanged(PageKeys pageKey, object @params) { CurrentInnerPageType = pageKey.GetPageType(); }
private void SetHeroLayoutViewData(App app, PageKeys pageKey) { SetHeroLayoutViewData(app.AppId, app.AppName, pageKey, app.AppType); }
/// <summary> /// Постраничная навигация с параметром /// </summary> /// <param name="pageKeys">Страница</param> /// <param name="vm">ViewModel страницы</param> /// <param name="param">Дополнительные параметры при переходе на другую страницу</param> /// <returns>Результат перехода</returns> public bool Navigate(PageKeys pageKeys, IViewModel vm, object param = null) { // TODO Реализовать метод навигации с параметрами throw new NotImplementedException(); }
private void NavigateTo(PageKeys pageKey) { _customNavigationService.NavigateTo(pageKey); }
public static Type GetPageType(this PageKeys pageKey) { return(NavigationServiceHepler.GetPageTypeByKey(pageKey)); }
private void NavigateTo(PageKeys pageKey) { CurrentInnerPageType = pageKey.GetPageType(); }
public static void NavigateTo(this INavigationService navigation, PageKeys key) { navigation.NavigateTo(key.ToString()); }