Exemplo n.º 1
0
        }//End of Load

        public List <Assesment> Load2()
        {
            try
            {
                using (MySqlConnection con = new MySqlConnection(GOCSystem2018.Config.GetConnectionString()))
                {
                    con.Open();

                    string sql = "SELECT * FROM stud_registration WHERE stud_regNo =@studRegistrationNo";

                    MySqlCommand cmd = new MySqlCommand(sql, con);
                    cmd.Parameters.AddWithValue("studRegistrationNo", studRegistrationNo);

                    MySqlDataReader reader = cmd.ExecuteReader();

                    //loop while have record
                    while (reader.Read())
                    {
                        //instantiate model
                        Assesment assesment = new Assesment();

                        //prepare properties
                        assesment.id                 = Convert.ToInt32(reader["id"].ToString());
                        assesment.studLRN            = reader["stud_LRN"].ToString();
                        assesment.studGOCNo          = reader["stud_GOCNo"].ToString();
                        assesment.studRegistrationNo = reader["stud_regNo"].ToString();

                        assesment.studLastName   = reader["stud_lastName"].ToString();
                        assesment.studFirstName  = reader["stud_firstName"].ToString();
                        assesment.studMiddleName = reader["stud_middleName"].ToString();

                        assesment.studGradeLevel = reader["stud_grade_level"].ToString();
                        assesment.studType       = reader["stud_type"].ToString();
                        assesment.studCourse     = reader["stud_course"].ToString();
                        assesment.studStrand     = reader["stud_strand"].ToString();

                        assesment.studAcadTrack   = reader["stud_acad_track"].ToString();
                        assesment.studDateOfBirth = reader["stud_date_of_birth"].ToString();
                        assesment.studGender      = reader["stud_gender"].ToString();
                        assesment.studBirthPlace  = reader["stud_birth_place"].ToString();
                        assesment.studAddress1    = reader["stud_address1"].ToString();
                        assesment.studGradeLevel  = reader["stud_grade_level"].ToString();

                        assesment.reqPSA           = reader["req_BC"].ToString();
                        assesment.reqForm138       = reader["req_form138"].ToString();
                        assesment.reqDrugTest      = reader["req_drug_test"].ToString();
                        assesment.reqAdmissionTest = reader["req_entrance_exam"].ToString();

                        //add object to list
                        assesments.Add(assesment);
                    }
                }
            }
            catch (MySqlException ex)
            {
                MessageBox.Show("ERROR : " + ex.Message.ToString(), "GOCINFOSYS", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            return(assesments);
        }//End of Load
Exemplo n.º 2
0
        /// <summary>
        /// not working
        /// </summary>
        /// <returns></returns>
        public List <Assesment> GetByRegNo1()
        {
            try
            {
                //prepare connection string
                using (MySqlConnection con = new MySqlConnection(GOCSystem2018.Config.GetConnectionString()))
                {
                    //try to open connection
                    con.Open();

                    //prepare sql query
                    string sql = "SELECT * FROM stud_registration WHERE stud_regNo =@studRegistrationNo;";

                    MySqlCommand cmd = new MySqlCommand(sql, con);

                    cmd.Parameters.AddWithValue("studRegistrationNo", studRegistrationNo);

                    MySqlDataReader reader = cmd.ExecuteReader();

                    //loop while have record
                    while (reader.Read())
                    {
                        //instantiate model
                        Assesment assesment = new Assesment();

                        //prepare properties
                        //assesment.id = Convert.ToInt32(reader["id"].ToString());
                        assesment.studRegistrationNo = reader["stud_regNo"].ToString();
                        //assesment.studLastName = reader["stud_lastName"].ToString();

                        assesments.Add(assesment);
                    }
                }
            }
            catch (MySqlException ex)
            {
                MessageBox.Show("ERROR : " + ex.Message.ToString(), "System Message", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            return(assesments);
        }
Exemplo n.º 3
0
        public List <Assesment> LoadStudNo()
        {
            try
            {
                //prepare connection string
                using (MySqlConnection con = new MySqlConnection(GOCSystem2018.Config.GetConnectionString()))
                {
                    //try to open connection
                    con.Open();

                    //prepare sql query
                    string sql = "SELECT * FROM stud_registration;";


                    MySqlCommand cmd = new MySqlCommand(sql, con);

                    MySqlDataReader reader = cmd.ExecuteReader();

                    //loop while have record
                    while (reader.Read())
                    {
                        //instantiate model
                        Assesment assesment = new Assesment();

                        //prepare properties
                        assesment.studRegistrationNo = reader["stud_GOCNo"].ToString();

                        assesments.Add(assesment);
                    }
                }
            }
            catch (MySqlException ex)
            {
                MessageBox.Show("ERROR : " + ex.ToString(), "System Message", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            return(assesments);
        }
Exemplo n.º 4
0
        public void passValue()
        {
            Assesment assesment = new Assesment();

            assesments.Add(assesment);
        }