示例#1
0
        void Webview_Main_LoadFinished(object sender, EventArgs e)
        {
            loadingOverlay.Hide();
            var currentURL = webview_Main.Request.Url.AbsoluteString;

            //new UIAlertView("App Be", "Url: " + currentURL, null, "Ok", null).Show();
            if (currentURL != uriLOGIN)
            {
                //new UIAlertView("Welcome", "Welcome to indigent Register ", null, "Continue", null).Show();


                //UIStoryboard board = UIStoryboard.FromName("ViewController", null);

                //UIViewController ctrl = (UIViewController)board.InstantiateViewController("MainTabController");

                //ctrl.ModalTransitionStyle = UIModalTransitionStyle.FlipHorizontal;

                //this.PresentViewController(ctrl, true, null);


                this.PerformSegue("MainTabController", this);

                //UIApplication.SharedApplication.Windows[0].RootViewController = UIStoryboard.FromName(" MainTabController", null);

                //var detail = this.Storyboard.InstantiateViewController("MainTabController") as MainTabController;

                //NavigationController.PushViewController(detail,true);

                //detail.Title = "Indigent Register";
            }
        }
示例#2
0
        public void Webview_Main_LoadFinished(object sender, EventArgs e)
        {
            if (webview_main.Request.Url.AbsoluteString.Contains("http://mtraders.co.za/DataCapturers_mobile"))
            {
                IndigentApplicantsViewController.BackStack++;
                //new UIAlertView("TEST", "backstack: " + IndigentApplicantsViewController.BackStack.ToString(), null, "Continue", null).Show();
            }
            else
            {
                IndigentApplicantsViewController.BackStack = 0;
            }


            var currentURL = webview_main.Request.Url.AbsoluteString;

            previousUri = currentURL;
            //new UIAlertView("App Be", "Url: " + currentURL, null, "Ok", null).Show();



            if (currentURL == uriLOGIN || currentURL == urERROR)
            {
                TabBar.Hidden = true;
            }
            else
            {
                LoggedIn      = true;
                TabBar.Hidden = false;
                keeptrack++;
                if (keeptrack == 1 && LoggedIn)
                {
                    new UIAlertView("Welcome", "Welcome to indigent Register ", null, "Continue", null).Show();
                }
            }

            if (currentURL == urERROR)
            {
                webview_main.LoadRequest(new NSUrlRequest(new NSUrl(uriLOGIN)));
            }

            loadingOverlay.Hide();
        }
示例#3
0
        public override void ViewWillAppear(bool animated)
        {
            base.ViewWillAppear(animated);
            var bounds = UIScreen.MainScreen.Bounds;

            loading = new LoadingOverlay(bounds, "Updating Signature");

            this.SetToolbarItems(new UIBarButtonItem[] {
                new UIBarButtonItem(UIBarButtonSystemItem.Cancel, (s, e) => {
                    DismissViewController(true, null);


                    Console.WriteLine("Cancel clicked");
                })
                , new UIBarButtonItem(UIBarButtonSystemItem.FlexibleSpace)
                {
                    Width = 50
                }
                , new UIBarButtonItem(UIBarButtonSystemItem.Save, async(s, e) => {
                    //var detail = this.Storyboard.InstantiateViewController("IndigentApplicantsViewController") as IndigentApplicantsViewController;


                    //NavigationController.PopViewController(true);

                    var img = signature.GetImage();


                    try
                    {
                        // show the loading overlay on the UI thread using the correct orientation sizi

                        View.Add(loading);


                        using (NSData imageData = img.AsPNG())
                        {
                            Byte[] myByteAray = new Byte[imageData.Length];
                            System.Runtime.InteropServices.Marshal.Copy(imageData.Bytes, myByteAray, 0, Convert.ToInt32(imageData.Length));


                            await Task.Delay(1000);
                            bool upload = uploadSignature(myByteAray);
                            loading.Hide();
                        }

                        new UIAlertView("Sucess", "Signature Updated", null, "Ok", null).Show();
                    }
                    catch (Exception ex)
                    {
                        new UIAlertView("Error", ex.Message, null, "Ok", null).Show();

                        //new Android.Support.V7.App.AlertDialog.Builder(Activity).SetTitle("Indigent App Error").SetMessage("Upload failed: " + ex.Message + "\n \nPlease try again later").SetCancelable(true).Show();
                    }

                    backFromsign = true;
                    DismissViewController(true, null);

                    Console.WriteLine("Save clicked");
                })
            }, false);

            this.NavigationController.ToolbarHidden = false;
        }