Exemplo n.º 1
0
        protected async override void OnResume()
        {
            try
            {
                base.OnResume();

                ProgressDialogLogin = ProgressDialog.Show(this, "", "Loading...");

                await GetWorkshops();

                if (ProgressDialogLogin != null)
                {
                    ProgressDialogLogin.Dismiss();
                    ProgressDialogLogin = null;
                }
            }
            catch (Exception e)
            {
                ErrorHandling.LogError(e, this);
            }
            finally
            {
                if (ProgressDialogLogin != null)
                {
                    ProgressDialogLogin.Dismiss();
                    ProgressDialogLogin = null;
                }
            }
        }
 public ExpandListSessionAdapter(Activity activity, Dictionary <string, WorkshopSessions> dictGroupIn)
 {
     try
     {
         _activity   = activity;
         _dictGroup  = dictGroupIn;
         _lstGroupID = dictGroupIn.Keys.ToList();
     }
     catch (Exception e)
     {
         ErrorHandling.LogError(e, activity);
     }
 }
Exemplo n.º 3
0
        protected async override void OnCreate(Bundle bundle)
        {
            try
            {
                base.OnCreate(bundle);
                SetContentView(Resource.Layout.MakeBookingSesh);

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

                //progressDialog = ProgressDialog.Show(this, "", "Loading...");

                string WorkshopSetId = Intent.GetStringExtra("WorkshopSetId");
                _WorkshopSessions = await RESTClass.GetWorkshopSessions("?workshopSetId=" + WorkshopSetId);

                CreateExpendableListData();

                ExpandableListView elvExListBox = FindViewById <ExpandableListView> (Resource.Id.elvExListBox);
                elvExListBox.SetAdapter(new ExpandListSessionAdapter(this, dictGroup));

                elvExListBox.ChildClick += delegate(object sender, ExpandableListView.ChildClickEventArgs e) {
                    string           itmGroup = lstKeys [e.GroupPosition];
                    WorkshopSessions itmChild = dictGroup [itmGroup];
                };

                elvExListBox.GroupExpand += delegate(object sender, ExpandableListView.GroupExpandEventArgs e) {
                    if (lastExpandedPosition != -1 && e.GroupPosition != lastExpandedPosition)
                    {
                        elvExListBox.CollapseGroup(lastExpandedPosition);
                    }

                    lastExpandedPosition = e.GroupPosition;
                };

                //				Button btnViewDetails = FindViewById<Button>(Resource.Id.btnViewDetails);
                //				btnViewDetails.Click += delegate {
                //					StartActivity(new Intent(this, typeof(MakeBookingListActivity)));
                //				};
            }
            catch (Exception e)
            {
                ErrorHandling.LogError(e, this);
            }
            finally
            {
                //				progressDialog.Dismiss();
                //				progressDialog.Dispose ();
            }
        }
Exemplo n.º 4
0
        public override bool OnOptionsItemSelected(IMenuItem item)
        {
            try
            {
                switch (item.ItemId)
                {
                case Android.Resource.Id.Home:
                    Finish();
                    return(true);

                default:
                    return(base.OnOptionsItemSelected(item));
                }
            }
            catch (Exception e)
            {
                ErrorHandling.LogError(e, this);
                return(false);
            }
        }
Exemplo n.º 5
0
        protected override void OnCreate(Bundle bundle)
        {
            try
            {
                base.OnCreate(bundle);
                SetContentView(Resource.Layout.MakeBookingList);

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

                lvWorkShops            = FindViewById <ListView>(Resource.Id.lvWorkShops);
                lvWorkShops.ItemClick += (object sender, AdapterView.ItemClickEventArgs e) => {
                    var BookingSeshions = new Intent(this, typeof(MakeBookingSeshActivity));
                    BookingSeshions.PutExtra("WorkshopSetId", WrkSets.ElementAt <WorkshopSets>((int)e.Id).id.ToString());
                    StartActivity(BookingSeshions);
                };
            }
            catch (Exception e)
            {
                ErrorHandling.LogError(e, this);
            }
        }
Exemplo n.º 6
0
        public void WriteObjects()
        {
            try
            {
                if (Globals.IsNewStudent)
                {
                    if (tbStudentName != null)
                    {
                        Globals.StuName = tbStudentName.Text;
                    }
                    if (tbDOB != null)
                    {
                        Globals.LoggedStudent.dob = tbDOB.Text;
                    }
                    if (tbEmail != null)
                    {
                        Globals.StuEmail = tbEmail.Text;
                    }
                    if (tbMobile != null)
                    {
                        Globals.StuMobile = tbMobile.Text;
                    }
                    if (tbCourse != null)
                    {
                        Globals.StuCourse = tbCourse.Text;
                    }
                    if (tbFaculty != null)
                    {
                        Globals.StuFaculty = tbFaculty.Text;
                    }
                }

                if (tbPrefferedName != null)
                {
                    Globals.LoggedStudent.preferred_name = tbPrefferedName.Text;
                }
                if (rbMale != null && rbMale.Checked == true)
                {
                    Globals.LoggedStudent.gender = "M";
                }
                else if (rbFemale != null)
                {
                    Globals.LoggedStudent.gender = "F";
                }
                if (rbPermanent != null && rbPermanent.Checked == true)
                {
                    Globals.LoggedStudent.status = "Permanent";
                }
                else if (rbInternational != null)
                {
                    Globals.LoggedStudent.status = "International";
                }
                //FirstLanguage
                //Country of Origin
                if (tbNumber != null)
                {
                    Globals.LoggedStudent.alternative_contact = tbNumber.Text;
                }
                if (rbUndergraduate != null && rbUndergraduate.Checked == true)
                {
                    Globals.LoggedStudent.degree = "UG";
                }
                else if (rbPostgraduate != null)
                {
                    Globals.LoggedStudent.degree = "PG";
                }
                if (ddlYear != null && ddlYear.SelectedItem != null)
                {
                    Globals.StuYear = ddlYear.SelectedItem.ToString();
                }
                if (cbHSC != null)
                {
                    Globals.LoggedStudent.HSC = cbHSC.Checked ? "true" : "false";
                }
                if (cbIELTS != null)
                {
                    Globals.LoggedStudent.IELTS = cbIELTS.Checked ? "true" : "false";
                }
                if (cbTOEFL != null)
                {
                    Globals.LoggedStudent.TOEFL = cbTOEFL.Checked ? "true" : "false";
                }
                if (cbTAFE != null)
                {
                    Globals.LoggedStudent.TAFE = cbTAFE.Checked ? "true" : "false";
                }
                if (cbCULT != null)
                {
                    Globals.LoggedStudent.CULT = cbCULT.Checked ? "true" : "false";
                }
                if (cbDEEP != null)
                {
                    Globals.LoggedStudent.InsearchDEEP = cbDEEP.Checked ? "true" : "false";
                }
                if (cbInDiploma != null)
                {
                    Globals.LoggedStudent.InsearchDiploma = cbInDiploma.Checked ? "true" : "false";
                }
                if (cbFoundationCourse != null)
                {
                    Globals.LoggedStudent.foundationcourse = cbFoundationCourse.Checked ? "true" : "false";
                }
                if (tbOther != null)
                {
                    Globals.StuOther = tbOther.Text;
                }
            }
            catch (Exception e)
            {
                ErrorHandling.LogError(e, parentView.Context);
            }
        }
Exemplo n.º 7
0
        protected async override void OnCreate(Bundle bundle)
        {
            try
            {
                base.OnCreate(bundle);
                SetContentView(Resource.Layout.Search);
                List <string>       WorkshopList;
                List <WorkshopSets> WrkSets;
                EditText            txtsearch      = FindViewById <EditText>(Resource.Id.txtsearch);
                Spinner             searchWorkshop = FindViewById <Spinner>(Resource.Id.ddpworkshop);
                ExpandableListView  ddpSearchList  = FindViewById <ExpandableListView> (Resource.Id.ddpSearch);
                ImageButton         btnsearch      = FindViewById <ImageButton>(Resource.Id.imgsearch);
                ListView            workshoplist   = FindViewById <ListView>(Resource.Id.lvlWorkShops);
                string search;


                WorkshopList = new List <string>();
                WorkshopList.Add("Session");
                WorkshopList.Add("Workshop");
                WorkshopList.Add("Programs");
                ArrayAdapter <String> adapter = new ArrayAdapter <String>(this, Android.Resource.Layout.SimpleDropDownItem1Line, WorkshopList);
                searchWorkshop.Adapter = adapter;

                btnsearch.Click += async delegate
                {
                    try
                    {
                        search = txtsearch.Text;
                        string searchBy;
                        searchBy = searchWorkshop.SelectedItem.ToString();

                        progressDialog = ProgressDialog.Show(this, "", "Searching...");

                        if (searchBy == "Session")
                        {
                            //string WorkshopSetId = Intent.GetStringExtra(search);
                            _WorkshopSessions = await RESTClass.GetWorkshopSessions("?workshopSetId=" + search);

                            //_WorkshopSessions = await RESTClass.GetWorkshopSessions("?topic=" + WorkshopSetId + "&active=true&etc.");
                        }
                        else if (searchBy == "Workshop")
                        {
                            WrkSets = await RESTClass.GetWorkshopList("?active=true");

                            taskList             = new Adapters.SearchAdapter(this, WrkSets);
                            workshoplist.Adapter = taskList;
                            //	lvWorkShops.Adapter = taskList;


                            //			new AlertDialog.Builder (this)
                            //				.SetMessage(taskList.GetId(0))
                            //				.SetTitle("Application Error")
                            //				.Show();
                        }
                        else if (searchBy == "Programs")
                        {
                            //await Ge
                        }
                        dictGroup.Clear();
                        CreateExpendableListData();

                        ddpSearchList.SetAdapter(new ExpandListSessionAdapter(this, dictGroup));
                    }
                    catch (Exception e)
                    {
                        ErrorHandling.LogError(e, this);
                    }
                    finally
                    {
                        progressDialog.Dismiss();
                        progressDialog.Dispose();
                    }
                };

                ddpSearchList.ChildClick += delegate(object sender, ExpandableListView.ChildClickEventArgs e)
                {
                    try
                    {
                        string           itmGroup = lstKeys [e.GroupPosition];
                        WorkshopSessions itmChild = dictGroup [itmGroup];
                    }
                    catch (Exception Ex)
                    {
                        ErrorHandling.LogError(Ex, this);
                    }
                };

                ddpSearchList.GroupExpand += delegate(object sender, ExpandableListView.GroupExpandEventArgs e)
                {
                    if (lastExpandedPosition != -1 && e.GroupPosition != lastExpandedPosition)
                    {
                        ddpSearchList.CollapseGroup(lastExpandedPosition);
                    }

                    lastExpandedPosition = e.GroupPosition;
                };

                //				Button btnViewDetails = FindViewById<Button>(Resource.Id.btnViewDetails);
                //				btnViewDetails.Click += delegate {
                //					StartActivity(new Intent(this, typeof(MakeBookingListActivity)));
                //				} ;
            }
            catch (Exception e)
            {
                ErrorHandling.LogError(e, this);
            }
            finally
            {
                //				progressDialog.Dismiss();
                //				progressDialog.Dispose ();
            }
        }
Exemplo n.º 8
0
        protected override void OnCreate(Bundle bundle)
        {
            try
            {
                base.OnCreate(bundle);
                SetContentView(Resource.Layout.MainMenu);

                // Get our button from the layout resource, and attach an event to it
                Button    btnMakeBooking    = FindViewById <Button> (Resource.Id.btnMakeBooking);
                Button    btnViewBooking    = FindViewById <Button> (Resource.Id.btnViewBooking);
                Button    btnSearch         = FindViewById <Button> (Resource.Id.btnSearch);
                Button    btnHelp           = FindViewById <Button> (Resource.Id.btnHelp);
                Button    btnProfile        = FindViewById <Button> (Resource.Id.btnProfile);
                Button    btnLogout         = FindViewById <Button> (Resource.Id.btnLogout);
                Button    btnMarkAttendance = FindViewById <Button> (Resource.Id.btnMarkAttendance);
                ImageView ivMakeBooking     = FindViewById <ImageView> (Resource.Id.ivMakeBooking);
                ImageView ivMarkAttendance  = FindViewById <ImageView> (Resource.Id.ivMarkAttendance);
                ImageView ivViewBooking     = FindViewById <ImageView> (Resource.Id.ivViewBooking);
                ImageView ivSearch          = FindViewById <ImageView> (Resource.Id.ivSearch);
                ImageView ivHelp            = FindViewById <ImageView> (Resource.Id.ivHelp);
                ImageView ivProfile         = FindViewById <ImageView> (Resource.Id.ivProfile);

                btnMakeBooking.Click += delegate  {
                    StartActivity(new Intent(this, typeof(MakeBookingListActivity)));
                };
                ivMakeBooking.Click += delegate  {
                    StartActivity(new Intent(this, typeof(MakeBookingListActivity)));
                };

                btnMarkAttendance.Click += delegate {
                    StartActivity(new Intent(this, typeof(CheckInActivity)));
                };
                ivMarkAttendance.Click += delegate {
                    StartActivity(new Intent(this, typeof(CheckInActivity)));
                };

                btnViewBooking.Click += delegate {
                    StartActivity(new Intent(this, typeof(ViewBookingsActivity)));
                };
                ivViewBooking.Click += delegate {
                    StartActivity(new Intent(this, typeof(ViewBookingsActivity)));
                };

                btnSearch.Click += delegate {
                    StartActivity(new Intent(this, typeof(SearchActivity)));
                };
                ivSearch.Click += delegate {
                    StartActivity(new Intent(this, typeof(SearchActivity)));
                };

                btnHelp.Click += delegate {
                    StartActivity(new Intent(this, typeof(HelpActivity)));
                };
                ivHelp.Click += delegate {
                    StartActivity(new Intent(this, typeof(HelpActivity)));
                };

                btnProfile.Click += delegate {
                    var intent = new Intent(this, typeof(ProfileActivity));
//					intent.PutExtra("PreviousActivity", "Main");
                    StartActivity(intent);
//					StartActivity(new Intent(this, typeof(ProfileActivity)));
                };
                ivProfile.Click += delegate {
                    var intent = new Intent(this, typeof(ProfileActivity));
//					intent.PutExtra("PreviousActivity", "Main");
                    StartActivity(intent);
//					StartActivity(new Intent(this, typeof(ProfileActivity)));
                };

                btnLogout.Click += delegate {
                    Android.OS.Process.KillProcess(Android.OS.Process.MyPid());
                };

                if (Globals.ActivityFrom == "Registration")
                {
                }
            }
            catch (Exception e)
            {
                ErrorHandling.LogError(e, this);
            }
        }
Exemplo n.º 9
0
        protected override void OnCreate(Bundle bundle)
        {
            string         userId              = "";
            string         password            = "";
            ProgressDialog ProgressDialogLogin = null;

            try
            {
                base.OnCreate(bundle);
                SetContentView(Resource.Layout.Login);

                Button       btnLogin    = FindViewById <Button>(Resource.Id.btnLogin);
                EditText     tbStudentID = FindViewById <EditText>(Resource.Id.tbStudentID);
                EditText     tbPassword  = FindViewById <EditText>(Resource.Id.tbPassword);
                LinearLayout llRoot      = FindViewById <LinearLayout>(Resource.Id.llRoot);
                TextView     txtmessage  = FindViewById <TextView>(Resource.Id.txtmessage);

                txtmessage.Visibility = ViewStates.Invisible;
                tbStudentID.Text      = userId;
                tbPassword.Text       = password;

                llRoot.Click += delegate {
                    //Dismiss Keybaord
                    InputMethodManager imm = (InputMethodManager)GetSystemService(Context.InputMethodService);
                    imm.HideSoftInputFromWindow(tbStudentID.WindowToken, 0);
                    btnLogin.RequestFocus();
                };

                btnLogin.Click += async delegate {
                    try
                    {
                        userId = tbStudentID.Text;

                        if (String.IsNullOrWhiteSpace(tbStudentID.Text) || String.IsNullOrWhiteSpace(tbPassword.Text))
                        {
                            txtmessage.Text       = "Please enter your Student Id and Password.";
                            txtmessage.Visibility = ViewStates.Visible;
                        }
                        else
                        {
                            if (ProgressDialogLogin == null)
                            {
                                ProgressDialogLogin = ProgressDialog.Show(this, "", "Logging In...");

                                Student student = await RESTClass.GetStudent(userId);

                                if (student != null)
                                {
                                    Globals.LoggedStudent = student;

                                    if (Globals.StudentExists(student.studentID))                                     //Finds out if the studentid is in the text file and fills out globals if true
                                    {
                                        Globals.IsNewStudent = false;
                                        Globals.SetGlobalVars(student.studentID);
                                        StartActivity(new Intent(this, typeof(MainMenuActivity)));
                                    }
                                    else
                                    {
                                        Globals.IsNewStudent = true;
                                        StartActivity(new Intent(this, typeof(ProfileActivity)));
                                    }
                                }
                                else
                                {
                                    txtmessage.Text       = "This is not a vaid UTS ID.";
                                    txtmessage.Visibility = ViewStates.Visible;
                                }

                                if (ProgressDialogLogin != null)
                                {
                                    ProgressDialogLogin.Dismiss();
                                    ProgressDialogLogin = null;
                                }
                            }
                        }
                    }
                    catch (Exception e)
                    {
                        ErrorHandling.LogError(e, this);
                        if (ProgressDialogLogin != null)
                        {
                            ProgressDialogLogin.Dismiss();
                            ProgressDialogLogin = null;
                        }
                    }
                };
            }
            catch (Exception e)
            {
                ErrorHandling.LogError(e, this);
            }
            finally
            {
                if (ProgressDialogLogin != null)
                {
                    ProgressDialogLogin.Dismiss();
                    ProgressDialogLogin = null;
                }
            }
        }
Exemplo n.º 10
0
            public override Java.Lang.Object InstantiateItem(ViewGroup container, int position)
            {
                try
                {
                    View view;

                    Int32 lastExpandedPosition = -1;

                    CreateExpandableListData();

                    if (position == 0)                     //Current Booking tab
                    {
                        view = LayoutInflater.From(container.Context).Inflate(Resource.Layout.CurrentBookingLayout, container, false);
                        container.AddView(view);

                        flCurrentBookings   = container.FindViewById <FrameLayout> (Resource.Id.flCurrentBookings);
                        flNoCurrentBookings = container.FindViewById <FrameLayout> (Resource.Id.flNoCurrentBookings);
                        elvCurrentBookings  = container.FindViewById <ExpandableListView> (Resource.Id.elvCurrentBookings);

                        if (dictGroupCurr.Count > 0)
                        {
                            flNoCurrentBookings.Visibility = ViewStates.Gone;
                            flCurrentBookings.Visibility   = ViewStates.Visible;

                            elvCurrentBookings.SetAdapter(new ExpandViewBookingAdapter(parent, dictGroupCurr));

                            elvCurrentBookings.ChildClick += delegate(object sender, ExpandableListView.ChildClickEventArgs e) {
                                string          itmGroup = lstKeysCurr [e.GroupPosition];
                                WorkshopBooking itmChild = dictGroupCurr [itmGroup];
                            };

                            elvCurrentBookings.GroupExpand += delegate(object sender, ExpandableListView.GroupExpandEventArgs e) {
                                if (lastExpandedPosition != -1 && e.GroupPosition != lastExpandedPosition)
                                {
                                    elvCurrentBookings.CollapseGroup(lastExpandedPosition);
                                }

                                lastExpandedPosition = e.GroupPosition;
                            };
                        }
                        else
                        {
                            flNoCurrentBookings.Visibility = ViewStates.Visible;
                            flCurrentBookings.Visibility   = ViewStates.Gone;
                        }
                    }
                    else                     //Past Bookings
                    {
                        view = LayoutInflater.From(container.Context).Inflate(Resource.Layout.PastBookings, container, false);
                        container.AddView(view);

                        flPastBookings   = container.FindViewById <FrameLayout> (Resource.Id.flPastBookings);
                        flNoPastBookings = container.FindViewById <FrameLayout> (Resource.Id.flNoPastBookings);
                        elvPastBookings  = container.FindViewById <ExpandableListView> (Resource.Id.elvPastBookings);

                        if (dictGroupPast.Count > 0)
                        {
                            flNoPastBookings.Visibility = ViewStates.Gone;
                            flPastBookings.Visibility   = ViewStates.Visible;
                            elvPastBookings.SetAdapter(new ExpandViewBookingAdapter(parent, dictGroupPast));

                            elvPastBookings.ChildClick += delegate(object sender, ExpandableListView.ChildClickEventArgs e) {
                                string          itmGroup = lstKeysPast [e.GroupPosition];
                                WorkshopBooking itmChild = dictGroupPast [itmGroup];
                            };

                            elvPastBookings.GroupExpand += delegate(object sender, ExpandableListView.GroupExpandEventArgs e) {
                                if (lastExpandedPosition != -1 && e.GroupPosition != lastExpandedPosition)
                                {
                                    elvPastBookings.CollapseGroup(lastExpandedPosition);
                                }

                                lastExpandedPosition = e.GroupPosition;
                            };
                        }
                        else
                        {
                            flNoPastBookings.Visibility = ViewStates.Visible;
                            flPastBookings.Visibility   = ViewStates.Gone;
                        }
                    }

                    return(view);
                }
                catch (Exception e)
                {
                    ErrorHandling.LogError(e, container.Context);
                    return(-1);
                }
            }