private void Retrive_StudentLRN_Section_GradeLevel()
        {
            try
            {
                string RetrieveQuery = "SELECT [LRN], [GRADE LEVEL], [SECTION] FROM [Tbl.Students] WHERE [STUDENT ID] = '" + StudentID + "'";
                sqlcommand = new SqlCommand(RetrieveQuery, sqlconnection);
                SqlDataReader sqldatareader = sqlcommand.ExecuteReader();

                while (sqldatareader.Read())
                {
                    LRNTextbox.Text = sqldatareader.GetString(0);
                    GradeLevelDropdown.AddItem(sqldatareader.GetString(1).ToUpper());
                    SectionDropdown.AddItem(sqldatareader.GetString(2).ToUpper());
                }
                sqldatareader.Close();

                GradeLevelDropdown.selectedIndex = 0;
                SectionDropdown.selectedIndex    = 0;
            }

            catch (Exception)
            {
                //DON'T DISPLAY ANYTHING SHIT !
            }
        }
예제 #2
0
        private void Load_Personal_Info_AsPlaceholder()
        {
            try
            {
                string RetrieveQuery = "SELECT * FROM [Tbl.Students] WHERE [STUDENT ID] = '" + StudentID + "'";
                sqlcommand = new SqlCommand(RetrieveQuery, sqlconnection);
                SqlDataReader sqldatareader = sqlcommand.ExecuteReader();

                while (sqldatareader.Read())
                {
                    StudentIDTextbox.Text = sqldatareader.GetString(0);
                    UserIDTextbox.Text    = sqldatareader.GetString(1);
                    LRNTextbox.Text       = sqldatareader.GetString(2);

                    FirstNameTextbox.Text  = sqldatareader.GetString(3);
                    MiddleNameTextbox.Text = sqldatareader.GetString(4);
                    LastNameTextbox.Text   = sqldatareader.GetString(5);

                    GradeLevelDropdown.Clear();
                    GradeLevelDropdown.AddItem(sqldatareader.GetString(6));
                    GradeLevelDropdown.selectedIndex = 0;

                    SectionDropdown.Clear();
                    SectionDropdown.AddItem(sqldatareader.GetString(7));
                    SectionDropdown.selectedIndex = 0;

                    Gender = sqldatareader.GetString(8);
                    if (Gender.Equals("Male"))
                    {
                        GenderDropdown.selectedIndex = 0;
                    }

                    else
                    {
                        GenderDropdown.selectedIndex = 1;
                    }

                    BirthDate             = string.Format("{0:d}", sqldatareader.GetString(9));
                    BirthDatepicker.Value = DateTime.Parse(BirthDate);

                    PresentAddressTextbox.Text = sqldatareader.GetString(10);
                    PlaceOfBirthTextbox.Text   = sqldatareader.GetString(11);
                    BloodTypeTextbox.Text      = sqldatareader.GetString(12);

                    ReligionTextbox.Text        = sqldatareader.GetString(13);
                    IndiginousGroupTextbox.Text = sqldatareader.GetString(14);
                    EmailAddressTextbox.Text    = sqldatareader.GetString(15);
                    MobileNumberTextbox.Text    = sqldatareader.GetString(16);
                }
                sqldatareader.Close();
            }

            catch (Exception)
            {
                //DON'T DO ANYTHING SHIT !
            }
        }