コード例 #1
0
		private async void saveClicked()
		{

			if (!currentPassword.Text.Equals ("") && currentPassword.Text != null && !newPassword.Text.Equals ("") && newPassword.Text != null && !confirmNewPassword.Text.Equals ("") && confirmNewPassword.Text != null) {

				if (newPassword.Text.Equals(confirmNewPassword.Text)) {
					var repo = new RSContentRepository ();
					var deviceId = Android.OS.Build.Serial.ToString ();
					var acct = App.Instance.GetCacheItem<AccountInfo> (DataCacheEnum.CURRENTACCOUNT);
					ChangePasswordRequest passwordRequest = RequestObjectFactory.GetChangePasswordRequestObject (acct, deviceId, currentPassword.Text, newPassword.Text, confirmNewPassword.Text);
					var changePassword = await repo.GetChangePassword (passwordRequest);
					if (changePassword.success) {
						Toast.MakeText (this, "Your Password has been changed successfully.", ToastLength.Short).Show ();
						Finish ();
					} else if (changePassword.errorList.Count > 0) {
						Toast.MakeText (this, "Password change was unsuccessful, try again.\n" + changePassword.errorList [0].errorDescription, ToastLength.Short).Show ();	
						currentPassword.Text = "";
						newPassword.Text = "";
						confirmNewPassword.Text = "";
					}
				} else {
					Toast.MakeText (this, "Passwords do not match, try again.", ToastLength.Long).Show();
					currentPassword.Text = "";
					newPassword.Text = "";
					confirmNewPassword.Text = "";
				}

			} else {
				Toast.MakeText (this, "Password should not be empty, try again.", ToastLength.Long).Show ();
				currentPassword.Text = "";
				newPassword.Text = "";
				confirmNewPassword.Text = "";
			}
		}
コード例 #2
0
		private async void saveClicked ()
		{
			if (!newUserID.Text.Equals ("") && newUserID.Text != null && confirmUserID != null && !confirmUserID.Equals ("")) {
				if (newUserID.Text.Equals (confirmUserID.Text)) {
					var repo = new RSContentRepository ();

					var deviceId = Android.OS.Build.Serial.ToString ();

					var currentAccount = App.Instance.GetCacheItem<AccountInfo> (DataCacheEnum.CURRENTACCOUNT);
					var userName = RequestObjectFactory.GetChangeUsernameRequestObject (currentAccount, deviceId, newUserID.Text, confirmUserID.Text);
					var changeUsername = await repo.GetChangeUsername (userName);
					Console.WriteLine ("Response " + changeUsername);
					if (changeUsername.success) {
						Toast.MakeText (this, "The following User ID has been created : " + newUserID.Text , ToastLength.Short).Show ();
						Finish ();
					} else if (changeUsername.errorList.Count > 0) {
						Toast.MakeText (this, "The User ID is formatted incorrectly.\n" + changeUsername.errorList [0].errorDescription, ToastLength.Short).Show ();	
						newUserID.Text = "";
						confirmUserID.Text = "";
					}
				} else {
					Toast.MakeText (this, "Your User ID’s do not match. Please try again.", ToastLength.Long).Show();
					newUserID.Text = "";
					confirmUserID.Text = "";
				}

			} else {
				Toast.MakeText (this, "The User ID is formatted incorrectly. Please try again.", ToastLength.Long).Show ();
				newUserID.Text = "";
				confirmUserID.Text = "";
			}

		}
コード例 #3
0
		public async override void ViewDidLoad ()
		{
			base.ViewDidLoad ();

			if (!App.authManager.TicketExpired ()) {

				try {
					appDelegate = (AppDelegate)UIApplication.SharedApplication.Delegate;

					var repo = new RSContentRepository ();

					var accounts = await repo.GetAccounts ();
                    GetStrongPassword ();

					if (accounts.Count > 1) {
						var accountSwitch = new UIBarButtonItem (UIImage.FromBundle ("SwitchAccount")
						, UIBarButtonItemStyle.Plain
						, (sender, args) => {
							appDelegate.Window.RootViewController = Storyboard.InstantiateViewController ("AccountScreen") as RSAccountViewController;
						});

						accountSwitch.TintColor = UIColor.Clear.FromHexString (RSColors.MM_BLUE);
						accountSwitch.Enabled = true;

						this.NavigationItem.SetRightBarButtonItem (accountSwitch, true);
					}

					var spacing = 5.0f;
					var TotalHeaderFrame = new CGRect (0, spacing, View.Frame.Width, 20f);
					var TotalBalanceFrame = new CGRect (0, TotalHeaderFrame.Bottom, View.Frame.Width, 60f);
					var ReturnRateFrame = new CGRect (15f, TotalBalanceFrame.Bottom + 2 * spacing, View.Frame.Width - (15 * 3), 25f);
					var ContributionFrame = new CGRect (15f, ReturnRateFrame.Bottom, View.Frame.Width - (15f * 3), 25f);
					var PortfolioHeaderFrame = new CGRect (15f, ContributionFrame.Bottom + 4 * spacing, (View.Frame.Width / 2), 20f);

					var DashboardControlFrame = new CGRect (PortfolioHeaderFrame.Right, ContributionFrame.Bottom + 4 * spacing, View.Frame.Width - PortfolioHeaderFrame.Width - 25f, 25f);

					var scrollFrame = new CGRect (0, this.NavigationController.NavigationBar.Frame.Height + UIApplication.SharedApplication.StatusBarFrame.Height, View.Frame.Width, View.Frame.Height);
					var chartFrame = new CGRect (0, PortfolioHeaderFrame.Bottom + 3 * spacing, View.Frame.Width, 620f);
					DashboardScrollView = new UIView (scrollFrame);

					var dashboardSegmentControl = new UISegmentedControl (DashboardControlFrame);
					dashboardSegmentControl.TintColor = UIColor.Clear.FromHexString (RSColors.MM_BLUE);
					dashboardSegmentControl.InsertSegment ("List", 0, false);
					dashboardSegmentControl.InsertSegment ("Chart", 1, false);
					dashboardSegmentControl.SelectedSegment = 0;
					dashboardSegmentControl.ControlStyle = UISegmentedControlStyle.Plain;
					dashboardSegmentControl.SetWidth (DashboardControlFrame.Width / 2, 0);
					dashboardSegmentControl.SetWidth (DashboardControlFrame.Width / 2, 1);

					LoadingIndicator.StartAnimating ();

					var currentDashboard = await repo.GetDashboard ();

					var TotalHeader = new UILabel (TotalHeaderFrame) {
						Font = UIFont.SystemFontOfSize (12f),
						TextColor = UIColor.Clear.FromHexString (RSColors.RS_BLACK),
						Text = String.Format ("Total Balance as of {0}", Convert.ToDateTime (currentDashboard.totalBalanceValDate).ToString ("MM/dd/yy")),
						TextAlignment = UITextAlignment.Center
					};
	

					var TotalBalance = new UILabel (TotalBalanceFrame) {
						Font = UIFont.BoldSystemFontOfSize (39f),
						TextColor = UIColor.Clear.FromHexString (RSColors.GREEN_4),
						Text = String.Format ("{0:C}", currentDashboard.totalBalance),
						TextAlignment = UITextAlignment.Center,
					};
					

					var divider = new UIView (new CGRect (View.Frame.Left, TotalBalanceFrame.Bottom, View.Frame.Width, 1f)) {
						Alpha = 0.5f,
						BackgroundColor = UIColor.Clear.FromHexString (RSColors.RS_LIGHT_GRAY_2)
					};

					var lblReturnRateInfo = new UILabel (ReturnRateFrame) {
						Font = UIFont.SystemFontOfSize (12f),
						TextColor = UIColor.Clear.FromHexString (RSColors.RS_BLACK),
						Text = String.Format ("Rate of Return {0} - {1}", Convert.ToDateTime (currentDashboard.rorStartDate).ToString ("MM/dd/yy"), Convert.ToDateTime (currentDashboard.rorEndDate).ToString ("MM/dd/yy")),
						TextAlignment = UITextAlignment.Left,
						ContentMode = UIViewContentMode.Center
					};

					var lblReturnRateAmount = new UILabel (ReturnRateFrame) {
						Font = UIFont.FromName ("HelveticaNeue-Medium", 12f),
						TextColor = UIColor.Clear.FromHexString (RSColors.GREEN_4),
						Text = String.Format ("{0:P}", currentDashboard.rateOfReturn),
						TextAlignment = UITextAlignment.Right,
						ContentMode = UIViewContentMode.Center
					};

					var lblContributionInfo = new UILabel (ContributionFrame) {
						Font = UIFont.SystemFontOfSize (12f),
						TextColor = UIColor.Clear.FromHexString (RSColors.RS_BLACK),
						Text = String.Format ("Last Contrib/Payroll Amt {0}", currentDashboard.lastContributionDate.Trim () != "" ? Convert.ToDateTime (currentDashboard.lastContributionDate).ToString ("MM/dd/yy") : "N/A"),
						TextAlignment = UITextAlignment.Left,
						ContentMode = UIViewContentMode.Center
					};

					var lblContributionAmount = new UILabel (ContributionFrame) {
						Font = UIFont.FromName ("HelveticaNeue-Medium", 12f),
						TextColor = UIColor.Clear.FromHexString (RSColors.GREEN_4),
						Text = String.Format ("{0:C}", currentDashboard.lastContributionAmount),
						TextAlignment = UITextAlignment.Right,
						ContentMode = UIViewContentMode.Center
					};

					var divider2 = new UIView (new CGRect (View.Frame.Left + 15f, ContributionFrame.Bottom + spacing, View.Frame.Width - (15f * 2), 1f)) {
						BackgroundColor = UIColor.Clear.FromHexString (RSColors.RS_LIGHT_GRAY),
						Alpha = 0.5f
					};

					var PortfolioHeader = new UILabel (PortfolioHeaderFrame) {
						Font = UIFont.SystemFontOfSize (12f),
						TextColor = UIColor.Clear.FromHexString (RSColors.RS_BLACK),
						Text = "My Investment Portfolio",
						TextAlignment = UITextAlignment.Left
					};

					var catChartData = new List<IChartInput> ();

					if (currentDashboard.fundsInfo != null) {
						var result = currentDashboard.fundsInfo.funds.GroupBy (x => x.assetCategoryDescripton).Select (fc => new GenericChartInput () {
							Name = fc.Key,
							Amount = fc.Sum (s => s.fundBalance)
						}).ToList ();

						foreach (var gi in result.OrderByDescending(x => x.Amount).ToList()) {
							catChartData.Add (gi);
						}
					}

					PortfolioChart = new CircleChartControl (this);
					PortfolioChart.Data = ChartBuilder.ChartSourceBuilder (catChartData, RSColors.chartColorArray, false);
					PortfolioChart.GraphLineThickness = 16;
					PortfolioChart.TableType = TableTypeMode.None;
					PortfolioChart.Frame = chartFrame;

					PortfolioTable = new CircleChartControl (this);
					PortfolioTable.Data = ChartBuilder.ChartSourceBuilder (catChartData, RSColors.chartColorArray, false);
					PortfolioTable.TableType = TableTypeMode.TableView;
					PortfolioTable.Frame = chartFrame;
					PortfolioTable.ChartTitle = "Investment Category & Allocation";
			

					DashboardScrollView.AddSubview (TotalHeader);
					DashboardScrollView.AddSubview (TotalBalance);
					DashboardScrollView.AddSubview (divider);
					DashboardScrollView.AddSubview (lblReturnRateInfo);
					DashboardScrollView.AddSubview (lblReturnRateAmount);
					DashboardScrollView.AddSubview (lblContributionInfo);
					DashboardScrollView.AddSubview (lblContributionAmount);
					DashboardScrollView.AddSubview (divider2);
					DashboardScrollView.AddSubview (PortfolioHeader);
					DashboardScrollView.AddSubview (dashboardSegmentControl);


					if (currentDashboard.fundsInfo != null) {
						DashboardScrollView.AddSubview (PortfolioChart);
						DashboardScrollView.AddSubview (PortfolioTable);
					}

					dashboardSegmentControl.ValueChanged += (sender, e) => {
						var selectedSegmentId = (sender as UISegmentedControl).SelectedSegment;

						if (selectedSegmentId == 0) {
							//PortfolioChart.TableType = TableTypeMode.None;
							PortfolioChart.Hidden = true;
							PortfolioTable.Hidden = false;
							GAI.SharedInstance.DefaultTracker.Send (GAIDictionaryBuilder.CreateEvent ("Dashboard Display", "List Selection", null, null).Build ());

						} else if (selectedSegmentId == 1) {
							//PortfolioChart.TableType = TableTypeMode.TableView;
							PortfolioChart.Hidden = false;
							PortfolioTable.Hidden = true;
							GAI.SharedInstance.DefaultTracker.Send (GAIDictionaryBuilder.CreateEvent ("Dashboard Display", "Chart Selection", null, null).Build ());
						}
					};

					if (AppDelegate.iPhone4) {
						dashboardSegmentControl.Hidden = true;
					}

					ReturnRateButton.TouchUpInside += (object sender, EventArgs e) => {
						PerformSegue ("modalReturnRate", this);
					};

					LastContributionButton.TouchUpInside += (object sender, EventArgs e) => {
						PerformSegue ("modalLastContribution", this);
					};
			

					LoadingLabel.Hidden = true;
					TotalBalanceBackground.Hidden = false;

					ReturnRateButton.TintColor = UIColor.Clear.FromHexString (RSColors.MM_BLUE);
					ReturnRateButton.Hidden = false;

					if (currentDashboard.HasLoans == true) {
						LastContributionButton.TintColor = UIColor.Clear.FromHexString (RSColors.MM_BLUE);
						LastContributionButton.Hidden = false;
					}

					LoadingIndicator.StopAnimating ();

					View.AddSubview (DashboardScrollView);
					InvokeOnMainThread (() => {
						this.View.AddSubview (ReturnRateButton);
						this.View.AddSubview (LastContributionButton);
					});

					ViewDidLayoutSubviews ();
				} catch (NoAccountsAvailableException naae) {
					Insights.Report (naae, ReportSeverity.Error);
					await DialogUtil.ShowAlert ("No Accounts Available", "No Account Information could be loaded.", "OK");
					app.Window.RootViewController = Storyboard.InstantiateViewController ("LoginScreen") as TSLoginViewController;
				} catch (CurrentAccountNotSetException naae) {
					Insights.Report (naae, ReportSeverity.Error);
					await DialogUtil.ShowAlert ("Current Account Not Set", "Please Login Again", "OK");
					app.Window.RootViewController = Storyboard.InstantiateViewController ("LoginScreen") as TSLoginViewController;
				} catch (TokenNotAvailableException tnae) {
					Insights.Report (tnae, ReportSeverity.Error);
					await DialogUtil.ShowAlert ("Token Error", "Token not available for authentication. Please login again.", "OK");
					app.Window.RootViewController = Storyboard.InstantiateViewController ("LoginScreen") as TSLoginViewController;
				} catch (Exception e) {
					if (!CrossConnectivity.Current.IsConnected) {
						await DialogUtil.ShowAlert ("Network Unavailable", "This application requires internet access to function. Please check your connection and try again.", "OK");
						InvalidateSession ();
					} else {
						Insights.Report (e, ReportSeverity.Error);
						await DialogUtil.ShowAlert ("Server Error Occurred", "Unable to retrieve Dashboard at this time.", "OK");
						app.Window.RootViewController = Storyboard.InstantiateViewController ("LoginScreen") as TSLoginViewController;
					}
				}

			}

		}
コード例 #4
0
 //Getting the Strong Password
 private async void  GetStrongPassword ()
 {
     try{
         var repo = new RSContentRepository ();
         var deviceId = UIKit.UIDevice.CurrentDevice.IdentifierForVendor.AsString ();          
         var acct = AppCache.Instance.GetCacheItem<AccountInfo> (AppCache.AppCacheKey.CURRENTACCOUNT);
         var passwordIndRequest = RequestObjectFactory.GetStrongPasswordIndObject (acct, deviceId);
         var pwdInreq = await repo.GetStrongPasswordInd (passwordIndRequest);
         AppCache.Instance.CanChangePassword = pwdInreq.strongPasswordReqInd;
     }catch(Exception e){
         UIAlertView alert = new UIAlertView("Unable to process your request.", "Please try again later", null, "OK");
         alert.Show();
         return;
     }
 }
コード例 #5
0
        public async override void ViewDidLoad ()
        {
            base.ViewDidLoad ();
            if (!CrossConnectivity.Current.IsConnected)
            { 
                await DialogUtil.ShowAlert ("Network Unavailable", "This application requires internet access to function. Please check your connection and try again.", "OK");
                return;
            }
            if (AppCache.Instance.CanChangePassword)
                this.Title = "PIN";
            else
                this.Title = "Password (PIN)";

                #region Navigation

                var Cancel = new UIBarButtonItem("Cancel"
                , UIBarButtonItemStyle.Plain
                , (sender, args) =>
                    {
                        this.NavigationController.PopViewController(true);
                    });

                Cancel.TintColor = UIColor.Clear.FromHexString(RSColors.MM_BLUE);
                Cancel.Enabled = true;
                this.NavigationItem.SetLeftBarButtonItem(Cancel, true);

                #endregion

                this.View.BackgroundColor = UIColor.Clear.FromHexString(RSColors.RS_LIGHT_GRAY_4);
                nfloat ScreenWidth = UIScreen.MainScreen.Bounds.Width;
                nfloat ScreenHeight = UIScreen.MainScreen.Bounds.Height;

                ChangePinScrollview = new UIScrollView(new CGRect(0, 63, ScreenWidth, ScreenHeight + 700));
                ChangePinView = new UIView(new CGRect(0, -63, ScreenWidth, ScreenHeight - 63));
                ChangePinScrollview.ContentSize = new Size((int)ScreenWidth, (int)ScreenHeight + 700);
                ChangePinScrollview.ScrollEnabled = true;
                ChangePinScrollview.UserInteractionEnabled = true;
                ChangePinScrollview.AddSubview(ChangePinView);
                this.View.Add(ChangePinScrollview);
                var EnterLabel = new UILabel(new CGRect(0, 28, 100, 18))
                {
                    Font = UIFont.FromName("HelveticaNeue", 12f),
                    TextAlignment = UITextAlignment.Left,
                    Text = "     ENTER",
                    TextColor = UIColor.Clear.FromHexString(RSColors.RS_DARK_GRAY)
                };

                //ChangePinView.AddSubview(EnterLabel);
                var EnterView = new UIView(new CGRect(-1, 0, ScreenWidth + 2, 55))
                {
                    BackgroundColor = UIColor.Clear.FromHexString(RSColors.RS_LIGHT_GRAY_4),
                };

                EnterView.AddSubview(EnterLabel);
                ChangePinView.Add(EnterView);

                #region Validation Text
                var MainPINView = new UIView(new CGRect(0, EnterView.Frame.Height + EnterView.Frame.Y, ScreenWidth, 153))
                {
                    BackgroundColor = UIColor.White
                };
               // View.AddSubview(MainPINView);
                ChangePinView.AddSubview(MainPINView);
                MainPINView.Layer.BorderWidth = 1;
                MainPINView.Layer.BorderColor = UIColor.Clear.FromHexString(RSColors.RS_LIGHT_GRAY_5).CGColor;
                var CurrentPinTextField = new UITextField(new CGRect(15, 0, ScreenWidth - 15, 50))
                {
                    Font = UIFont.FromName("HelveticaNeue", 15f),
                    TintColor = UIColor.Black,
                    Placeholder = "Current PIN",
                    KeyboardType = UIKeyboardType.NumberPad,
                    SecureTextEntry = true
                };

                MainPINView.Add(CurrentPinTextField);

                var PinView = new UIView(new CGRect(15, CurrentPinTextField.Frame.Height + CurrentPinTextField.Frame.Y, ScreenWidth - 15, 1))
                {
                    BackgroundColor = UIColor.Clear.FromHexString(RSColors.RS_LIGHT_GRAY_6)
                };
                MainPINView.Add(PinView);

                var NewPinTextField = new UITextField(new CGRect(15, CurrentPinTextField.Frame.Height + CurrentPinTextField.Frame.Y + 1, ScreenWidth - 15, 50))
                {
                    Font = UIFont.FromName("HelveticaNeue", 15f),
                    BackgroundColor = UIColor.Clear.FromHexString(RSColors.RS_WHITE),
                    Placeholder = "New PIN",
                    KeyboardType = UIKeyboardType.NumberPad,
                    SecureTextEntry = true
                };

                MainPINView.Add(NewPinTextField);

                var PasswordView = new UIView(new CGRect(15, NewPinTextField.Frame.Height + NewPinTextField.Frame.Y, ScreenWidth - 15, 1))
                {
                    BackgroundColor = UIColor.Clear.FromHexString(RSColors.RS_LIGHT_GRAY_6)
                };
                MainPINView.Add(PasswordView);


                var RetypePinTextField = new UITextField(new CGRect(15, NewPinTextField.Frame.Height + NewPinTextField.Frame.Y + 1, ScreenWidth - 15, 50))
                {
                    Font = UIFont.FromName("HelveticaNeue", 15f),
                    BackgroundColor = UIColor.Clear.FromHexString(RSColors.RS_WHITE),
                    Placeholder = "Retype New PIN",
                    KeyboardType = UIKeyboardType.NumberPad,
                    SecureTextEntry = true
                };
                MainPINView.Add(RetypePinTextField);

                var IDView = new UIView(new CGRect(15, RetypePinTextField.Frame.Height + RetypePinTextField.Frame.Y, ScreenWidth - 15, 1))
                {
                    BackgroundColor = UIColor.Clear.FromHexString(RSColors.RS_LIGHT_GRAY_6)
                };
                MainPINView.Add(IDView);

                //WebView
                var ChangePinwebView = new UIWebView(new CGRect(0, MainPINView.Frame.Height + MainPINView.Frame.Y + 20, ScreenWidth, 120));
                ChangePinwebView.Layer.BorderWidth = 1;
                ChangePinwebView.Layer.BorderColor = UIColor.Clear.FromHexString(RSColors.RS_LIGHT_GRAY_5).CGColor;
                loadingOverlay = new LoadingOverlay(ChangePinwebView.Bounds);
                ChangePinwebView.AddSubview(loadingOverlay);
                ChangePinView.AddSubview(ChangePinwebView);
                ChangePinwebView.UserInteractionEnabled = false;
                ChangePinwebView.LoadRequest(new NSUrlRequest(new NSUrl(UrlConsts.URL_CHANGE_LOGIN_PIN_RULES)));
                ChangePinwebView.LoadFinished += (sender, e) =>
                {
                    if (loadingOverlay != null)
                    {
                        loadingOverlay.Hide();
                        loadingOverlay = null;
                    }
                };
                #endregion

                var Save = new UIBarButtonItem("Save"
                , UIBarButtonItemStyle.Plain
                , async(sender, args) =>
                    {
                        if (App.authManager.TicketExpired())
                        {
                            await DialogUtil.ShowAlert("Session Expired", "Your session has expired. Returning to Login Screen", "OK");
                            InvalidateSession();
                            return;
                        } 
                        if (!CrossConnectivity.Current.IsConnected)
                        {
                            await DialogUtil.ShowAlert("Network Unavailable", "This application requires internet access to function. Please check your connection and try again.", "OK");
                            return;
                        }
                        if (string.IsNullOrEmpty(NewPinTextField.Text) || string.IsNullOrEmpty(RetypePinTextField.Text) || string.IsNullOrEmpty(CurrentPinTextField.Text))
                        {
                            UIAlertView alert = new UIAlertView("PIN should not be empty, try again.", " ", null, "OK");
                            alert.Show();
                            NewPinTextField.Text = string.Empty;
                            RetypePinTextField.Text = string.Empty;
                            CurrentPinTextField.Text = string.Empty;
                            return;
                        }
                        else if (!NewPinTextField.Text.Equals(RetypePinTextField.Text))
                        {
                            UIAlertView alert = new UIAlertView("PIN's do not match, try again.", " ", null, "OK");
                            alert.Show();
                            NewPinTextField.Text = string.Empty;
                            RetypePinTextField.Text = string.Empty;
                            CurrentPinTextField.Text = string.Empty;
                            return;
                        } 
                        InvokeOnMainThread(() =>
                            {
                                loadingOverlay = new LoadingOverlay(this.View.Bounds);
                                this.View.AddSubview(loadingOverlay);
                            });
                    try{
                        var repo = new RSContentRepository();
                        var deviceId = UIKit.UIDevice.CurrentDevice.IdentifierForVendor.AsString(); 
                        var acct = AppCache.Instance.GetCacheItem<AccountInfo>(AppCache.AppCacheKey.CURRENTACCOUNT);
                        var pinRequest = RequestObjectFactory.GetChangePinRequestObject(acct, deviceId, CurrentPinTextField.Text, NewPinTextField.Text, RetypePinTextField.Text);
                        var changePin = await repo.ChangePin(pinRequest);

                        if (loadingOverlay != null)
                        {
                            loadingOverlay.Hide();
                            loadingOverlay = null;
                        }
                        if (changePin.success)
                        {
                            UIAlertView alert = new UIAlertView("Your PIN has been changed successfully.", " ", null, "OK");
                            alert.Clicked += delegate (object _sender, UIButtonEventArgs btnArgs) {
                                this.NavigationController.PopViewController (false);
                            };
                            alert.Show ();
                            DeleteCredentials();
                            return;
                        }
                        else if (changePin.errorList != null && changePin.errorList.Count > 0)
                        { 
                            ErrorList errorList = changePin.errorList[0];
                            UIAlertView alert = new UIAlertView("PIN change was unsuccessful, try again.",errorList.errorDescription, null, "OK");
                            alert.Show();
                            CurrentPinTextField.Text = string.Empty;
                            NewPinTextField.Text = string.Empty;
                            RetypePinTextField.Text = string.Empty;
                            CurrentPinTextField.ResignFirstResponder();
                            NewPinTextField.ResignFirstResponder();
                            RetypePinTextField.ResignFirstResponder();
                            return;
                        }
                        else
                        {
                            UIAlertView alert = new UIAlertView("PIN change was unsuccessful, try again.", "Please try again", null, "OK");
                            alert.Show();
                            CurrentPinTextField.Text = string.Empty;
                            NewPinTextField.Text = string.Empty;
                            RetypePinTextField.Text = string.Empty;
                            CurrentPinTextField.ResignFirstResponder();
                            NewPinTextField.ResignFirstResponder();
                            RetypePinTextField.ResignFirstResponder();
                            return;
                        }
                    }catch(Exception e){
                        UIAlertView alert = new UIAlertView("Unable to process your request.", "Please try again later", null, "OK");
                        alert.Show();

                        if (loadingOverlay != null)
                        {
                            loadingOverlay.Hide();
                            loadingOverlay = null;
                        }
                        NewPinTextField.Text = string.Empty;
                        RetypePinTextField.Text = string.Empty;
                        CurrentPinTextField.Text = string.Empty;
                        return;
                    }
                       
                    });
                Save.TintColor = UIColor.Clear.FromHexString(RSColors.MM_BLUE);
                Save.Enabled = true;
                this.NavigationItem.SetRightBarButtonItem(Save, true);
            }
コード例 #6
0
		public async override void ViewDidLoad ()
		{
			base.ViewDidLoad ();


			if (App.authManager.TicketExpired ()) {
				await DialogUtil.ShowAlert ("Session Expired", "Your session has expired. Returning to Login Screen", "OK");
				AppCache.Instance.Ticket = null;
				AppCache.Instance.ClearCache ();
				NSUserDefaults.StandardUserDefaults.SetBool (false, TouchIDUtil.TouchIDSettings.TouchSwitchClicked.ToString ());
				app.Window.RootViewController = Storyboard.InstantiateViewController("LoginScreen") as TSLoginViewController;
			}

			try
			{
				var repo = new RSContentRepository();
				var dashboardInfo = await repo.GetDashboard();

				this.Title = CatName;

				var scrollFrame = new CGRect (0, this.NavigationController.NavigationBar.Frame.Height + UIApplication.SharedApplication.StatusBarFrame.Height, View.Frame.Width, View.Frame.Height);

				View.BackgroundColor = UIColor.White;

				var spacing = 5.0f;

				var TotalHeaderFrame = new CGRect (0, spacing, View.Frame.Width, 15f);
				var TotalBalanceFrame = new CGRect (0, TotalHeaderFrame.Bottom + spacing , View.Frame.Width, 60f);
				var PortfolioHeaderFrame = new CGRect (15f, TotalBalanceFrame.Bottom + 3 * spacing, (View.Frame.Width/2), 20);
				var PortfolioControlFrame = new CGRect (PortfolioHeaderFrame.Right, TotalBalanceFrame.Bottom + 3 * spacing, View.Frame.Width - PortfolioHeaderFrame.Width - 25f, 25f);

				var chartFrame = new CGRect (0, PortfolioHeaderFrame.Bottom + 3*spacing, View.Frame.Width, 700f);
				ControllerScrollView = new UIView (scrollFrame);

				var portfolioSegmentControl = new UISegmentedControl (PortfolioControlFrame);
				portfolioSegmentControl.TintColor = UIColor.Clear.FromHexString (RSColors.MM_BLUE);
				portfolioSegmentControl.InsertSegment ("List", 0, false);
				portfolioSegmentControl.InsertSegment ("Chart", 1, false);
				portfolioSegmentControl.SelectedSegment = 0;
				portfolioSegmentControl.ControlStyle = UISegmentedControlStyle.Plain;
				portfolioSegmentControl.SetWidth (PortfolioControlFrame.Width/2, 0);
				portfolioSegmentControl.SetWidth (PortfolioControlFrame.Width/2, 1);

				var TotalHeader = new UILabel(TotalHeaderFrame) {
					Font = UIFont.SystemFontOfSize(12f),
					TextColor = UIColor.Clear.FromHexString (RSColors.RS_BLACK),
					Text = "Balance",
					//Text = String.Format("{0} Balance", CatName),
					TextAlignment = UITextAlignment.Center
				};

				var CatTotal = dashboardInfo.fundsInfo.funds.Where (x => x.assetCategoryDescripton == CatName).Sum (x =>x.fundBalance);

				var TotalBalance = new UILabel(TotalBalanceFrame) {
					Font = UIFont.BoldSystemFontOfSize(39f),
					TextColor = UIColor.Clear.FromHexString (RSColors.GREEN_4),
					Text = String.Format("{0:C}", CatTotal),
					TextAlignment = UITextAlignment.Center,
				};

				var divider = new UIView(new CGRect(View.Frame.Left, TotalBalanceFrame.Bottom, View.Frame.Width, 1f))
				{
					Alpha = 0.5f,
					BackgroundColor = UIColor.Clear.FromHexString(RSColors.RS_LIGHT_GRAY)
				};

				var PortfolioHeader = new UILabel(PortfolioHeaderFrame) {
					Font = UIFont.SystemFontOfSize(12f),
					TextColor = UIColor.Clear.FromHexString (RSColors.RS_BLACK),
					Text = "My Investment by Category",
					TextAlignment = UITextAlignment.Left
				};

				var result = dashboardInfo.fundsInfo.funds.Where (x => x.assetCategoryDescripton == CatName).Select (fc => new GenericChartInput () {
					Name = fc.fundName,
					Amount = fc.fundBalance
				}).ToList();

				var catChartData = new List<IChartInput> ();

				foreach (var gi in result.OrderByDescending(x => x.Amount).ToList()) {
					catChartData.Add (gi);
				}

				chartControl = new CircleChartControl(this);
				chartControl.Data = ChartBuilder.ChartSourceBuilder (catChartData, RSColors.chartColorArray, false);
				chartControl.NavType = NavigationType.Detail;
				chartControl.TableType = TableTypeMode.None;
				chartControl.GraphLineThickness = 16;
				chartControl.Frame = chartFrame;

				tableControl = new CircleChartControl (this);
				tableControl.Data = ChartBuilder.ChartSourceBuilder (catChartData, RSColors.chartColorArray, false);
				tableControl.NavType = NavigationType.Detail;
				tableControl.TableType = TableTypeMode.TableView;
				tableControl.Frame = chartFrame;
				tableControl.ChartTitle = "Fund & Allocation";

				ControllerScrollView.AddSubview (TotalHeader);
				ControllerScrollView.AddSubview (TotalBalance);
				ControllerScrollView.AddSubview (divider);
				ControllerScrollView.AddSubview (PortfolioHeader);
				ControllerScrollView.AddSubview (portfolioSegmentControl);

				ControllerScrollView.AddSubview (chartControl);
				ControllerScrollView.AddSubview (tableControl);

				//For Segmented Control
				portfolioSegmentControl.ValueChanged += (sender, e) => {
					var selectedSegmentId = (sender as UISegmentedControl).SelectedSegment;

					if (selectedSegmentId == 0) {
						chartControl.Hidden = true;
						tableControl.Hidden = false;
						GAI.SharedInstance.DefaultTracker.Send (GAIDictionaryBuilder.CreateEvent ("Fund Display", "List Selection", null, null).Build ());
					}
					else if (selectedSegmentId == 1 ) {
						chartControl.Hidden = false;
						tableControl.Hidden = true;
						GAI.SharedInstance.DefaultTracker.Send (GAIDictionaryBuilder.CreateEvent ("Fund Display", "Chart Selection", null, null).Build ());
					}
				};

				if(AppDelegate.iPhone4)
				{
					portfolioSegmentControl.Hidden = true;
				}

				View.AddSubview (ControllerScrollView);
			}
			catch (NoAccountsAvailableException naae) 
			{
				Insights.Report (naae, ReportSeverity.Error);
				await DialogUtil.ShowAlert ("No Accounts Available", "No Account Information could be loaded.", "OK");
				app.Window.RootViewController = Storyboard.InstantiateViewController ("LoginScreen") as TSLoginViewController;
			}
			catch (CurrentAccountNotSetException naae) 
			{
				Insights.Report (naae, ReportSeverity.Error);
				await DialogUtil.ShowAlert ("Current Account Not Set", "Please Login Again", "OK");
				app.Window.RootViewController = Storyboard.InstantiateViewController ("LoginScreen") as TSLoginViewController;
			} 
			catch (TokenNotAvailableException tnae) 
			{
				Insights.Report (tnae, ReportSeverity.Error);
				await DialogUtil.ShowAlert ("Token Error", "Token not available for authentication. Please login again.", "OK");
				app.Window.RootViewController = Storyboard.InstantiateViewController ("LoginScreen") as TSLoginViewController;
			} 
			catch (Exception e) 
			{
				if (!CrossConnectivity.Current.IsConnected) {
					await DialogUtil.ShowAlert ("Network Unavailable", "This application requires internet access to function. Please check your connection and try again.", "OK");
					AppCache.Instance.Ticket = null;
					AppCache.Instance.ClearCache ();
					app.Window.RootViewController = Storyboard.InstantiateViewController("LoginScreen") as TSLoginViewController;
				} else {
					Insights.Report (e, ReportSeverity.Error);
					await DialogUtil.ShowAlert ("Server Error Occurred", "Unable to retrieve Dashboard at this time.", "OK");
					app.Window.RootViewController = Storyboard.InstantiateViewController ("LoginScreen") as TSLoginViewController;
				}
			}
		}
コード例 #7
0
		private async void  GetStrongPasswordRequired ()
		{
			var repo = new RSContentRepository ();
			var deviceId = Android.OS.Build.Serial.ToString ();         
			var acct = App.Instance.GetCacheItem<AccountInfo> (DataCacheEnum.CURRENTACCOUNT);
			var passwordIndRequest = RequestObjectFactory.GetStrongPasswordIndObject (acct, deviceId);
			var pwdInreq = await repo.GetStrongPasswordInd (passwordIndRequest);
			App.Instance.SetCacheItem (DataCacheEnum.CANCHANGEPASSWORD, pwdInreq.strongPasswordReqInd);
		}
コード例 #8
0
		public async override void ViewDidLoad ()
		{
			base.ViewDidLoad ();
			try{
				View.BackgroundColor = UIColor.White;

				this.Title = "Personal Information";

				var spacing = 10f;

				var PersonNameFrame = new CGRect (0, 10f, View.Frame.Width, 15f);
				var ActivityIndicatorFrame = new CGRect (0, 30f, View.Frame.Width, View.Frame.Height);
				var chartFrame = new CGRect (0, PersonNameFrame.Bottom + 3 * spacing, View.Frame.Width - 15f, View.Frame.Height - 170f);
				var scrollFrame = new CGRect (0, this.NavigationController.NavigationBar.Frame.Height + UIApplication.SharedApplication.StatusBarFrame.Height, View.Frame.Width, View.Frame.Height);

				ProfileActivityIndicator = new UIActivityIndicatorView (UIActivityIndicatorViewStyle.Gray);
				ProfileActivityIndicator.Frame = ActivityIndicatorFrame;
				ProfileActivityIndicator.AutoresizingMask = UIViewAutoresizing.FlexibleMargins;
				View.AddSubview (ProfileActivityIndicator);

				ProfileView = new UIView (scrollFrame);

				var repo = new RSContentRepository ();


				ProfileActivityIndicator.StartAnimating ();
				var profile = await repo.GetProfile ();
				ProfileActivityIndicator.StopAnimating ();

				if (profile != null) {
					var PersonNameHeader = new UILabel (PersonNameFrame) {
						Font = UIFont.SystemFontOfSize (15f),
						TextColor = UIColor.Clear.FromHexString (RSColors.RS_BLACK_2),
						Text = profile.GetFullName (),
						TextAlignment = UITextAlignment.Center,
					};

					var divider = new UIView (new CGRect (15f, PersonNameFrame.Bottom + 2 * spacing, View.Frame.Width - 30f, 1f)) {
						Alpha = 0.5f,
						BackgroundColor = UIColor.Clear.FromHexString (RSColors.RS_LIGHT_GRAY)
					};

					var PersonInfoTableView = new UITableView (chartFrame);

					var profileDataList = ProfileUtil.MapProfileList (profile);

					var profileTableSource = new ProfileTableViewSource (this);

					profileTableSource.Data = profileDataList;

					PersonInfoTableView.Source = profileTableSource;

					ProfileView.AddSubview (PersonNameHeader);
					ProfileView.AddSubview (divider);
					ProfileView.AddSubview (PersonInfoTableView);

					View.AddSubview (ProfileView);
					ViewDidLayoutSubviews ();

				}
			}
			catch (NoAccountsAvailableException naae) 
			{
				Insights.Report (naae, ReportSeverity.Error);
				await DialogUtil.ShowAlert ("No Accounts Available", "No Account Information could be loaded.", "OK");
				app.Window.RootViewController = Storyboard.InstantiateViewController ("LoginScreen") as TSLoginViewController;
			}
			catch (CurrentAccountNotSetException naae) 
			{
				Insights.Report (naae, ReportSeverity.Error);
				await DialogUtil.ShowAlert ("Current Account Not Set", "Please Login Again", "OK");
				app.Window.RootViewController = Storyboard.InstantiateViewController ("LoginScreen") as TSLoginViewController;
			} 
			catch (TokenNotAvailableException tnae) 
			{
				Insights.Report (tnae, ReportSeverity.Error);
				await DialogUtil.ShowAlert ("Token Error", "Token not available for authentication. Please login again.", "OK");
				app.Window.RootViewController = Storyboard.InstantiateViewController ("LoginScreen") as TSLoginViewController;
			} 
			catch (Exception e) 
			{
				Insights.Report (e, ReportSeverity.Error);
				await DialogUtil.ShowAlert ("Error Occurred", "Unable to load profile at this time.", "OK");
				await this.DismissViewControllerAsync (true);
			}

		}
コード例 #9
0
		public async override void ViewDidLoad ()
		{
			AccountActivity.StartAnimating ();

			try
			{
				var repo = new RSContentRepository();

				var accounts = await repo.GetAccounts();

				if(accounts == null)
				{
					throw new NoAccountsAvailableException("No Accounts could be found on Account Selection Screen");
				}
				AccountActivity.StopAnimating();

				var titleRect = new CGRect(View.Frame.Left, View.Frame.Top + 20f, View.Frame.Width, 40f);
				var ChoosePlanLabel = new UILabel(titleRect)
				{
					Text = "Select a Plan",
					BackgroundColor = UIColor.Clear, 
					TextColor = UIColor.Clear.FromHexString(RSColors.RS_BLACK_2), 
					Font = UIFont.FromName("HelveticaNeue-Medium", 14f),
					TextAlignment = UITextAlignment.Center,
				};


				var LogoutFrame = new CGRect(-10f, 0 + UIApplication.SharedApplication.StatusBarFrame.Height, 100f, 40f);
				var LogoutButton = new UIButton(LogoutFrame);
				LogoutButton.SetTitle("Logout", UIControlState.Normal);
				LogoutButton.SetTitleColor(UIColor.Clear.FromHexString (RSColors.MM_BLUE),UIControlState.Normal);
				LogoutButton.Font = UIFont.FromName ("HelveticaNeue-Medium", 14f);

				LogoutButton.TouchUpInside += async (object sender, EventArgs e) => 
				{
					NSUserDefaults.StandardUserDefaults.SetBool (true, TouchIDUtil.TouchIDSettings.UserLogout.ToString());
					Console.WriteLine("User Has Logged Out.");
					NSUserDefaults.StandardUserDefaults.SetBool (false, TouchIDUtil.TouchIDSettings.TouchSwitchClicked.ToString ());
					AppCache.Instance.Ticket = null;
					AppCache.Instance.ClearCache ();
					appDelegate.Window.RootViewController = Storyboard.InstantiateViewController("LoginScreen") as TSLoginViewController;
				};

				var divider = new UIView(new CGRect(View.Frame.Left, titleRect.Bottom, View.Frame.Width, 1f))
				{
					BackgroundColor = UIColor.Clear.FromHexString(RSColors.RS_LIGHT_GRAY),
					Alpha = 0.5f
				};
						
				var tableSource = new AccountTableViewSource(this);

				tableSource.Data = accounts;

				var AccountTableViewFrame = new CGRect (View.Frame.Left, divider.Frame.Bottom, View.Frame.Width, View.Frame.Height *2/3);
				var AccountTableView = new UITableView(AccountTableViewFrame);

				AccountTableView.SeparatorInset = new UIEdgeInsets (0, 0, 0, 0);
				AccountTableView.Source = tableSource;
				AccountTableView.ReloadData();
				AccountTableView.Hidden = false;

				var AccountWebViewFrame = new CGRect (View.Frame.Left, AccountTableView.Frame.Bottom, View.Frame.Width, View.Frame.Height * 1/4);
				var AccountWebView = new UIWebView (AccountWebViewFrame);

				AccountWebView.ShouldStartLoad = HandleShouldStartLoad;
				AccountWebView.LoadRequest(new NSUrlRequest (new NSUrl(UrlConsts.URL_DBMESSAGE)));
				AccountWebView.Hidden = false;

				View.AddSubview(ChoosePlanLabel);
				View.AddSubview(LogoutButton);
				View.AddSubview(divider);
				View.AddSubview (AccountTableView);
				View.AddSubview(AccountWebView);

				if (TouchIDUtil.SwitchIsClicked () && TouchIDUtil.TouchIDEnabled() && !TouchIDUtil.UserHasBeenAlerted()) {
					await DialogUtil.ShowAlert	("Touch ID Log In Enabled", "\nTouch ID login is now enabled on your device. You can turn this feature on or off by the switch button located on the home Sign In screen.", "OK");
					NSUserDefaults.StandardUserDefaults.SetBool (true, TouchIDUtil.TouchIDSettings.FirstAppLaunch.ToString ());
					NSUserDefaults.StandardUserDefaults.SetBool (true, TouchIDUtil.TouchIDSettings.UserAlerted.ToString());
				}
			}
			catch (NoAccountsAvailableException naae) 
			{
				Insights.Report (naae, ReportSeverity.Error);
				await DialogUtil.ShowAlert ("No Accounts Found", "We are unable to load your accounts at this time. If problem persists, please contact support.", "OK");
				appDelegate.Window.RootViewController = Storyboard.InstantiateViewController ("LoginScreen") as TSLoginViewController;
			}
			catch (CurrentAccountNotSetException naae) 
			{
				Insights.Report (naae, ReportSeverity.Error);
				await DialogUtil.ShowAlert ("Current Account Not Set", "Please Login Again", "OK");
				appDelegate.Window.RootViewController = Storyboard.InstantiateViewController ("LoginScreen") as TSLoginViewController;
			} 
			catch (TokenNotAvailableException tnae) 
			{
				Insights.Report (tnae, ReportSeverity.Error);
				await DialogUtil.ShowAlert ("Token Error", "Token not available for authentication. Please login again.", "OK");
				appDelegate.Window.RootViewController = Storyboard.InstantiateViewController ("LoginScreen") as TSLoginViewController;
			} 
			catch (Exception e) 
			{
				Insights.Report (e, ReportSeverity.Error);
				await DialogUtil.ShowAlert ("Error Occurred", "Unable to load accounts at this time.", "OK");
				appDelegate.Window.RootViewController = Storyboard.InstantiateViewController ("LoginScreen") as TSLoginViewController;
			}
		}
コード例 #10
0
		public async override void ViewDidLoad ()
		{
			base.ViewDidLoad ();

			try
			{
				var repo = new RSContentRepository();

				ActivityIndicator.StartAnimating();
				var dashboardInfo  = await repo.GetDashboard();
				var balanceInfo = await repo.GetBalance();
				ActivityIndicator.StopAnimating();

				BalanceHeaderLabel.Font = UIFont.SystemFontOfSize(12f);
				BalanceHeaderLabel.TextColor = UIColor.Clear.FromHexString(RSColors.RS_BLACK_2);
				BalanceHeaderLabel.Text = String.Format ("Balances as of {0}", Convert.ToDateTime (dashboardInfo.totalBalanceValDate).ToString ("MM/dd/yy")); 
				SourceTableLabel.Hidden = false;
				BalanceTableLabel.Hidden = false;
				BalanceSegmentedControl.TintColor = UIColor.Clear.FromHexString(RSColors.MM_BLUE);
				BalanceSegmentedControl.Hidden = false;

				var sourceCount = balanceInfo.sources.Count;

				if(sourceCount != 0) {

					bsSource = new BySourceTableViewSource(this);
					bsSource.Data = balanceInfo.sources;
					biSource = new ByInvestmentTableViewSource(this, balanceInfo);
				}
					
				FirstAsteriskLabel.Text = "*Net of outstanding loans.";
				SecondAsteriskLabel.Text = "**Includes outstanding loans.";
				TotalBalanceAmountLabel.Text = String.Format("{0:C}", balanceInfo.sources.Sum (x => x.totalBalance));

				TotalBalanceDisclaimerButton.SetBackgroundImage (UIImage.FromBundle ("QuestionMark"), UIControlState.Normal);

				TotalBalanceDisclaimerButton.TouchUpInside += (object sender, EventArgs e) => {
					PerformSegue ("modalTotalBalance", this);
				};

				var statusNavHeight = NavigationController.NavigationBar.Frame.Height + UIApplication.SharedApplication.StatusBarFrame.Height;

				var divider2 = new UIView(new CGRect(15f, SourceTableLabel.Frame.Bottom + 8f, View.Frame.Width -30f, 1f))
				{
					BackgroundColor = UIColor.Clear.FromHexString(RSColors.RS_LIGHT_GRAY),
					Alpha = 0.5f
				};

				var BalanceTableViewFrame = new CGRect(0, BalanceTableLabel.Frame.Bottom + 10f , View.Frame.Width, View.Frame.Height - 140f - TabBarController.TabBar.Frame.Height - statusNavHeight);
				var BalanceTableView = new UITableView(BalanceTableViewFrame);


				BalanceTableView.SeparatorInset = new UIEdgeInsets (0, 15, 0, 15);
				BalanceTableView.ContentInset = new UIEdgeInsets(0,0, 20, 0);
				BalanceTableView.Source = bsSource;
				BalanceTableView.Hidden = false;

				TotalBalanceTitleLabel.Hidden = false;

				var totalBalance = balanceInfo.sources.Sum (x => x.totalBalance);
				var vestedBalance = balanceInfo.sources.Sum(x => x.vestedBalance);

				if(totalBalance < vestedBalance)
				{
					showAsterisk = true;
					FirstAsteriskLabel.Hidden = false;
					SecondAsteriskLabel.Hidden = false;
				}

				TotalBalanceAmountLabel.Text = String.Format("{0:C}", balanceInfo.sources.Sum (x => x.totalBalance));
				TotalBalanceAmountLabel.TextColor = UIColor.Clear.FromHexString(RSColors.GREEN_4);
				TotalBalanceAmountLabel.Hidden = false;
				TotalBalanceDisclaimerButton.Hidden = false;

				FirstAsteriskLabel.TextColor = UIColor.Clear.FromHexString(RSColors.RS_LIGHT_GRAY);
				SecondAsteriskLabel.TextColor = UIColor.Clear.FromHexString(RSColors.RS_LIGHT_GRAY);

				var divider = new UIView(new CGRect(15f, TotalBalanceTitleLabel.Frame.Top - 1f, View.Frame.Width -30f, 1f))
				{
					BackgroundColor = UIColor.Clear.FromHexString(RSColors.RS_LIGHT_GRAY),
					Alpha = 0.5f
				};

				BalanceTableView.ReloadData();
				View.AddSubview (divider2);
				View.AddSubview (BalanceTableView);
				View.AddSubview (TotalBalanceTitleLabel);
				View.AddSubview (TotalBalanceAmountLabel);
				View.AddSubview (TotalBalanceDisclaimerButton);
				View.AddSubview (FirstAsteriskLabel);
				View.AddSubview (SecondAsteriskLabel);
				View.AddSubview (divider);

				BalanceSegmentedControl.ValueChanged += (sender, e) => 
				{
					var segment = (sender as UISegmentedControl).SelectedSegment;

					switch(segment)
					{
					case 0:
						BalanceTableView.Source = bsSource;
						SourceTableLabel.Text = "Source";
						if(showAsterisk)
						{
							FirstAsteriskLabel.Hidden = false;
							SecondAsteriskLabel.Hidden = false;
						}
						else {
							FirstAsteriskLabel.Hidden = true;
							SecondAsteriskLabel.Hidden = true;
						}
						break;

					case 1:
						BalanceTableView.Source = biSource;
						SourceTableLabel.Text = "Investment";
						FirstAsteriskLabel.Hidden = true;
						SecondAsteriskLabel.Hidden = true;
						break;
					}
						
					BalanceTableView.ContentInset = new UIEdgeInsets(0,0, 20, 0);

					BalanceTableView.ReloadData();
				};
			}
			catch (NoAccountsAvailableException naae) 
			{
				Insights.Report (naae, ReportSeverity.Error);
				await DialogUtil.ShowAlert ("No Accounts Available", "No Account Information could be loaded.", "OK");
				app.Window.RootViewController = Storyboard.InstantiateViewController ("LoginScreen") as TSLoginViewController;
			}
			catch (CurrentAccountNotSetException naae) 
			{
				Insights.Report (naae, ReportSeverity.Error);
				await DialogUtil.ShowAlert ("Current Account Not Set", "Please Login Again", "OK");
				app.Window.RootViewController = Storyboard.InstantiateViewController ("LoginScreen") as TSLoginViewController;
			} 
			catch (TokenNotAvailableException tnae) 
			{
				Insights.Report (tnae, ReportSeverity.Error);
				await DialogUtil.ShowAlert ("Token Error", "Token not available for authentication. Please login again.", "OK");
				app.Window.RootViewController = Storyboard.InstantiateViewController ("LoginScreen") as TSLoginViewController;
			} 
			catch (Exception e) 
			{
				if (!CrossConnectivity.Current.IsConnected) {
					await DialogUtil.ShowAlert ("Network Unavailable", "This application requires internet access to function. Please check your connection and try again.", "OK");
					InvalidateSession ();
				} 
				else {
					Insights.Report (e, ReportSeverity.Error);
					await DialogUtil.ShowAlert ("Server Error Occurred", "Unable to retrieve Dashboard at this time.", "OK");
					app.Window.RootViewController = Storyboard.InstantiateViewController ("LoginScreen") as TSLoginViewController;
				}
			}
		}