public ListRender(EbMobilePage Page, EbDataRow row)
 {
     InitializeComponent();
     BindingContext     = ViewModel = new ListViewModel(Page, row);
     ViewModel.EbLayout = EbLayout;
     EbLayout.ShowLoader();
 }
Ejemplo n.º 2
0
 public Home()
 {
     InitializeComponent();
     BindingContext     = viewModel = new HomeViewModel();
     viewModel.EbLayout = EbLayout;
     EbLayout.ShowLoader();
 }
Ejemplo n.º 3
0
        protected async override void OnAppearing()
        {
            base.OnAppearing();
            try
            {
                CurrentLocation.Text = App.Settings.CurrentLocation?.LongName.ToLower();

                if (!isRendered)
                {
                    viewModel.Initialize();

                    bool flag = !viewModel.IsNullOrEmpty() && viewModel.Applications.Count == 1;

                    if (!isInternal && flag)
                    {
                        await viewModel.AppSelected(viewModel.Applications[0]);
                    }
                    isRendered = true;
                }
            }
            catch (Exception ex)
            {
                EbLog.Error(ex.Message);
            }
            EbLayout.HideLoader();
        }
Ejemplo n.º 4
0
        protected override async Task NavigateToFabLink()
        {
            if (IsTapped || EbPageHelper.IsShortTap())
            {
                return;
            }
            IsTapped = true;
            Loader msgLoader = EbLayout.GetMessageLoader();

            msgLoader.IsVisible = true;
            msgLoader.Message   = "Loading...";
            string linkRefID = Visualization.UseLinkSettings ? Visualization.LinkRefId : Visualization.FabLinkRefId;

            EbMobilePage page = EbPageHelper.GetPage(linkRefID);

            if (page != null && page.Container is EbMobileForm form)
            {
                form.NetworkType = page.NetworkMode;
                string failMsg = await EbPageHelper.ValidateFormRendering(form, msgLoader, this.ContextRecord);

                if (failMsg == null)
                {
                    await App.Navigation.NavigateMasterAsync(new FormRender(page, Visualization, ContextRecord));
                }
                else
                {
                    await App.Navigation.NavigateMasterAsync(new Redirect(failMsg));
                }
            }
            msgLoader.IsVisible = false;
            IsTapped            = false;
        }
Ejemplo n.º 5
0
        public MyApplications()
        {
            InitializeComponent();

            EbLayout.ShowLoader();
            BindingContext         = viewModel = new MyApplicationsViewModel(EbLayout.GetMessageLoader());
            EbLayout.HasBackButton = false;
        }
        public LinkedListRender(EbMobilePage page, EbMobileVisualization context, EbDataRow row)
        {
            InitializeComponent();
            BindingContext     = ViewModel = new LinkedListViewModel(page, context, row);
            ViewModel.EbLayout = EbLayout;

            this.DrawContextHeader(row, context);
            EbLayout.ShowLoader();
        }
        private async void SaveSolution_Clicked(object sender, EventArgs e)
        {
            string surl = SolutionName.Text?.Trim();

            if (string.IsNullOrEmpty(surl))
            {
                return;
            }

            try
            {
                if (!Utils.HasInternet)
                {
                    Utils.Alert_NoInternet();
                    return;
                }

                string domain = App.Settings.Vendor.GetDomain();

                if (surl.Split(CharConstants.DOT).Length == 1)
                {
                    surl += $".{domain}";
                }

                if (viewModel.IsSolutionExist(surl))
                {
                    await viewModel.RedirectToExistingSolution(surl, isMasterPage);

                    return;
                }

                EbLayout.ShowLoader();

                response = await viewModel.Validate(surl);

                if (response.IsValid)
                {
                    EbLayout.HideLoader();
                    SolutionLogoPrompt.Source = ImageSource.FromStream(() => new MemoryStream(response.Logo));
                    SolutionLabel.Text        = surl.Split(CharConstants.DOT)[0];
                    ShowSIDConfirmBox();
                    SoluUrl = surl;
                }
                else
                {
                    EbLayout.HideLoader();
                    Utils.Toast("Invalid solution URL");
                }
            }
            catch (Exception ex)
            {
                EbLog.Error(ex.Message);
            }
        }
        protected override async void OnAppearing()
        {
            base.OnAppearing();

            if (!IsRendered)
            {
                await viewModel.InitializeAsync();

                IsRendered = true;
            }
            EbLayout.HideLoader();
        }
Ejemplo n.º 9
0
        public MyApplications(bool is_internal)
        {
            isInternal = is_internal;
            InitializeComponent();

            EbLayout.ShowLoader();
            BindingContext = viewModel = new MyApplicationsViewModel(EbLayout.GetMessageLoader())
            {
                IsInternal = is_internal
            };
            EbLayout.HasBackButton = isInternal;
        }
        protected override async void OnAppearing()
        {
            base.OnAppearing();

            if (!IsRendered)
            {
                await ViewModel.InitializeAsync();

                this.ToggleLinks();
                this.UpdatePaginationBar();
            }
            IsRendered = true;
            EbLayout.HideLoader();
        }
        private void QrScannerCallback(string payload)
        {
            SolutionQrMeta meta = null;

            try
            {
                meta = JsonConvert.DeserializeObject <SolutionQrMeta>(payload);
            }
            catch (Exception ex)
            {
                EbLog.Info("failed to parse qr payload in new solution page");
                EbLog.Error(ex.Message);
                return;
            }

            if (meta == null)
            {
                return;
            }

            Device.BeginInvokeOnMainThread(async() =>
            {
                try
                {
                    if (string.IsNullOrEmpty(meta.Sid) || viewModel.IsSolutionExist(meta.Sid))
                    {
                        Utils.Toast($"{meta.Sid} exist");
                        return;
                    }
                    EbLayout.ShowLoader();
                    response = await viewModel.Validate(meta.Sid);

                    if (response.IsValid)
                    {
                        await viewModel.AddSolution(meta.Sid, response);
                        await App.Navigation.NavigateToLogin(isMasterPage);
                    }
                    else
                    {
                        Utils.Toast("invalid qr code meta");
                    }

                    EbLayout.HideLoader();
                }
                catch (Exception)
                {
                    EbLayout.HideLoader();
                }
            });
        }
        private void LocSearchBox_TextChanged(object sender, TextChangedEventArgs e)
        {
            string search = LocSearchBox.Text;

            if (search != null)
            {
                if (search.Length >= 3)
                {
                    EbLayout.ShowLoader();
                    viewModel.FilterBySearchValue(search);
                    EbLayout.HideLoader();
                    EmptyLabel.IsVisible = viewModel.Locations.Count <= 0;
                }
            }
        }
        private async void ConfirmButton_Clicked(object sender, EventArgs e)
        {
            try
            {
                await viewModel.AddSolution(SoluUrl?.Trim(), response);

                EbLayout.HideLoader();
                this.HideSIDConfirmBox();

                await App.Navigation.NavigateToLogin(isMasterPage);
            }
            catch (Exception)
            {
                ///
            }
        }
        protected override async void OnAppearing()
        {
            base.OnAppearing();

            EbLayout.ShowLoader();
            viewModel.MsgLoader = EbLayout.GetMessageLoader();
            if (!isRendered)
            {
                await viewModel.InitializeAsync();

                if (!viewModel.HasWebFormRef && viewModel.IsOnline())
                {
                    EbLog.Info($"Webform refid not configued for form '{viewModel.Page.Name}'");
                    SaveButton.IsEnabled = false;
                }
                isRendered = true;
            }
            EbLayout.HideLoader();
        }
Ejemplo n.º 15
0
        private async void EmptyBoxReloadClicked(object sender, EventArgs e)
        {
            if (!Utils.HasInternet)
            {
                Utils.Alert_NoInternet();
                return;
            }

            EbLayout.ShowLoader();

            try
            {
                await viewModel.UpdateAsync();
            }
            catch (Exception ex)
            {
                EbLog.Error("error at [EmptyBoxReload] event in application page, " + ex.Message);
            }
            EbLayout.HideLoader();
        }
Ejemplo n.º 16
0
        protected override async void OnAppearing()
        {
            base.OnAppearing();
            try
            {
                CurrentLocation.Text = App.Settings.CurrentLocation?.LongName.ToLower();
                CurrentSolution.Text = App.Settings.SolutionName;

                if (!IsRendered)
                {
                    await viewModel.InitializeAsync();

                    IsRendered = true;
                }
            }
            catch (Exception ex)
            {
                EbLog.Error(ex.Message);
            }
            EbLayout.HideLoader();
        }
        private async void StartApplicationClicked(object sender, EventArgs e)
        {
            if (!Utils.HasInternet)
            {
                Utils.Alert_NoInternet();
                return;
            }

            if (Vendor.BuildType == Enums.AppBuildType.Embedded)
            {
                EbLayout.ShowLoader();
                try
                {
                    ISolutionService service = new SolutionService();

                    ValidateSidResponse response = await service.ValidateSid(Vendor.SolutionURL);

                    if (response != null && response.IsValid)
                    {
                        await service.CreateEmbeddedSolution(response, Vendor.SolutionURL);

                        await Store.SetValueAsync(AppConst.FIRST_RUN, "true");

                        await App.Navigation.InitializeNavigation();
                    }
                }
                catch (Exception)
                {
                    Utils.Toast("Unable to finish the request");
                }
                EbLayout.HideLoader();
            }
            else
            {
                await Store.SetValueAsync(AppConst.FIRST_RUN, "true");

                await App.Navigation.InitializeNavigation();
            }
        }
 public MyActions()
 {
     InitializeComponent();
     BindingContext = viewModel = new MyActionsViewModel();
     EbLayout.ShowLoader();
 }
Ejemplo n.º 19
0
 public DoAction(int actionid)
 {
     InitializeComponent();
     BindingContext = viewModel = new DoActionViewModel(actionid);
     EbLayout.ShowLoader();
 }
 public LoginByOTP()
 {
     InitializeComponent();
     BindingContext = viewModel = new LoginByOTPViewModel(EbLayout.GetMessageLoader());
     viewModel.Bind2FAToggleEvent(ShowTwoFAWindow);
 }
Ejemplo n.º 21
0
 public async Task SyncDataClicked() => await viewModel.SyncData(EbLayout.GetMessageLoader());