Ejemplo n.º 1
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            CashPredictorInstance = Code.clsCashPredictor.Instance(this);

            mClassName = this.GetType().Name;

            // Get reference to paramaters
            Code.clsParameters parameters = Code.clsParameters.Instance();

            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.Main);

            mBankDebitListView = FindViewById <ListView>(Resource.Id.fldBankDebitsListView);

            Code.clsBankDebitsListViewAdapter adapter = new Code.clsBankDebitsListViewAdapter(this, Code.clsBankDebitDB.GetBankDebits());

            mBankDebitListView.Adapter    = adapter;
            mBankDebitListView.ItemClick += BankDebitListView_ItemClick;
            Console.WriteLine("[{0}] Registered the item click event for the bank debit list view..", mClassName);

            mBtnUpdateOutgoings        = FindViewById <Button>(Resource.Id.btnUpdateOutgoings);
            mBtnUpdateOutgoings.Click += (object sender, EventArgs e) =>
            {
                var ListOutgoingsActivity = new Intent(this, typeof(Code.clsListOutgoings_Activity));
                StartActivity(ListOutgoingsActivity);
            };

            EditText mfldCurrentBalance = FindViewById <EditText>(Resource.Id.fldCurrentBalance);

            mfldCurrentBalance.AfterTextChanged += MfldCurrentBalance_AfterTextChanged;

            ProgressBar mProgressBarDaysUntilPayday = FindViewById <ProgressBar>(Resource.Id.progressBar1);
            float       mDaysUntilNextPayDay        = Code.HelperMethods.DaysUntilNextPayDay();
            float       mDaysInThisPayPeriod        = Code.HelperMethods.DaysInThisPayPeriod();

            mProgressBarDaysUntilPayday.Progress = Convert.ToInt32(((mDaysInThisPayPeriod - mDaysUntilNextPayDay) / mDaysInThisPayPeriod) * 100);

            TextView txtDaysUntilNextPayDay = FindViewById <TextView>(Resource.Id.txtDaysTillPayDay);
            // txtDaysUntilNextPayDay.Text = mDaysUntilNextPayDay.ToString() + " days until pay day";

            CheckBox mfldIncudeInCalculation = FindViewById <CheckBox>(Resource.Id.txtIncudeInCalculation);
            // mfldIncudeInCalculation.CheckedChange += mfldIncudeInCalculation_CheckedChange;

            // Set the Payday
            TextView txtPayDate = FindViewById <TextView>(Resource.Id.txtPayDate);
            string   myText     = "";

            myText = "Pay Day is the: " + parameters.PayDay.ToString() + Code.HelperMethods.DaySuffix(parameters.PayDay).ToString();

            // Set the todays day text..
            myText += " - Today is the " + DateTime.Now.Day.ToString() + Code.HelperMethods.DaySuffix(DateTime.Now.Day);

            txtPayDate.Text = myText;

            // Register the update balance method for any changes in the include in clacluation checkbox
            //Code.clsBankDebitsListViewAdapter.
        }
Ejemplo n.º 2
0
        protected override void OnResume()
        {
            base.OnResume();

            // Code.clsBankDebitsListViewAdapter adapter = new Code.clsBankDebitsListViewAdapter(this, Code.clsBankDebitDB.GetBankDebits());

            Code.clsBankDebitsListViewAdapter adapter = new Code.clsBankDebitsListViewAdapter(this, CashPredictorInstance.GetBankDebits());

            mBankDebitListView.Adapter = adapter;

            mBankDebitListView.RefreshDrawableState();

            if (SMSBroadcastReceiver == null)
            {
                SMSBroadcastReceiver = new Code.ClsSMSBroadcastReceiver();
                RegisterReceiver(SMSBroadcastReceiver, new IntentFilter("android.provider.Telephony.SMS_RECEIVED"));
            }
        }