Exemplo n.º 1
0
 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;
 }
Exemplo n.º 2
0
 public static void NavigateTo(
     this INavigationService navigationService,
     PageKeys pageKey,
     params object[] parameters)
 {
     navigationService.NavigateTo(pageKey.ToString(), parameters);
 }
Exemplo n.º 3
0
        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));
        }
Exemplo n.º 4
0
        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));
        }
Exemplo n.º 6
0
        /// <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));
        }
Exemplo n.º 7
0
 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);
 }
Exemplo n.º 8
0
        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);
        }
Exemplo n.º 9
0
        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;
            }
        }
Exemplo n.º 10
0
        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);
            }
        }
Exemplo n.º 11
0
        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;
            }
        }
Exemplo n.º 12
0
        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;
            }
        }
Exemplo n.º 13
0
        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);
            });
        }
Exemplo n.º 14
0
 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);
Exemplo n.º 15
0
        public void NavigateTo(PageKeys pageKey, object @params = null)
        {
            _pagePair = new NavigationPageHelper(pageKey, @params);

            OnPageChanged?.Invoke(pageKey, @params);
        }
Exemplo n.º 16
0
 public NavigationPageHelper(PageKeys pageKey, object @params = null)
 {
     PageKey = pageKey;
     Params  = @params;
 }
Exemplo n.º 17
0
 private void SetHeroLayoutViewData(ApplicationUser user, PageKeys pageKey)
 {
     SetHeroLayoutViewData(user.Id, user.UserName, pageKey);
 }
Exemplo n.º 18
0
        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()));
        }
Exemplo n.º 19
0
        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));
        }
Exemplo n.º 20
0
 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));
Exemplo n.º 21
0
 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);
 }
Exemplo n.º 22
0
 private void CustomNavigationServiceOnOnPageChanged(PageKeys pageKey, object @params)
 {
     CurrentInnerPageType = pageKey.GetPageType();
 }
Exemplo n.º 23
0
 private void SetHeroLayoutViewData(App app, PageKeys pageKey)
 {
     SetHeroLayoutViewData(app.AppId, app.AppName, pageKey, app.AppType);
 }
Exemplo n.º 24
0
 /// <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();
 }
Exemplo n.º 25
0
 private void NavigateTo(PageKeys pageKey)
 {
     _customNavigationService.NavigateTo(pageKey);
 }
Exemplo n.º 26
0
 public static Type GetPageType(this PageKeys pageKey)
 {
     return(NavigationServiceHepler.GetPageTypeByKey(pageKey));
 }
Exemplo n.º 27
0
 private void NavigateTo(PageKeys pageKey)
 {
     CurrentInnerPageType = pageKey.GetPageType();
 }
Exemplo n.º 28
0
 public static void NavigateTo(this INavigationService navigation, PageKeys key)
 {
     navigation.NavigateTo(key.ToString());
 }