Ejemplo n.º 1
0
        private void saveButton_Click(object sender, EventArgs e)
        {
            saved = true;
            Registration r = rcc.getRegistration();

            rcc.getRegistration().setID(studentID.Text);
            string result = "ID: " + r.getID() + Environment.NewLine + "Courses: " + r.getCourses()
                            + Environment.NewLine + "Grand Total: " + r.getGrandTotal().ToString();

            MessageBox.Show(result, "Details", MessageBoxButtons.OK, MessageBoxIcon.Information);
            PersistenceFacade.getInstance().put(rcc.getRegistration());
        }
Ejemplo n.º 2
0
        public static PersistenceFacade getInstance()
        {
            Object sync = new object();

            lock (sync)
            {
                if (instance == null)
                {
                    instance = new PersistenceFacade();
                }
            }
            return(instance);
        }
Ejemplo n.º 3
0
        private void fetchButton_Click(object sender, EventArgs e)
        {
            Registration temp = new Registration();
            Registration r    = PersistenceFacade.getInstance().get(studentID.Text, temp) as Registration;

            if (r == null)
            {
                MessageBox.Show("No previous record found!", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            string result = "ID: " + r.getID() + Environment.NewLine + "Courses: " + r.ObtainedCourses()
                            + Environment.NewLine + "Grand Total: " + r.getGT().ToString();

            MessageBox.Show(result, "Details", MessageBoxButtons.OK, MessageBoxIcon.Information);
        }
Ejemplo n.º 4
0
        private void button1_Click(object sender, EventArgs e)
        {
            Course c = new Course();

            c.setId(idText.Text);
            c.setTitle(titleText.Text);
            int temp;

            int.TryParse(creditText.Text, out temp);
            c.setCredit(temp);
            int.TryParse(tpcText.Text, out temp);
            c.setTuitionPerCredit(temp);
            c.setProgram(comboBox1.Text);

            DepttProgram dp = new DepttProgram(idText.Text, titleText.Text, comboBox1.Text);

            PersistenceFacade.getInstance().put(c);
            PersistenceFacade.getInstance().put(dp);

            update();
        }