private async void PSectionShow()
        {
            string secname = "";
            string QCD     = GPPClass.SelectedItem.ToString();

            try
            {
                string str = "SELECT distinct(sec_desc) , (section.sec_code)FROM student_admission_current_year INNER JOIN class ON student_admission_current_year.CLASS_CODE = class.class_code INNER JOIN section ON student_admission_current_year.SEC_CODE = section.SEC_CODE WHERE class_desc= '" + QCD + "'";

                DataSet myDataSet = new DataSet();
                await Task.Run(() =>
                {
                    myDataSet = DataFetch.GetData(str);
                });

                if (myDataSet.Tables[0].Rows.Count > 0)
                {
                    for (int i = 0; i < myDataSet.Tables[0].Rows.Count; i++)
                    {
                        secname    = myDataSet.Tables[0].Rows[i]["sec_desc"].ToString();
                        SecCode[i] = myDataSet.Tables[0].Rows[i]["sec_code"].ToString();

                        ListOfSections.Add(secname);
                    }
                    // loadingItems.IsVisible = false;
                    GPPSection.ItemsSource = ListOfSections;
                }
            }
            catch { }
        }
        private async void PClassShow()
        {
            string classname = "";

            try
            {
                string  str       = "select class_code, class_desc from class";
                DataSet myDataSet = new DataSet();
                await Task.Run(() =>
                {
                    myDataSet = DataFetch.GetData(str);
                });

                if (myDataSet.Tables[0].Rows.Count > 0)
                {
                    for (int i = 0; i < myDataSet.Tables[0].Rows.Count; i++)
                    {
                        ClassCode[i] = myDataSet.Tables[0].Rows[i]["class_code"].ToString();
                        classname    = myDataSet.Tables[0].Rows[i]["class_desc"].ToString();
                        ListOfClasses.Add(classname);
                    }
                    // loadingItems.IsVisible = false;
                    GPPClass.ItemsSource = ListOfClasses;
                }
            }
            catch { }
        }
        private async void Okokok()
        {
            for (int j = 0; j < loopcnt; j++)
            {
                int Y = Convert.ToInt32(arr[j]);
                try
                {
                    string  str       = "select ( STUD_CODE+'   '+ FIRST_NAME +' '+MIDDLE_NAME+' '+LAST_NAME)  AS Stddetails  from student where ID='" + Y + "'";
                    DataSet myDataSet = new DataSet();
                    await Task.Run(() =>
                    {
                        myDataSet = DataFetch.GetData(str);
                    });

                    if (myDataSet.Tables[0].Rows.Count > 0)
                    {
                        for (int i = 0; i < myDataSet.Tables[0].Rows.Count; i++)
                        {
                            StdInfo = myDataSet.Tables[0].Rows[i]["StdDetails"].ToString();

                            GMList.Add(StdInfo);
                        }
                    }
                }
                catch { }

                ArrStdDetails[j] = StdInfo;
            }
            Okkoo();
            //  VGMList.ItemsSource = GMList;
        }
Beispiel #4
0
        private async void SportsSchedule()
        {
            loopn = 0;
            GameSchedule.Clear();
            string SpSch = "";

            try
            {
                string  str       = "select game_date from game_date";
                DataSet myDataSet = new DataSet();
                await Task.Run(() =>
                {
                    myDataSet = DataFetch.GetData(str);
                });

                if (myDataSet.Tables[0].Rows.Count > 0)
                {
                    for (int i = 0; i < myDataSet.Tables[0].Rows.Count; i++)
                    {
                        SpSch = myDataSet.Tables[0].Rows[i]["game_date"].ToString();
                        DateTime d  = DateTime.ParseExact(SpSch, "MM/dd/yyyy", CultureInfo.InvariantCulture);
                        string   ok = d.ToString("dddd, dd MMMM yyyy");
                        GameSchedule.Add(ok);
                        ArrGameDate[i] = ok;
                        GameDates.Add(SpSch);
                        loopn++;
                    }
                }
            }
            catch { }
            Vlayoutdata();
        }
Beispiel #5
0
        // Students Detail Info Block
        private async void GPIStdDetails()
        {
            string StdInfo = "";

            for (int j = 0; j < loopforindividual; j++)
            {
                int Y = Convert.ToInt32(ArrIndividualStdCode[j]);
                try
                {
                    string  str       = "select ( STUD_CODE+'   '+ FIRST_NAME +' '+MIDDLE_NAME+' '+LAST_NAME)  AS Stddetails  from student where ID='" + Y + "'";
                    DataSet myDataSet = new DataSet();
                    await Task.Run(() =>
                    {
                        myDataSet = DataFetch.GetData(str);
                    });

                    if (myDataSet.Tables[0].Rows.Count > 0)
                    {
                        for (int i = 0; i < myDataSet.Tables[0].Rows.Count; i++)
                        {
                            StdInfo = myDataSet.Tables[0].Rows[i]["StdDetails"].ToString();
                        }
                    }
                }
                catch { }
                ArrIndividualStdDetails[j] = StdInfo;
            }
            Testcodebehind();
        }
        private async void MStdName()
        {
            for (int j = 0; j < LoopCnt; j++)
            {
                int Y = Convert.ToInt32(StdCode[j]);
                try
                {
                    string  str       = "select ( STUD_CODE+'   '+ FIRST_NAME +' '+MIDDLE_NAME+' '+LAST_NAME)  AS Stddetails  from student where ID='" + Y + "'";
                    DataSet myDataSet = new DataSet();
                    await Task.Run(() =>
                    {
                        myDataSet = DataFetch.GetData(str);
                    });

                    if (myDataSet.Tables[0].Rows.Count > 0)
                    {
                        for (int i = 0; i < myDataSet.Tables[0].Rows.Count; i++)
                        {
                            StdInfo = myDataSet.Tables[0].Rows[i]["StdDetails"].ToString();
                            ListOfStudents.Add(StdInfo);
                        }
                    }
                }
                catch { }

                ArrStdDetails[j] = StdInfo;
            }

            VDesignData();
        }
        private async void Button_Clicked(object sender, EventArgs e)
        {
            string[] ArrOFIndex = ListOfIds.ToArray();
            int      run        = ArrOFIndex.Length;

            for (int i = 0; i < run; i++)
            {
                string a = ArrOFIndex[i];
                int    b = Convert.ToInt32(a);
                try
                {
                    string  str       = "INSERT INTO game_participants (game_Id,stud_code,A_year,game_date) Values('" + DataFetch.GameId + "','" + AStdCode[b] + "','" + DataFetch.AcademicYear + "','" + DataFetch.GameDate + "')";
                    DataSet myDataSet = new DataSet();
                    await Task.Run(() =>
                    {
                        myDataSet = DataFetch.GetData(str);
                    });
                }
                catch { }
            }

            if (DataFetch.flag == "T")
            {
                DependencyService.Get <IToastInterface>().Longtime("Game Participants Added Successfully");
                ListOfStudents.Clear();
                ListOfIds.Clear();
                Application.Current.MainPage = new NavigationPage(new GameParticipants());
            }
            else
            {
                DependencyService.Get <IToastInterface>().Longtime("Operation Failed! Try Again");
            }
        }
Beispiel #8
0
        private async void ListOfGames()
        {
            string dc = "";

            loopn = 0;
            try
            {
                string  str       = "select game_id, game_name from game";
                DataSet myDataSet = new DataSet();
                await Task.Run(() =>
                {
                    myDataSet = DataFetch.GetData(str);
                });

                if (myDataSet.Tables[0].Rows.Count > 0)
                {
                    for (int i = 0; i < myDataSet.Tables[0].Rows.Count; i++)
                    {
                        dc = myDataSet.Tables[0].Rows[i]["game_name"].ToString();
                        ArrStdDetails[i] = dc;
                        string updc = dc.ToUpper();
                        GID[i] = myDataSet.Tables[0].Rows[i]["game_id"].ToString();
                        Gamelistup.Add(updc);
                        Gamelist.Add(dc);
                        loopn++;
                    }
                }
            }
            catch { }
            PDWGameName.ItemsSource = Gamelist;
            DataForLayout();
        }
Beispiel #9
0
        private async void GroupsList()
        {
            Grpname.Clear();
            Grpnameup.Clear();
            loopcnt = 0;
            try
            {
                string  str       = "select group_Id, group_name from game_group where game_id='" + DataFetch.GameId + "'";
                DataSet myDataSet = new DataSet();
                await Task.Run(() =>
                {
                    myDataSet = DataFetch.GetData(str);
                });

                if (myDataSet.Tables[0].Rows.Count > 0)
                {
                    for (int i = 0; i < myDataSet.Tables[0].Rows.Count; i++)
                    {
                        string dc   = myDataSet.Tables[0].Rows[i]["group_name"].ToString();
                        string dcup = dc.ToUpper();
                        groupidok[i] = myDataSet.Tables[0].Rows[i]["group_Id"].ToString();
                        Grpnameup.Add(dcup);
                        Grpname.Add(dc);

                        ArrGameGroup[i] = dc;
                        loopcnt++;
                    }
                }
            }
            catch { }
            VDesignData();
        }
        private async void Button_Clicked(object sender, EventArgs e)
        {
            string[] ArrOFIndex = ListOfIds.ToArray();
            int      jdjdj      = ArrOFIndex.Length;

            for (int i = 0; i < jdjdj; i++)
            {
                int    A        = Convert.ToInt32(ArrOFIndex[i]);
                string QStdcode = StdCode[A];
                try
                {
                    string  str       = "INSERT INTO game_group_member (group_Id, stud_code, A_year) VALUES ('" + DataFetch.GroupId + "','" + QStdcode + "','" + DataFetch.AcademicYear + "')";
                    DataSet myDataSet = new DataSet();
                    await Task.Run(() =>
                    {
                        myDataSet = DataFetch.GetData(str);
                    });

                    if (DataFetch.flag == "T")
                    {
                        DependencyService.Get <IToastInterface>().Longtime("Group Members Added Successfully");
                    }
                    else
                    {
                        DependencyService.Get <IToastInterface>().Longtime("Operation Failed! Try Again");
                    }
                }

                catch { }
            }
            ListOfStudents.Clear();
            await Navigation.PushAsync(new GroupMemberList());
        }
        private async void GMLL()
        {
            loopcnt = 0;
            try
            {
                string  str       = "select stud_code from game_group_member where group_Id='" + DataFetch.GroupId + "'";
                DataSet myDataSet = new DataSet();
                await Task.Run(() =>
                {
                    myDataSet = DataFetch.GetData(str);
                });

                if (myDataSet.Tables[0].Rows.Count > 0)
                {
                    for (int i = 0; i < myDataSet.Tables[0].Rows.Count; i++)
                    {
                        arr[i] = myDataSet.Tables[0].Rows[i]["stud_code"].ToString();
                        loopcnt++;
                    }
                }
            }
            catch { }
            Total.Text = "(" + loopcnt.ToString() + ")";
            Okokok();
        }
Beispiel #12
0
        private async void IndividualParticipants()
        {
            loopforindividual = 0;
            GameParticipantsListIndividual.Clear();
            try
            {
                string  str       = "select stud_code from game_participants where game_Id='" + QGID + "'";
                DataSet myDataSet = new DataSet();
                await Task.Run(() =>
                {
                    myDataSet = DataFetch.GetData(str);
                });

                if (myDataSet.Tables[0].Rows.Count > 0)
                {
                    for (int i = 0; i < myDataSet.Tables[0].Rows.Count; i++)
                    {
                        loopforindividual++;
                        string abcdd4 = myDataSet.Tables[0].Rows[i]["stud_code"].ToString();
                        ArrIndividualStdCode[i] = abcdd4;
                    }
                }
            }
            catch { }
            GPIStdDetails();
        }
Beispiel #13
0
        //Individual Participants
        private async void IndividualWinners()
        {
            PDWGameName.IsEnabled = false;
            int    a          = 0;
            string GP         = "";
            int    abc        = PDWGameName.SelectedIndex;
            string abcd       = QGameDate;
            string gameid     = GID[abc];
            int    QGroupCode = 0;

            foreach (var entry in _myentries)
            {
                if (entry.SelectedIndex < 0)
                {
                    gameposition = 0;
                }
                else
                {
                    var marks = entry.Items[entry.SelectedIndex];
                    if (marks == "First")
                    {
                        gameposition = 1;
                    }
                    else if (marks == "Second")
                    {
                        gameposition = 2;
                    }
                    else if (marks == "Third")
                    {
                        gameposition = 3;
                    }
                    else if (marks == "Fourth")
                    {
                        gameposition = 4;
                    }
                }
                GP = gameposition.ToString();
                try
                {
                    string  str       = "insert into game_winner(game_id , game_date ,stud_code ,group_code ,position) values('" + gameid + "','" + QGameDate + "','" + ArrIndividualStdCode[a] + "','" + QGroupCode + "','" + GP + "')";
                    DataSet myDataSet = new DataSet();
                    await Task.Run(() =>
                    {
                        myDataSet = DataFetch.GetData(str);
                    });
                }
                catch { }
                a++;
            }
            PDWGameName.IsEnabled = true;
        }
Beispiel #14
0
        //Code For Result Portion
        private async void PDWGameName_SelectedIndexChanged(object sender, EventArgs e)
        {
            loopforGroup = 0;
            int abc = PDWGameName.SelectedIndex;

            QGID = GID[abc];
            try
            {
                string  str       = "select game_date from game_participants where game_Id='" + QGID + "'";
                DataSet myDataSet = new DataSet();
                await Task.Run(() =>
                {
                    myDataSet = DataFetch.GetData(str);
                });

                if (myDataSet.Tables[0].Rows.Count > 0)
                {
                    QGameDate = myDataSet.Tables[0].Rows[0]["game_date"].ToString();
                }
            }

            catch { }

            //Code For List Of Groups/Ids
            try
            {
                string  str       = "select group_name, group_Id from game_group where game_Id='" + QGID + "'";
                DataSet myDataSet = new DataSet();
                myDataSet = DataFetch.GetData(str);
                if (myDataSet.Tables[0].Rows.Count > 0)
                {
                    for (int i = 0; i < myDataSet.Tables[0].Rows.Count; i++)
                    {
                        decidetorun = 0;
                        loopforGroup++;
                        string Gn  = myDataSet.Tables[0].Rows[i]["group_name"].ToString();
                        string Gid = myDataSet.Tables[0].Rows[i]["group_Id"].ToString();
                        ArrGroupName[i] = Gn;
                        ArrGroupId[i]   = Gid;
                    }
                }
            }
            catch
            {
                decidetorun++;
                IndividualParticipants();
            }

            Testcodebehind();
        }
Beispiel #15
0
        private async void GGSubmit(object sender, EventArgs e)
        {
            string GName = GameName.Text;

            if (GName != null & GName != string.Empty)
            {
                string upce = GName.ToUpper();
                if (Gamelistup.Contains(upce))
                {
                    await DisplayAlert("Alert", "The Game Is Already IN The List", "ok");
                }
                else
                {
                    try
                    {
                        string  str       = "insert into game(A_year, game_name) values('" + DataFetch.AcademicYear + "','" + GName + "')";
                        DataSet myDataSet = new DataSet();
                        await Task.Run(() =>
                        {
                            myDataSet = DataFetch.GetData(str);
                        });

                        if (DataFetch.flag == "T")
                        {
                            GameName.Text = null;
                            ListOfGames();
                            DependencyService.Get <IToastInterface>().Longtime("Game Added Successfully");
                            AddGameBlock.IsVisible = false;
                        }
                        else
                        {
                            DependencyService.Get <IToastInterface>().Longtime("Operation Failed! Try Again");
                        }
                    }
                    catch
                    {
                        await DisplayAlert("Alert", "Please,  Check Your Connection ", "ok");
                    }
                }
            }
            else
            {
                await DisplayAlert("Alert", "Please, Enter Game Name", "ok");
            }
        }
Beispiel #16
0
        private async void Button_Clicked_1(object sender, EventArgs e)
        {
            if (GGGTN.Text != null & GGGTN.Text != string.Empty)
            {
                string QGrpName = GGGTN.Text.ToUpper();
                if (Grpnameup.Contains(QGrpName))
                {
                    await DisplayAlert("Alert", "Group Name Already Exists! Try New One", "ok");
                }
                else
                {
                    try
                    {
                        string  str       = "INSERT INTO game_group(group_name, A_year, game_id) VALUES('" + GGGTN.Text + "', '" + DataFetch.AcademicYear + "', '" + DataFetch.GameId + "')";
                        DataSet myDataSet = new DataSet();
                        await Task.Run(() =>
                        {
                            myDataSet = DataFetch.GetData(str);
                        });

                        if (DataFetch.flag == "T")
                        {
                            AddGrp.IsVisible = false;
                            DependencyService.Get <IToastInterface>().Longtime("Group Formed Successfully");
                            VGroupListView.ItemsSource = null;
                            Grpname.Clear();
                            GGGTN.Text = null;
                            GroupsList();
                        }
                        else
                        {
                            DependencyService.Get <IToastInterface>().Longtime("Operation Failed! Try Again");
                        }
                    }

                    catch { }
                }
            }
            else
            {
                await DisplayAlert("Alert", "Please Enter Group Name", "Ok");
            }
        }
        private async void BTNPShow_Clicked(object sender, EventArgs e)
        {
            loopn4                = 0;
            Details.Text          = DataFetch.GameName.ToLower();
            ListTest1.ItemsSource = null;
            ram1.Clear();
            ListOfStudents.Clear();
            int abc = GPPSection.SelectedIndex;
            int cde = GPPClass.SelectedIndex;

            qseck   = SecCode[abc];
            qclassk = ClassCode[cde];
            if (qseck != null & qclassk != null)
            {
                try
                {
                    string  str       = "select ID, (FIRST_NAME  +' '+   MIDDLE_NAME + ' '  +LAST_NAME)  AS NAME from student inner join student_admission_current_year on student.STUD_CODE=student_admission_current_year.STUD_CODE where CLASS_CODE='" + qclassk + "' AND SEC_CODE='" + qseck + "'";
                    DataSet myDataSet = new DataSet();
                    await Task.Run(() =>
                    {
                        myDataSet = DataFetch.GetData(str);
                    });

                    if (myDataSet.Tables[0].Rows.Count > 0)
                    {
                        for (int i = 0; i < myDataSet.Tables[0].Rows.Count; i++)
                        {
                            AStdCode[i] = myDataSet.Tables[0].Rows[i]["ID"].ToString();
                            string Stddetails = myDataSet.Tables[0].Rows[i]["NAME"].ToString();
                            ArrStudents[i] = Stddetails;
                            loopn4++;
                            ListOfStudents.Add(Stddetails);
                        }
                    }
                    abcd.IsVisible = true;
                }
                catch { }
            }

            Okkoo1();
            ListOfIds.Clear();
        }
Beispiel #18
0
        private async void SubmitCE(object sender, EventArgs e)
        {
            DateTime objdate = SDate.Date;
            string   day     = objdate.Day.ToString("00");
            string   month   = objdate.Month.ToString("00");
            string   year    = objdate.Year.ToString();
            string   Qdate   = month.ToString() + "/" + day.ToString() + "/" + year.ToString();

            if (GameDates.Contains(Qdate))
            {
                await DisplayAlert("Alert", "The Date Is Already IN The List", "ok");
            }
            else
            {
                try
                {
                    string  str       = "insert into game_date(game_Id,game_date,A_year)values('" + DataFetch.GameId + "','" + Qdate + "','" + DataFetch.AcademicYear + "')";
                    DataSet myDataSet = new DataSet();
                    await Task.Run(() =>
                    {
                        myDataSet = DataFetch.GetData(str);
                    });

                    if (DataFetch.flag == "T")
                    {
                        DependencyService.Get <IToastInterface>().Longtime("Game Scheduled Successfully");
                        ScheduleGame.IsVisible = false;
                        SportsSchedule();
                    }
                    else
                    {
                        DependencyService.Get <IToastInterface>().Longtime("Operation Failed! Try Again");
                    }
                }
                catch { }
            }
        }
        private async void GameParticipantsList()
        {
            try
            {
                string  str       = "select stud_code from game_participants where game_Id='" + DataFetch.GameId + "'";
                DataSet myDataSet = new DataSet();
                await Task.Run(() =>
                {
                    myDataSet = DataFetch.GetData(str);
                });

                if (myDataSet.Tables[0].Rows.Count > 0)
                {
                    for (int i = 0; i < myDataSet.Tables[0].Rows.Count; i++)
                    {
                        arr[i] = myDataSet.Tables[0].Rows[i]["stud_code"].ToString();
                        loopcnt++;
                    }
                }
            }
            catch { }
            Total.Text = loopcnt.ToString();
            Okokok();
        }
        private async void MStdCodes()
        {
            try
            {
                string  str       = "select stud_code from game_participants where game_id='" + DataFetch.GameId + "'";
                DataSet myDataSet = new DataSet();
                await Task.Run(() =>
                {
                    myDataSet = DataFetch.GetData(str);
                });

                if (myDataSet.Tables[0].Rows.Count > 0)
                {
                    for (int i = 0; i < myDataSet.Tables[0].Rows.Count; i++)
                    {
                        StdCode[i] = myDataSet.Tables[0].Rows[i]["stud_code"].ToString();
                        LoopCnt++;
                        ListOfStdCodes.Add(StdCode[i]);
                    }
                }
            }
            catch { }
            MStdName();
        }
Beispiel #21
0
        private async void GroupWinners()
        {
            PDWGameName.IsEnabled = false;
            string gp         = "";
            int    a          = 0;
            int    insertloop = 0;
            int    abc        = PDWGameName.SelectedIndex;
            string abcd       = QGameDate;
            string gameid     = GID[abc];
            string QGroupCode = "";

            foreach (var entry in _myentries)
            {
                insertloop = 0;
                QGroupCode = ArrGroupId[a];
                if (entry.SelectedIndex < 0)
                {
                    gameposition = 0;
                }
                else
                {
                    var marks = entry.Items[entry.SelectedIndex];
                    if (marks == "First")
                    {
                        gameposition = 1;
                    }
                    else if (marks == "Second")
                    {
                        gameposition = 2;
                    }
                    else if (marks == "Third")
                    {
                        gameposition = 3;
                    }
                    else if (marks == "Fourth")
                    {
                        gameposition = 4;
                    }
                }
                gp = gameposition.ToString();

                try
                {
                    string  str       = "select stud_code from game_group_member where group_Id='" + QGroupCode + "'";
                    DataSet myDataSet = new DataSet();
                    await Task.Run(() =>
                    {
                        myDataSet = DataFetch.GetData(str);
                    });

                    if (myDataSet.Tables[0].Rows.Count > 0)
                    {
                        for (int i = 0; i < myDataSet.Tables[0].Rows.Count; i++)
                        {
                            insertloop++;
                            string GroupStdCodes = myDataSet.Tables[0].Rows[i]["stud_code"].ToString();
                            ArrGroupStdCode[i] = GroupStdCodes;
                        }
                    }
                }
                catch { }

                for (int i = 0; i < insertloop; i++)
                {
                    try
                    {
                        string  str       = "insert into game_winner(game_id , game_date ,stud_code ,group_code ,position) values('" + gameid + "','" + QGameDate + "','" + ArrGroupStdCode[i] + "','" + QGroupCode + "','" + gp + "')";
                        DataSet myDataSet = new DataSet();
                        await Task.Run(() =>
                        {
                            myDataSet = DataFetch.GetData(str);
                        });

                        //if (DataFetch.flag == "T")
                        //{

                        //    DependencyService.Get<IToastInterface>().Longtime("Game Added Successfully");

                        //}
                        //else
                        //{
                        //    DependencyService.Get<IToastInterface>().Longtime("Operation Failed! Try Again");
                        //}
                    }
                    catch
                    {
                        // await DisplayAlert("Alert", "Please,  Check Your Connection ", "ok");
                    }
                }

                a++;
            }
            PDWGameName.IsEnabled = true;
        }