Example #1
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            RequestWindowFeature(WindowFeatures.ActionBar);

            SetContentView(Resource.Layout.PaymentTracker);

            //**************************************************//

            ActionBar.NavigationMode = ActionBarNavigationMode.Standard;

            var upArrow = Resources.GetDrawable(Resource.Drawable.abc_ic_ab_back_mtrl_am_alpha);

            upArrow.SetColorFilter(Color.ParseColor("#006571"), PorterDuff.Mode.SrcIn);
            ActionBar.SetHomeAsUpIndicator(upArrow);

            ActionBar.SetDisplayHomeAsUpEnabled(true);
            ActionBar.SetHomeButtonEnabled(true);

            LinearLayout lLayout = new LinearLayout(this);

            lLayout.SetGravity(GravityFlags.CenterVertical);
            LinearLayout.LayoutParams textViewParameters = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MatchParent, LinearLayout.LayoutParams.MatchParent);
            textViewParameters.RightMargin = (int)(30 * this.Resources.DisplayMetrics.Density);

            TextView myTitle = new TextView(this);

            myTitle.Text     = "Payment Tracker";
            myTitle.TextSize = 20;
            myTitle.Gravity  = GravityFlags.Center;
            lLayout.AddView(myTitle, textViewParameters);

            ActionBar.LayoutParams actionbarParams = new ActionBar.LayoutParams(ActionBar.LayoutParams.MatchParent, ActionBar.LayoutParams.MatchParent);
            ActionBar.SetCustomView(lLayout, actionbarParams);
            ActionBar.SetDisplayShowCustomEnabled(true);

            //**************************************************//


            bt_Schedule        = FindViewById <Button>(Resource.Id.bt_Schedule);
            bt_Schedule.Click += Bt_Schedule_Click;

            bt_History        = FindViewById <Button>(Resource.Id.bt_History);
            bt_History.Click += Bt_History_Click;

            bt_MakePayment        = FindViewById <Button>(Resource.Id.bt_MakePayment);
            bt_MakePayment.Click += Bt_MakePayment_Click;

            bt_Schedule.Selected = true;
            bt_History.Selected  = false;

            this.paymentTrackerListView = FindViewById <ListView>(Resource.Id.paymentTrackerListView);

            Keyboard.HideSoftKeyboard(this);

            LoadPaymentTracker();

            TrackingHelper.SendTracking("Open Payment Tracker");
        }
Example #2
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            RequestWindowFeature(WindowFeatures.ActionBar);

            SetContentView(Resource.Layout.InboxDetailMessage);

            //**************************************************//

            ActionBar.NavigationMode = ActionBarNavigationMode.Standard;

            var upArrow = Resources.GetDrawable(Resource.Drawable.abc_ic_ab_back_mtrl_am_alpha);

            upArrow.SetColorFilter(Color.ParseColor("#006571"), PorterDuff.Mode.SrcIn);
            ActionBar.SetHomeAsUpIndicator(upArrow);

            ActionBar.SetDisplayHomeAsUpEnabled(true);
            ActionBar.SetHomeButtonEnabled(true);

            LinearLayout lLayout = new LinearLayout(this);

            lLayout.SetGravity(GravityFlags.CenterVertical);
            LinearLayout.LayoutParams textViewParameters = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MatchParent, LinearLayout.LayoutParams.MatchParent);
            textViewParameters.RightMargin = (int)(30 * this.Resources.DisplayMetrics.Density);

            TextView myTitle = new TextView(this);

            myTitle.Text     = "Inbox Detail";
            myTitle.TextSize = 20;
            myTitle.Gravity  = GravityFlags.Center;
            lLayout.AddView(myTitle, textViewParameters);

            ActionBar.LayoutParams actionbarParams = new ActionBar.LayoutParams(ActionBar.LayoutParams.MatchParent, ActionBar.LayoutParams.MatchParent);
            ActionBar.SetCustomView(lLayout, actionbarParams);
            ActionBar.SetDisplayShowCustomEnabled(true);

            //**************************************************//


            bt_Delete        = FindViewById <Button>(Resource.Id.bt_Delete);
            bt_Delete.Click += bt_Delete_Click;


            tv_Date    = FindViewById <TextView>(Resource.Id.tv_Date);
            tv_Content = FindViewById <TextView>(Resource.Id.tv_Content);

            alert1 = new AlertDialog.Builder(this);
            alert1.SetTitle("Notice");
            alert1.SetCancelable(false);
            alert1.SetNegativeButton("Cancel", delegate { CancelMessage(); });
            alert1.SetPositiveButton("Yes", delegate { FinishMessage(); });
            alert1.SetMessage("Are you sure to delete this message");

            this.LoadInbox();

            TrackingHelper.SendTracking("Open Inbox Message");
        }
        private void GetBankInfo()
        {
            AndHUD.Shared.Show(this, "Please wait ...", -1, MaskType.Clear);

            string url  = Settings.InstanceURL;
            var    url2 = url + "/Api/GetPaymentDetail";

            var json2 = new
            {
                Item = new
                {
                    ReferenceNumber = Settings.RefNumber,
                    Action          = "G",
                }
            };

            try
            {
                var ObjectReturn2 = new PaymentInfo();

                string results2 = ConnectWebAPI.Request(url2, json2);

                if (string.IsNullOrEmpty(results2))
                {
                    AndHUD.Shared.Dismiss();
                    this.RunOnUiThread(() => alert = new Alert(this, "Error", Resources.GetString(Resource.String.NoServer)));
                    this.RunOnUiThread(() => alert.Show());
                }
                else
                {
                    ObjectReturn2 = Newtonsoft.Json.JsonConvert.DeserializeObject <PaymentInfo>(results2);

                    AndHUD.Shared.Dismiss();

                    if (ObjectReturn2.IsSuccess)
                    {
                        TrackingHelper.SendTracking("Update Bank Account");

                        if (ObjectReturn2.RecType.Equals("DD"))
                        {
                            this.et_AccountName.Text   = ObjectReturn2.AccountName;
                            this.et_AccountNumber.Text = ObjectReturn2.AccountNo;
                            this.et_BSB.Text           = ObjectReturn2.BsbNo;
                        }
                    }
                }
            }
            catch (Exception ee)
            {
                AndHUD.Shared.Dismiss();
            }
        }
Example #4
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            RequestWindowFeature(WindowFeatures.ActionBar);

            SetContentView(Resource.Layout.Inbox);

            //**************************************************//

            ActionBar.NavigationMode = ActionBarNavigationMode.Standard;

            var upArrow = Resources.GetDrawable(Resource.Drawable.abc_ic_ab_back_mtrl_am_alpha);

            upArrow.SetColorFilter(Color.ParseColor("#006571"), PorterDuff.Mode.SrcIn);
            ActionBar.SetHomeAsUpIndicator(upArrow);

            ActionBar.SetDisplayHomeAsUpEnabled(true);
            ActionBar.SetHomeButtonEnabled(true);

            LinearLayout lLayout = new LinearLayout(this);

            lLayout.SetGravity(GravityFlags.CenterVertical);
            LinearLayout.LayoutParams textViewParameters = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MatchParent, LinearLayout.LayoutParams.MatchParent);
            textViewParameters.RightMargin = (int)(30 * this.Resources.DisplayMetrics.Density);

            TextView myTitle = new TextView(this);

            myTitle.Text     = "Inbox";
            myTitle.TextSize = 20;
            myTitle.Gravity  = GravityFlags.Center;
            lLayout.AddView(myTitle, textViewParameters);

            ActionBar.LayoutParams actionbarParams = new ActionBar.LayoutParams(ActionBar.LayoutParams.MatchParent, ActionBar.LayoutParams.MatchParent);
            ActionBar.SetCustomView(lLayout, actionbarParams);
            ActionBar.SetDisplayShowCustomEnabled(true);

            //**************************************************//

            this.inboxListView = FindViewById <ListView>(Resource.Id.inboxListView);

            GetInboxLocal();

            GetInboxRemote();

            TrackingHelper.SendTracking("Open Inbox");
        }
Example #5
0
        private void DoDDPayment()
        {
            AndHUD.Shared.Show(this, "Please wait ...", -1, MaskType.Clear);
            string url  = Settings.InstanceURL;
            var    url2 = url + "/Api/MakeDebitPayment";

            var amount = Decimal.Parse(this.et_Amount.Text);

            if (Settings.MakePaymentIn3Part)
            {
                paymentType = 2;
            }
            else
            if (Settings.MakePaymentInstallment)
            {
                paymentType = 3;
            }
            else
            if (amount == Settings.TotalOutstanding)
            {
                Settings.MakePaymentInFull = true;
                paymentType = 1;
            }
            else
            if (amount < Settings.TotalOutstanding)
            {
                Settings.MakePaymentOtherAmount = true;
                paymentType = 4;
            }

            var DebtorPaymentInstallment = "";

            if (Settings.MakePaymentIn3Part || Settings.MakePaymentInstallment)
            {
                JSonHelper helper     = new JSonHelper();
                string     jsonResult = helper.ConvertObjectToJSon(this.instalmentList);

                DebtorPaymentInstallment = jsonResult;
            }

            var json2 = new
            {
                Item = new
                {
                    ReferenceNumber            = Settings.RefNumber,
                    Amount                     = this.et_Amount.Text,
                    DirectDebitAccountName     = this.et_AccountName.Text,
                    DirectDebitAccountNumber   = this.et_AccountNumber.Text,
                    DirectDebitBSB             = this.et_BSB.Text,
                    PaymentType                = paymentType,
                    PaymentMethod              = "2",
                    DebtorPaymentInstallment   = DebtorPaymentInstallment,
                    InstalmentPaymentFrequency = Settings.Frequency
                }
            };

            try
            {
                var ObjectReturn2 = new PaymentReturnModel();

                string results = ConnectWebAPI.Request(url2, json2);

                if (string.IsNullOrEmpty(results))
                {
                    AndHUD.Shared.Dismiss();
                    this.RunOnUiThread(() => this.bt_Continue.Enabled = true);
                    this.RunOnUiThread(() => alert = new Alert(this, "Error", Resources.GetString(Resource.String.NoServer)));
                    this.RunOnUiThread(() => alert.Show());
                }
                else
                {
                    ObjectReturn2 = Newtonsoft.Json.JsonConvert.DeserializeObject <PaymentReturnModel>(results);

                    if (ObjectReturn2.IsSuccess)
                    {
                        TrackingHelper.SendTracking("Make DD Payment");

                        Intent Intent = new Intent(this, typeof(UpdatePersonalInformationActivity));
                        Intent.PutExtra("ScreenComeFrom", "MakeDDPayment");

                        //////////////////////////////////////////////////////////////////////////////////////////////////
                        Intent.PutExtra("tv_TransactionDescription", ObjectReturn2.TransactionDescription);
                        Intent.PutExtra("tv_ReceiptNumber", ObjectReturn2.ReceiptNumber);
                        Intent.PutExtra("tv_Amount", ObjectReturn2.Amount);
                        Intent.PutExtra("tv_Time", ObjectReturn2.Time);
                        Intent.PutExtra("tv_Date", ObjectReturn2.Date);
                        Intent.PutExtra("tv_Name", ObjectReturn2.Name);
                        Intent.PutExtra("PaymentMethod", 2);
                        Intent.PutExtra("PaymentType", this.paymentType);
                        Intent.PutExtra("PaymentId", ObjectReturn2.PaymentId);
                        Intent.PutExtra("ClientName", ObjectReturn2.ClientName);
                        Intent.PutExtra("FirstDebtorPaymentInstallmentId", ObjectReturn2.FirstDebtorPaymentInstallmentId);

                        StartActivity(Intent);

                        AndHUD.Shared.Dismiss();

                        this.Finish();
                    }
                    else
                    {
                        AndHUD.Shared.Dismiss();
                        this.RunOnUiThread(() => this.bt_Continue.Enabled = true);
                        this.RunOnUiThread(() => alert = new Alert(this, "Error", ObjectReturn2.Errors[0].ErrorMessage));
                        this.RunOnUiThread(() => alert.Show());
                    }
                }
            }
            catch (Exception ee)
            {
                this.RunOnUiThread(() => this.bt_Continue.Enabled = true);

                AndHUD.Shared.Dismiss();
            }
        }
        public void DoSetup()
        {
            var firstAmount  = Decimal.Parse(this.et_FirstAmount.Text);
            var secondAmount = Decimal.Parse(this.et_SecondAmount.Text);

            instalmentSummaryList = new List <InstalmentSummaryModel>();

            TrackingHelper.SendTracking("Setup 3 part");

            if (Settings.MaxNoPay == 2)
            {
                if (Settings.TotalOutstanding != (firstAmount + secondAmount))
                {
                    this.RunOnUiThread(() =>
                    {
                        alert = new Alert(this, "Error", Resources.GetString(Resource.String.InstalmentAmountInvalid));
                        alert.Show();
                        this.bt_Continue.Enabled = true;
                    });
                }
                else
                {
                    SetPayment.Set("3part");
                    Settings.Frequency = 0;

                    if (DateTime.Parse(this.et_FirstDate.Text) > DateTime.Today)
                    {
                        Settings.IsFuturePayment = true;
                    }
                    else
                    {
                        Settings.IsFuturePayment = false;
                    }

                    var instalmentModel1 = new InstalmentSummaryModel(this.et_FirstDate.Text, double.Parse(this.et_FirstAmount.Text));
                    var instalmentModel2 = new InstalmentSummaryModel(this.et_SecondDate.Text, double.Parse(this.et_SecondAmount.Text));
                    instalmentSummaryList.Add(instalmentModel1);
                    instalmentSummaryList.Add(instalmentModel2);

                    Intent Intent = new Intent(this, typeof(InstalmentSummaryActivity));

                    Intent.PutParcelableArrayListExtra("InstalmentSummary", instalmentSummaryList.ToArray());

                    Intent.SetFlags(ActivityFlags.ClearTask | ActivityFlags.NewTask);

                    StartActivity(Intent);
                }
            }
            else
            {
                var thirdAmount = Decimal.Parse(this.et_ThirdAmount.Text);

                if (Settings.TotalOutstanding != (firstAmount + secondAmount + thirdAmount))
                {
                    this.RunOnUiThread(() =>
                    {
                        alert = new Alert(this, "Error", Resources.GetString(Resource.String.InstalmentAmountInvalid));
                        alert.Show();
                        this.bt_Continue.Enabled = true;
                    });
                }
                else
                {
                    SetPayment.Set("3part");
                    Settings.Frequency = 0;

                    if (DateTime.Parse(this.et_FirstDate.Text) > DateTime.Today)
                    {
                        Settings.IsFuturePayment = true;
                    }
                    else
                    {
                        Settings.IsFuturePayment = false;
                    }

                    var instalmentModel1 = new InstalmentSummaryModel(this.et_FirstDate.Text, double.Parse(this.et_FirstAmount.Text));
                    var instalmentModel2 = new InstalmentSummaryModel(this.et_SecondDate.Text, double.Parse(this.et_SecondDate.Text));
                    var instalmentModel3 = new InstalmentSummaryModel(this.et_ThirdDate.Text, double.Parse(this.et_ThirdAmount.Text));

                    instalmentSummaryList.Add(instalmentModel1);
                    instalmentSummaryList.Add(instalmentModel2);
                    instalmentSummaryList.Add(instalmentModel3);

                    Intent Intent = new Intent(this, typeof(InstalmentSummaryActivity));

                    Intent.PutParcelableArrayListExtra("InstalmentSummary", instalmentSummaryList.ToArray());

                    Intent.SetFlags(ActivityFlags.ClearTask | ActivityFlags.NewTask);

                    StartActivity(Intent);
                }
            }
        }
Example #7
0
        private void InputSearchOnTextChanged(object sender, TextChangedEventArgs args)
        {
            numberOfPin = et_Pin.Text.Length;


            if (numberOfPin == 0)
            {
                tv_Pin1.Text = "";
                tv_Pin2.Text = "";
                tv_Pin3.Text = "";
                tv_Pin4.Text = "";
            }
            else if (numberOfPin == 1)
            {
                tv_Pin1.Text = "*";
                tv_Pin2.Text = "";
                tv_Pin3.Text = "";
                tv_Pin4.Text = "";
            }
            else if (numberOfPin == 2)
            {
                tv_Pin1.Text = "*";
                tv_Pin2.Text = "*";
                tv_Pin3.Text = "";
                tv_Pin4.Text = "";
            }
            else if (numberOfPin == 3)
            {
                tv_Pin1.Text = "*";
                tv_Pin2.Text = "*";
                tv_Pin3.Text = "*";
                tv_Pin4.Text = "";
            }
            else if (numberOfPin == 4)
            {
                tv_Pin1.Text = "*";
                tv_Pin2.Text = "*";
                tv_Pin3.Text = "*";
                tv_Pin4.Text = "*";

                //Compare Pin
                if (Settings.PinNumber.Equals(this.et_Pin.Text))
                {
                    TrackingHelper.SendTracking("Login");

                    Keyboard.HideKeyboard(this, et_Pin);

                    StartActivity(typeof(LoginWaitingActivity));

                    this.Finish();
                }
                else
                {
                    tv_Pin1.Text = "";
                    tv_Pin2.Text = "";
                    tv_Pin3.Text = "";
                    tv_Pin4.Text = "";
                    et_Pin.Text  = "";

                    var alert = new Alert(this, "Error", Resources.GetString(Resource.String.NotMatchPinNumber));
                    alert.Show();
                }
            }
        }
        private void DoUpdate()
        {
            AndHUD.Shared.Show(this, "Please wait ...", -1, MaskType.Clear);

            string url  = Settings.InstanceURL;
            var    url2 = url + "/Api/GetPersonalInformationDetail";

            var json2 = new
            {
                Item = new
                {
                    ReferenceNumber = Settings.RefNumber,
                    DebtorCode      = Settings.DebtorCodeSelected,
                    Action          = "U",

                    StreetAddress1 = this.Compare(this.et_StreetAddress1.Text.Trim(), ObjectReturn2.Marked_StreetAddress1, ObjectReturn2.Origin_StreetAddress1),
                    StreetAddress2 = this.Compare(this.et_StreetAddress2.Text.Trim(), ObjectReturn2.Marked_StreetAddress2, ObjectReturn2.Origin_StreetAddress2),
                    StreetAddress3 = this.Compare(this.et_StreetAddress3.Text.Trim(), ObjectReturn2.Marked_StreetAddress3, ObjectReturn2.Origin_StreetAddress3),
                    StreetSuburb   = this.Compare(this.et_StreetSuburb.Text.Trim(), ObjectReturn2.Marked_StreetSuburb, ObjectReturn2.Origin_StreetSuburb),
                    StreetState    = this.Compare(this.et_StreetState.Text.Trim(), ObjectReturn2.Marked_StreetState, ObjectReturn2.Origin_StreetState),
                    StreetPostCode = this.Compare(this.et_StreetPostCode.Text.Trim(), ObjectReturn2.Marked_StreetPostCode, ObjectReturn2.Origin_StreetPostCode),

                    MailAddress1 = this.Compare(this.et_MailAddress1.Text.Trim(), ObjectReturn2.Marked_MailAddress1, ObjectReturn2.Origin_MailAddress1),
                    MailAddress2 = this.Compare(this.et_MailAddress2.Text.Trim(), ObjectReturn2.Marked_MailAddress2, ObjectReturn2.Origin_MailAddress2),
                    MailAddress3 = this.Compare(this.et_MailAddress3.Text.Trim(), ObjectReturn2.Marked_MailAddress3, ObjectReturn2.Origin_MailAddress3),
                    MailSuburb   = this.Compare(this.et_MailSuburb.Text.Trim(), ObjectReturn2.Marked_MailSuburb, ObjectReturn2.Origin_MailSuburb),
                    MailState    = this.Compare(this.et_MailState.Text.Trim(), ObjectReturn2.Marked_MailState, ObjectReturn2.Origin_MailState),
                    MailPostCode = this.Compare(this.et_MailPostCode.Text.Trim(), ObjectReturn2.Marked_MailPostCode, ObjectReturn2.Origin_MailPostCode),

                    HomeNumber    = this.Compare(this.et_HomePhone.Text.Trim(), ObjectReturn2.Marked_HomeNumber, ObjectReturn2.Origin_HomeNumber),
                    WorkNumber    = this.Compare(this.et_WorkPhone.Text.Trim(), ObjectReturn2.Marked_WorkNumber, ObjectReturn2.Origin_WorkNumber),
                    MobileNumbers = this.Compare(this.et_MobilePhone.Text.Trim(), ObjectReturn2.Marked_MobileNumbers, ObjectReturn2.Origin_MobileNumbers),
                    EmailAddress  = this.Compare(this.et_Email.Text.Trim(), ObjectReturn2.Marked_EmailAddress, ObjectReturn2.Origin_EmailAddress),

                    Preferred = this.selectedIndex
                }
            };

            try
            {
                var ObjectReturn2 = new PaymentInfo();

                string results2 = ConnectWebAPI.Request(url2, json2);

                if (string.IsNullOrEmpty(results2))
                {
                    AndHUD.Shared.Dismiss();
                    this.RunOnUiThread(() => this.bt_Continue.Enabled = true);
                    this.RunOnUiThread(() => alert = new Alert(this, "Error", Resources.GetString(Resource.String.NoServer)));
                    this.RunOnUiThread(() => alert.Show());
                }
                else
                {
                    ObjectReturn2 = Newtonsoft.Json.JsonConvert.DeserializeObject <PaymentInfo>(results2);


                    if (ObjectReturn2.IsSuccess)
                    {
                        TrackingHelper.SendTracking("Update Personal Info");

                        if (this.ScreenComeFrom.Equals("HomeMenu"))
                        {
                            Intent Intent = new Intent(this, typeof(FinishActivity));
                            Intent.PutExtra("Message", "Your personal information has been updated successfully");
                            StartActivity(Intent);
                        }
                        else
                        {
                            Intent Intent = new Intent(this, typeof(SummaryActivity));

                            Intent.PutExtra("tv_TransactionDescription", var_TransactionDescription);
                            Intent.PutExtra("tv_ReceiptNumber", var_ReceiptNumber);
                            Intent.PutExtra("tv_Amount", var_Amount);
                            Intent.PutExtra("tv_Time", var_Time);
                            Intent.PutExtra("tv_Date", var_Date);
                            Intent.PutExtra("tv_Name", var_Name);
                            Intent.PutExtra("PaymentType", var_PaymentType);
                            Intent.PutExtra("PaymentMethod", var_PaymentMethod);
                            Intent.PutExtra("PaymentId", var_PaymentId);
                            Intent.PutExtra("ClientName", var_ClientName);
                            Intent.PutExtra("FirstDebtorPaymentInstallmentId", var_FirstDebtorPaymentInstallmentId);
                            StartActivity(Intent);
                        }

                        AndHUD.Shared.Dismiss();

                        this.Finish();
                    }
                    else
                    {
                        AndHUD.Shared.Dismiss();
                        this.RunOnUiThread(() => this.bt_Continue.Enabled = true);
                        alert = new Alert(this, "Error", ObjectReturn2.Error);
                        alert.Show();
                    }
                }
            }
            catch (Exception ee)
            {
                this.RunOnUiThread(() => this.bt_Continue.Enabled = true);
                AndHUD.Shared.Dismiss();
            }
        }
        private void DoSendFeedback()
        {
            AndHUD.Shared.Show(this, "Please wait ...", -1, MaskType.Clear);
            string url  = Settings.InstanceURL;
            var    url2 = url + "/Api/SendFeedback";

            var json2 = new
            {
                Item = new
                {
                    ReferenceNumber = Settings.RefNumber,
                    Subject         = this.et_Subject.Text,
                    Content         = this.et_Content.Text
                }
            };

            try
            {
                var ObjectReturn2 = new JsonReturnModel();

                string results = ConnectWebAPI.Request(url2, json2);


                if (string.IsNullOrEmpty(results))
                {
                    AndHUD.Shared.Dismiss();
                    this.RunOnUiThread(() => this.bt_Continue.Enabled = true);
                    this.RunOnUiThread(() => alert = new Alert(this, "Error", Resources.GetString(Resource.String.NoServer)));
                    this.RunOnUiThread(() => alert.Show());
                }
                else
                {
                    ObjectReturn2 = Newtonsoft.Json.JsonConvert.DeserializeObject <JsonReturnModel>(results);


                    if (ObjectReturn2.IsSuccess)
                    {
                        TrackingHelper.SendTracking("Sent Feedback");

                        Intent Intent = new Intent(this, typeof(FinishActivity));

                        Intent.PutExtra("Message", "Your feedback has been sent successfully");

                        StartActivity(Intent);

                        AndHUD.Shared.Dismiss();

                        this.Finish();
                    }
                    else
                    {
                        AndHUD.Shared.Dismiss();

                        this.RunOnUiThread(() => this.bt_Continue.Enabled = true);
                        this.RunOnUiThread(() => alert = new Alert(this, "Error", ObjectReturn2.Errors[0].ErrorMessage));
                        this.RunOnUiThread(() => alert.Show());
                    }
                }
            }
            catch (Exception ee)
            {
                this.RunOnUiThread(() => this.bt_Continue.Enabled = true);
                AndHUD.Shared.Dismiss();
            }
        }
        private void Bt_Continue_Click(object sender, EventArgs e)
        {
            bool IsValidate1 = true;
            bool IsValidate2 = true;
            bool IsValidate3 = true;

            err_FullName.Text    = "";
            err_DateOfBirth.Text = "";
            err_PostCode.Text    = "";

            var Fullname = et_FullName.Text;

            if (string.IsNullOrEmpty(Fullname))
            {
                IsValidate1            = false;
                this.err_FullName.Text = "Please enter Full Name";
            }
            if (!this.selectedDebtor.FullName.Equals(Fullname.ToUpper()))
            {
                IsValidate1            = false;
                this.err_FullName.Text = "Full Name is not correct";
            }


            var DateOfBirth = et_DateOfBirth.Text;

            if (string.IsNullOrEmpty(DateOfBirth))
            {
                IsValidate2 = false;
                this.err_DateOfBirth.Text = "Please enter Date Of Birth";
            }
            else
            {
                if (!string.IsNullOrEmpty(this.selectedDebtor.DateOfBirths))
                {
                    DateTime dob;
                    bool     isvalid = DateTime.TryParseExact(this.selectedDebtor.DateOfBirths, "yyyy-MM-dd", CultureInfo.InvariantCulture, DateTimeStyles.None, out dob);
                    if (isvalid)
                    {
                        if (!dob.Equals(DateTime.ParseExact(DateOfBirth, "dd/MM/yyyy", CultureInfo.InvariantCulture)))
                        {
                            IsValidate2 = false;
                            this.err_DateOfBirth.Text = "Date Of Birth is not correct";
                        }
                    }
                }
            }

            var PostCode = et_PostCode.Text;

            if (string.IsNullOrEmpty(PostCode))
            {
                IsValidate3            = false;
                this.err_PostCode.Text = "Please enter Post Code";
            }
            if (!this.selectedDebtor.PostCodes.Equals(PostCode))
            {
                IsValidate3            = false;
                this.err_FullName.Text = "Post Code is not correct";
            }

            if (IsValidate1 && IsValidate2 && IsValidate3)
            {
                Settings.IsCoBorrowerSelected = true;
                Settings.DebtorCodeSelected   = this.selectedDebtor.DebtorCode;
                if (this.selectedDebtor.DebtorCode.Equals(Settings.ArrangementDebtor))
                {
                    Settings.IsArrangementUnderThisDebtor = true;
                }
                else
                {
                    Settings.IsArrangementUnderThisDebtor = false;
                }

                TrackingHelper.SendTracking("Verify Detail");

                Intent intent = new Intent(this, typeof(SetupPinActivity));
                StartActivity(intent);
            }
        }
        private void SendDefer()
        {
            AndHUD.Shared.Show(this, "Please wait ...", -1, MaskType.Clear);

            string url  = Settings.InstanceURL;
            var    url2 = url + "/Api/DeferPayment";

            var selectedItem = this.DeferList.ElementAt(this.selectedIndex);

            var json2 = new
            {
                Item = new
                {
                    ReferenceNumber = Settings.RefNumber,
                    InstalDate      = selectedItem.HistInstalDate,
                    Amount          = selectedItem.HistInstalAmount
                }
            };

            try
            {
                var ObjectReturn2 = new JsonReturnModel();

                string results = ConnectWebAPI.Request(url2, json2);

                AndHUD.Shared.Dismiss();

                if (string.IsNullOrEmpty(results))
                {
                    this.RunOnUiThread(() => this.bt_Defer.Enabled = true);
                    this.RunOnUiThread(() => alert = new Alert(this, "Error", Resources.GetString(Resource.String.NoServer)));
                    this.RunOnUiThread(() => alert.Show());
                }
                else
                {
                    ObjectReturn2 = Newtonsoft.Json.JsonConvert.DeserializeObject <JsonReturnModel>(results);

                    if (ObjectReturn2.IsSuccess)
                    {
                        TrackingHelper.SendTracking("Defer");

                        Intent Intent = new Intent(this, typeof(FinishActivity));

                        Intent.PutExtra("Message", "You have successfully deferred this payment.");

                        StartActivity(Intent);

                        this.Finish();
                    }
                    else
                    {
                        this.RunOnUiThread(() => this.bt_Defer.Enabled = true);
                        this.RunOnUiThread(() => alert = new Alert(this, "Error", ObjectReturn2.Errors[0].ErrorMessage));
                        this.RunOnUiThread(() => alert.Show());
                    }
                }
            }
            catch (Exception ee)
            {
                this.RunOnUiThread(() => this.bt_Defer.Enabled = true);
                AndHUD.Shared.Dismiss();
            }
        }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            RequestWindowFeature(WindowFeatures.ActionBar);

            SetContentView(Resource.Layout.InstalmentInfo);


            //**************************************************//

            ActionBar.NavigationMode = ActionBarNavigationMode.Standard;

            var upArrow = Resources.GetDrawable(Resource.Drawable.abc_ic_ab_back_mtrl_am_alpha);

            upArrow.SetColorFilter(Color.ParseColor("#006571"), PorterDuff.Mode.SrcIn);
            ActionBar.SetHomeAsUpIndicator(upArrow);

            ActionBar.SetDisplayHomeAsUpEnabled(true);
            ActionBar.SetHomeButtonEnabled(true);

            LinearLayout lLayout = new LinearLayout(this);

            lLayout.SetGravity(GravityFlags.CenterVertical);
            LinearLayout.LayoutParams textViewParameters = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MatchParent, LinearLayout.LayoutParams.MatchParent);
            textViewParameters.RightMargin = (int)(30 * this.Resources.DisplayMetrics.Density);

            TextView myTitle = new TextView(this);

            myTitle.Text     = "Instalment Info";
            myTitle.TextSize = 20;
            myTitle.Gravity  = GravityFlags.Center;
            lLayout.AddView(myTitle, textViewParameters);

            ActionBar.LayoutParams actionbarParams = new ActionBar.LayoutParams(ActionBar.LayoutParams.MatchParent, ActionBar.LayoutParams.MatchParent);
            ActionBar.SetCustomView(lLayout, actionbarParams);
            ActionBar.SetDisplayShowCustomEnabled(true);

            //**************************************************//

            // Create your application here

            tv_Amount      = FindViewById <TextView>(Resource.Id.tv_Amount);
            tv_Frequency   = FindViewById <TextView>(Resource.Id.tv_Frequency);
            tv_Paid        = FindViewById <TextView>(Resource.Id.tv_Paid);
            tv_Remaining   = FindViewById <TextView>(Resource.Id.tv_Remaining);
            tv_Status      = FindViewById <TextView>(Resource.Id.tv_Status);
            tv_Overdue     = FindViewById <TextView>(Resource.Id.tv_Overdue);
            tv_NextPayment = FindViewById <TextView>(Resource.Id.tv_NextPayment);

            ln_Chart       = FindViewById <LinearLayout>(Resource.Id.ln_Chart);
            ln_right       = FindViewById <LinearLayout>(Resource.Id.ln_right);
            ln_top         = FindViewById <LinearLayout>(Resource.Id.ln_top);
            ln_left        = FindViewById <LinearLayout>(Resource.Id.ln_left);
            ln_root        = FindViewById <LinearLayout>(Resource.Id.ln_root);
            ln_BottomChart = FindViewById <LinearLayout>(Resource.Id.ln_BottomChart);

            LoadData();

            TrackingHelper.SendTracking("Open Instalment Info");
        }
Example #13
0
        private void DoUpdate()
        {
            AndHUD.Shared.Show(this, "Please wait ...", -1, MaskType.Clear);

            string url = Settings.InstanceURL;

            var url2 = url + "/Api/GetPaymentDetail";

            var expiry = this.et_Expiry.Text.Replace("/", "");


            var json2 = new
            {
                Item = new
                {
                    ReferenceNumber = Settings.RefNumber,
                    Action          = "U",
                    RecType         = "CC",
                    CCNo            = this.et_CardNumber.Text,
                    ExpiryDate      = expiry,
                    BsbNo           = "",
                    AccountNo       = "",
                    AccountName     = ""
                }
            };

            try
            {
                var ObjectReturn2 = new PaymentInfo();

                string results2 = ConnectWebAPI.Request(url2, json2);

                if (string.IsNullOrEmpty(results2))
                {
                    AndHUD.Shared.Dismiss();
                    this.RunOnUiThread(() => alert = new Alert(this, "Error", Resources.GetString(Resource.String.NoServer)));
                    this.RunOnUiThread(() => alert.Show());
                }
                else
                {
                    ObjectReturn2 = Newtonsoft.Json.JsonConvert.DeserializeObject <PaymentInfo>(results2);


                    if (ObjectReturn2.IsSuccess)
                    {
                        TrackingHelper.SendTracking("Update Credit Card");

                        Intent Intent = new Intent(this, typeof(FinishActivity));

                        Intent.PutExtra("Message", "Your credit card has been updated successfully");

                        StartActivity(Intent);

                        AndHUD.Shared.Dismiss();

                        this.Finish();
                    }
                    else
                    {
                        AndHUD.Shared.Dismiss();
                        this.RunOnUiThread(() => alert = new Alert(this, "Error", ObjectReturn2.Error));
                        this.RunOnUiThread(() => alert.Show());
                    }
                }
            }
            catch (Exception ee)
            {
                AndHUD.Shared.Dismiss();
            }
        }
        private void InputSearchOnTextChanged(object sender, TextChangedEventArgs args)
        {
            numberOfPin = et_Pin.Text.Length;

            if (this.InputFirstPin && !this.FinishFirstPin)
            {
                if (numberOfPin == 0)
                {
                    tv_Pin1.Text = "";
                    tv_Pin2.Text = "";
                    tv_Pin3.Text = "";
                    tv_Pin4.Text = "";
                }
                else if (numberOfPin == 1)
                {
                    tv_Pin1.Text = "*";
                    tv_Pin2.Text = "";
                    tv_Pin3.Text = "";
                    tv_Pin4.Text = "";
                }
                else if (numberOfPin == 2)
                {
                    tv_Pin1.Text = "*";
                    tv_Pin2.Text = "*";
                    tv_Pin3.Text = "";
                    tv_Pin4.Text = "";
                }
                else if (numberOfPin == 3)
                {
                    tv_Pin1.Text = "*";
                    tv_Pin2.Text = "*";
                    tv_Pin3.Text = "*";
                    tv_Pin4.Text = "";
                }
                else if (numberOfPin == 4)
                {
                    tv_Pin1.Text = "*";
                    tv_Pin2.Text = "*";
                    tv_Pin3.Text = "*";
                    tv_Pin4.Text = "*";

                    this.FirstPin    = this.et_Pin.Text;
                    this.et_Pin.Text = "";

                    tv_Pin1.Text = "";
                    tv_Pin2.Text = "";
                    tv_Pin3.Text = "";
                    tv_Pin4.Text = "";

                    this.FinishFirstPin = true;
                    this.InputFirstPin  = false;
                    this.InputSecondPin = true;

                    textView1.Text = Resources.GetString(Resource.String.ReEnterPinNumber);
                }
            }


            if (this.InputSecondPin && !this.FinishSecondPin)
            {
                if (numberOfPin == 0)
                {
                    tv_Pin1.Text = "";
                    tv_Pin2.Text = "";
                    tv_Pin3.Text = "";
                    tv_Pin4.Text = "";
                }
                else if (numberOfPin == 1)
                {
                    tv_Pin1.Text = "*";
                    tv_Pin2.Text = "";
                    tv_Pin3.Text = "";
                    tv_Pin4.Text = "";
                }
                else if (numberOfPin == 2)
                {
                    tv_Pin1.Text = "*";
                    tv_Pin2.Text = "*";
                    tv_Pin3.Text = "";
                    tv_Pin4.Text = "";
                }
                else if (numberOfPin == 3)
                {
                    tv_Pin1.Text = "*";
                    tv_Pin2.Text = "*";
                    tv_Pin3.Text = "*";
                    tv_Pin4.Text = "";
                }
                else if (numberOfPin == 4)
                {
                    tv_Pin1.Text = "*";
                    tv_Pin2.Text = "*";
                    tv_Pin3.Text = "*";
                    tv_Pin4.Text = "*";

                    this.FinishSecondPin = true;
                    this.SecondPin       = this.et_Pin.Text;
                    this.et_Pin.Text     = "";

                    if (this.FinishFirstPin && this.FinishSecondPin)
                    {
                        if (this.FirstPin.Equals(this.SecondPin))
                        {
                            TrackingHelper.SendTracking("Setup Pin");

                            this.HideKeyboard(et_Pin);
                            Settings.PinNumber         = this.FirstPin;
                            Settings.IsAlreadySetupPin = true;

                            //StartActivity(typeof(LoginWaitingActivity));
                            StartActivity(typeof(PrivacyPolicyActivity));
                            this.Finish();
                        }
                        else
                        {
                            tv_Pin1.Text = "";
                            tv_Pin2.Text = "";
                            tv_Pin3.Text = "";
                            tv_Pin4.Text = "";
                            var alert = new Alert(this, "Error", Resources.GetString(Resource.String.NotMatchPinNumber));
                            alert.Show();
                            this.FirstPin        = "";
                            this.SecondPin       = "";
                            this.InputFirstPin   = true;
                            this.InputSecondPin  = false;
                            this.FinishFirstPin  = false;
                            this.FinishSecondPin = false;
                            textView1.Text       = Resources.GetString(Resource.String.EnterPinNumber);
                            this.ShowKeyboard(et_Pin);
                        }
                    }
                }
            }


            //Console.WriteLine(et_Pin.Text);
        }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            RequestWindowFeature(WindowFeatures.ActionBar);

            SetContentView(Resource.Layout.ScheduleCallback);

            //**************************************************//

            ActionBar.NavigationMode = ActionBarNavigationMode.Standard;

            var upArrow = Resources.GetDrawable(Resource.Drawable.abc_ic_ab_back_mtrl_am_alpha);

            upArrow.SetColorFilter(Color.ParseColor("#006571"), PorterDuff.Mode.SrcIn);
            ActionBar.SetHomeAsUpIndicator(upArrow);

            ActionBar.SetDisplayHomeAsUpEnabled(true);
            ActionBar.SetHomeButtonEnabled(true);

            LinearLayout lLayout = new LinearLayout(this);

            lLayout.SetGravity(GravityFlags.CenterVertical);
            LinearLayout.LayoutParams textViewParameters = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MatchParent, LinearLayout.LayoutParams.MatchParent);
            textViewParameters.RightMargin = (int)(30 * this.Resources.DisplayMetrics.Density);

            TextView myTitle = new TextView(this);

            myTitle.Text     = "Schedule Callback";
            myTitle.TextSize = 20;
            myTitle.Gravity  = GravityFlags.Center;
            lLayout.AddView(myTitle, textViewParameters);

            ActionBar.LayoutParams actionbarParams = new ActionBar.LayoutParams(ActionBar.LayoutParams.MatchParent, ActionBar.LayoutParams.MatchParent);
            ActionBar.SetCustomView(lLayout, actionbarParams);
            ActionBar.SetDisplayShowCustomEnabled(true);

            //**************************************************//

            Date = DateTime.Now;

            et_Name          = FindViewById <EditText>(Resource.Id.et_Name);
            et_Phone         = FindViewById <EditText>(Resource.Id.et_Phone);
            et_Date          = FindViewById <EditText>(Resource.Id.et_Date);
            spinner_Callback = FindViewById <Spinner>(Resource.Id.spinner_Callback);

            et_Notes = FindViewById <EditText>(Resource.Id.et_Notes);


            et_Date.Click    += delegate { ShowDialog(Start_DATE_DIALOG_ID); };
            this.et_Date.Text = DateTime.Today.Date.ToShortDateString();
            LoadCallbackList(DateTime.Today);

            err_Name     = FindViewById <TextView>(Resource.Id.err_Name);
            err_Phone    = FindViewById <TextView>(Resource.Id.err_Phone);
            err_Date     = FindViewById <TextView>(Resource.Id.err_Date);
            err_TimeFrom = FindViewById <TextView>(Resource.Id.err_TimeFrom);

            bt_Continue        = FindViewById <Button>(Resource.Id.bt_Continue);
            bt_Continue.Click += Bt_Continue_Click;

            layout_button = FindViewById <LinearLayout>(Resource.Id.linearLayout_button);


            Keyboard.ShowKeyboard(this, this.et_Name);

            TrackingHelper.SendTracking("Open Schedule Callback");

            this.Window.SetSoftInputMode(SoftInput.AdjustResize);

            var metrics    = Resources.DisplayMetrics;
            var heightInDp = ConvertPixelsToDp(metrics.HeightPixels);

            // Gets the layout params that will allow you to resize the layout
            ViewGroup.LayoutParams temp = layout_button.LayoutParameters;
            // Changes the height and width to the specified *pixels*
            temp.Height = ConvertDpToPixel(heightInDp - 400);
            layout_button.LayoutParameters = temp;
        }