Example #1
0
        public void ShowNotification(User employee)
        {
            AlertDialog.Builder builder = new AlertDialog.Builder(this);
            AlertDialog alertDialog = builder.Create();
            alertDialog.SetTitle("Break Time for: " + employee.GetName());
            alertDialog.SetIcon(Android.Resource.Drawable.IcDialogAlert);
            alertDialog.SetMessage("You have been working " + employee.GetTimeWorked() + " hours, You are entitled to a " + employee.GetBreakTime() + " minute break");

            alertDialog.SetButton("OK", (s, ev) =>
            {
                //Record Acknowledgement
                Toast.MakeText(this, "Break Acknowledged", ToastLength.Short).Show();

                TextView acknowledged = (TextView)FindViewById(Resource.Id.acknowledged);
                acknowledged.Text = "Acknowledged at " + DateTime.Now.ToLocalTime().ToShortTimeString();

            });

            alertDialog.Show();
        }
Example #2
0
        protected void Update(User toUpdate)
        {
            TextView username = (TextView)FindViewById(Resource.Id.username);
            TextView logintime = (TextView)FindViewById(Resource.Id.logintime);
            TextView timeworked = (TextView)FindViewById(Resource.Id.timeworked);
            TextView breaktime = (TextView)FindViewById(Resource.Id.breaktime);

            username.Text = toUpdate.GetName();
            logintime.Text = toUpdate.GetSignOn().ToString();
            timeworked.Text = toUpdate.GetTimeWorked().ToString();
            breaktime.Text = toUpdate.GetBreakTime().ToString();

            TextView acknowledged = (TextView)FindViewById(Resource.Id.acknowledged);
            acknowledged.Text = "Not Acknowledged";
        }