예제 #1
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 !
            }
        }
        private void Retrieve_Section_List()
        {
            try
            {
                string localvariablestring = "SELECT * FROM [Tbl.AssignedSections] WHERE [TEACHER ID] = '" + TeacherID + "'";
                sqlcommand = new SqlCommand(localvariablestring, sqlconnection);
                SqlDataReader sqldatareader = sqlcommand.ExecuteReader();

                SectionDropdown.Clear();
                while (sqldatareader.Read())
                {
                    int index = 2;
                    for (int iterator = 0; iterator < 10; iterator++)
                    {
                        SectionDropdown.AddItem(sqldatareader.GetString(index));
                        index++;
                    }
                }

                SectionDropdown.selectedIndex = 0;
                sqldatareader.Close();

                try
                {
                    RemoveSpaceInSections();
                }

                catch (Exception)
                {
                    //DO NOTHING BITCH !
                }
            }

            catch (Exception)
            {
                //DO NOTHING BITCH !
            }
        }