private void viewProfileFrm_Load(object sender, EventArgs e)
        {
            StudentDAOImpl student = new StudentDAOImpl();

            Playground_frm loginForm = new Playground_frm();

            loggedStudentID = loginForm.returnID();
            MessageBox.Show(loggedStudentID.ToString() + " view");

            forenameVal.Text = student.read(34).getForename();
            surnameVal.Text = student.read(34).getSurname();
            dobVal.Text = student.read(34).getDOB();
            genderVal.Text = student.read(34).getGender();
            studentNumVal.Text = student.read(34).getStudentNumber();
        }
Exemplo n.º 2
0
        public School FindOne(int id)
        {
            OracleCommand command = new OracleCommand("Select * from Message where School.id=" + id + ")", Connection);

            OracleDataReader reader;
            reader = command.ExecuteReader();

            reader.Read();
            StudentDAOImpl studentDao = new StudentDAOImpl();

            List<Message> list = new List<Message>();

            School school = new School((int)reader.GetOracleNumber(0), reader.GetString(1), list);

            return school;
        }
        private void remStudent()
        {
            string studentIDAsString = studIDTxt.Text;

            int studentIDAsInt;
            Boolean isConvertable = false;
            isConvertable = Int32.TryParse(studentIDAsString, out studentIDAsInt);
            if (isConvertable == false)
            {
                MessageBox.Show("Field/s entered incorrectly ");
            }
            StudentDAOImpl student = new StudentDAOImpl();
            student.delete(studentIDAsInt);
            MessageBox.Show("This Student has been removed");
        }
        //Author: Niall Stack
        private void returnStudentValues()
        {
            string studentIDAsString = studIDTxt.Text;
            string forename = forenameTxt.Text;
            string surname = surnameTxt.Text;
            string dob = dobTxt.Text;
            string schoolIDAsString = SchoolIDTxt.Text;
            string groupIDAsString = groupIDTxt.Text;
            string gender = genderTxt.Text;
            string pictureColAsString = imgTxt.Text.Trim();
            string studentpassword = passwordTxt.Text;
            string studentNumber = studNumTxt.Text.Trim();
            string status = statusTxt.Text;

            int studentIDAsInt;
            int schoolIDAsInt;
            int groupIDAsInt;
            Byte[] pictureAsByte;
            Boolean isConvertable = false;
            isConvertable = Int32.TryParse(studentIDAsString, out studentIDAsInt);
            isConvertable = Int32.TryParse(schoolIDAsString, out schoolIDAsInt);
            isConvertable = Int32.TryParse(groupIDAsString, out groupIDAsInt);
            pictureAsByte = System.Text.Encoding.UTF8.GetBytes(pictureColAsString);
            if (isConvertable == false)
            {
                MessageBox.Show("Field/s entered incorrectly ");
            }

            StudentDAOImpl student = new StudentDAOImpl();
            student.create(studentIDAsInt, forename, surname, dob, schoolIDAsInt, groupIDAsInt, gender, pictureAsByte, studentpassword, studentNumber, status);
        }
Exemplo n.º 5
0
 public MessageDAO()
 {
     studentDao = new StudentDAOImpl();
     connec = new OracleConnection("Data Source=cp3dbinstance.c4pxnpz4ojk8.us-east-1.rds.amazonaws.com:1521/cp3db;" + "User ID=sw4 ;Password=sw4");
 }