Esempio n. 1
0
        private void button1_Click(object sender, EventArgs e)
        {
            fac.Clear();
            if (poolYes.Checked)
            {
                Facility f1 = new Facility(1, "Pool", true);
                fac.Add(f1);
            }

            if (saunaYes.Checked)
            {
                Facility f1 = new Facility(2, "Sauna", true);
                fac.Add(f1);
            }
            if (jakuziYes.Checked)
            {
                Facility f1 = new Facility(1, "Jacuzi", true);
                fac.Add(f1);
            }

            if (lockerYes.Checked)
            {
                Facility f1 = new Facility(1, "Lockers", true);
                fac.Add(f1);
            }
            if (radioButton1.Checked)
            {
                branch = new Branch(1, "Johar Town");
            }
            if (radioButton2.Checked)
            {
                branch = new Branch(2, "DHA");
            }
            refId = comboBox1.SelectedIndex;
            did   = comboBox2.SelectedIndex;
            exid  = comboBox3.SelectedIndex;

            if (feedbackTextField.Text == "")
            {
                var myForm = new Views.ErrorPop();
                myForm.Show();
                return;
            }
            Member      m     = new Member(Convert.ToInt32(textBox1.Text), textBox2.Text, textBox3.Text, textBox4.Text, textBox5.Text, textBox6.Text, textBox7.Text, Convert.ToDouble(textBox8.Text), Convert.ToDouble(textBox9.Text), textBox10.Text, textBox11.Text, textBox12.Text, refId, did, exid, fac, branch);
            FileManager fm    = new FileManager();
            Admin       admin = fm.ReadFromJsonFile <Admin>(Constants.Constants.adminFileName);

            admin.addMember(m);

            // Set FeedBack
            Feedback f = new Feedback(DateTime.Now, feedbackTextField.Text, m.ID);

            admin.setFeedback(f);

            // Set Medical History
            MedicalHistory mh = new MedicalHistory(m.ID, DateTime.Now, textBox10.Text, m.ID);

            admin.setMedicalHistory(mh);
        }
        private void Add_Click(object sender, EventArgs e)
        {
            if (textBox3.Text == "")
            {
                var myForm = new Views.ErrorPop();
                myForm.Show();
                return;
            }
            Excercise   ex    = new Excercise(Convert.ToInt32(textBox1.Text), textBox2.Text, Convert.ToInt32(textBox3.Text));
            FileManager fm    = new FileManager();
            Admin       admin = fm.ReadFromJsonFile <Admin>(Constants.Constants.adminFileName);

            admin.assignExcercise(ex);
        }
Esempio n. 3
0
        private void Add_Click(object sender, EventArgs e)
        {
            if (textBox4.Text == "")
            {
                var myForm = new Views.ErrorPop();
                myForm.Show();
                return;
            }
            Transaction t     = new Transaction(Convert.ToInt32(textBox1.Text), textBox2.Text, Convert.ToInt32(textBox3.Text), textBox4.Text);
            FileManager fm    = new FileManager();
            Admin       admin = fm.ReadFromJsonFile <Admin>(Constants.Constants.adminFileName);

            admin.makeTransactions(t);
        }
        private void add_Click(object sender, EventArgs e)
        {
            if (textBox8.Text == "")
            {
                var myForm = new Views.ErrorPop();
                myForm.Show();
                return;
            }
            Consultant  c     = new Consultant(Convert.ToInt32(textBox1.Text), textBox2.Text, textBox3.Text, textBox4.Text, textBox5.Text, textBox6.Text, Convert.ToInt32(textBox7.Text), textBox8.Text);
            FileManager fm    = new FileManager();
            Admin       admin = fm.ReadFromJsonFile <Admin>(Constants.Constants.adminFileName);

            admin.addConsultant(c);
        }