Exemplo n.º 1
0
        async void cdqueryAll()
        {
            String      myrole    = " ";
            int         clubUACM  = 0;
            cdCallAPI   mycallAPI = new cdCallAPI();
            Account     myaccount = new Account();
            cdQueryAttr qryAcct   = new cdQueryAttr();

            qryAcct.ColIndex  = "IndexName";
            qryAcct.IndexName = "MemberAccountIDIndex";
            qryAcct.ColName   = "MemberAccountID";
            qryAcct.ColValue  = loginAccount.AccountID;

            getClubMembers myClubs             = new getClubMembers();
            getClubMembers myUnApprovedMembers = new getClubMembers();

            var jsreponse = await mycallAPI.cdcallClubMembersGET(qryAcct);

            myClubs = JsonConvert.DeserializeObject <getClubMembers>((string)jsreponse);

            System.Diagnostics.Debug.WriteLine("Getting Clubs. Response received is " + jsreponse);

            try
            {
                foreach (var myc in myClubs.ClubMember)
                {
                    if (myc.MemberRole.Contains("A"))
                    {
                        cdQueryAttr qryAcctUACM = new cdQueryAttr();
                        qryAcctUACM.ColIndex  = "IndexName";
                        qryAcctUACM.IndexName = "AccountStatusIndex";
                        qryAcctUACM.ColName   = "ClubID";
                        qryAcctUACM.ColValue  = myc.ClubID;

                        System.Diagnostics.Debug.WriteLine("Getting unapproved members for Club ID " + myc.ClubID);

                        var jsreponseUACM = await mycallAPI.cdcallClubMembersUAGET(qryAcctUACM);

                        myUnApprovedMembers = JsonConvert.DeserializeObject <getClubMembers>((string)jsreponseUACM);

                        System.Diagnostics.Debug.WriteLine("Getting Unapproved club members. Response received is " + jsreponseUACM);

                        foreach (var mycuam in myUnApprovedMembers.ClubMember)
                        {
                            System.Diagnostics.Debug.WriteLine("Adding Club Member to the list " + mycuam.MemberAccountID);
                            unClubMembers.Add(mycuam);
                            maxarray = maxarray + 1;
                            clubUACM = clubUACM + 1;
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine("End of Array " + ex);
            }

            System.Diagnostics.Debug.WriteLine("Max Array " + maxarray + " club ua array " + clubUACM + " Counter " + counter);

            if (clubUACM > 0)
            {
                //  ApplicantName.Text = "Applicant Name: " + unClubMembers[counter].MemberName;

                if (unClubMembers[counter].MemberRole.Contains("D"))
                {
                    myrole = myrole + " Driver ";
                }
                if (unClubMembers[counter].MemberRole.Contains("P"))
                {
                    myrole = myrole + " Parent ";
                }
                if (unClubMembers[counter].MemberRole.Contains("A"))
                {
                    myrole = myrole + " Admin ";
                }
                if (unClubMembers[counter].MemberRole.Contains("R"))
                {
                    myrole = myrole + " Rider ";
                }
                // ApplicantType.Text = "Applicant Role: " + myrole;
            }


            if (counter == maxarray)
            {
                //PreviousButton.IsEnabled = false;
                //NextButton.IsEnabled = false;
            }
            else if (counter < maxarray)
            {
                //PreviousButton.IsEnabled = false;
                //NextButton.IsEnabled = true;
            }
            else
            {
                //PreviousButton.IsEnabled = false;
                //NextButton.IsEnabled = false;
            }
        }