Esempio n. 1
0
 public static Customer CreatCustomer(String nameFirst, String nameLast, String homeAddress, String phoneNumber, String emailAddress,
     long idNumber, int permissionLevel, String DateJoined, String MDClernsExpiration,TrainingProgram traningProgram , int Class_Miss)
 {
     Customer newCustomer = new Customer(nameFirst, nameLast, homeAddress, phoneNumber, emailAddress, idNumber, permissionLevel, DateJoined, MDClernsExpiration , Class_Miss);
     newCustomer.addTraningProgram(traningProgram);
     return newCustomer;
 }
Esempio n. 2
0
        private void buttonSearch_Click(object sender, EventArgs e)
        {

            if (!validateID()) { return; }

            customerObject = dbcObject.getCusomerById(Convert.ToInt32(textBoxID.Text));

            if (customerObject == null)
            {
                MessageBox.Show("No user with this id number");
                textBoxID.Text = "";
                return;
            }

            if (this.requetsType == "Add")
            {
                // Creat New Training Program with First Free workoutID
                long workoutID = customerObject.getListTrainingPrograms().Count;
                selectedTrp = new TrainingProgram(workoutID, new List<Exercise>());
                // Add The New (Empty) Traning Program To Customer
                customerObject.addTraningProgram(selectedTrp);
            }

            else
            { // Request type is Edit
                buttonSearch.Enabled = false;
                // Get Customers Existing Traning Programs
                listTrainingPrograms = customerObject.getListTrainingPrograms();
                foreach (TrainingProgram trp in listTrainingPrograms)
                {
                    comboBoxTraningPrograms.Items.Add(trp.getWorkoutID());
                }
            }
            // Show Panels
            panelEditExercise.Visible = true;
            panelMainDisplay.Visible = true;
        }