public void save(Object sender, EventArgs e) { Medication newMew = new Medication (nameField.Text, medType: (Medication.MedicationTypes)(int)(medTypePicker.SelectedRowInComponent (0)), frequency: (int)freqStepper.Value, frequencyPeriod: (Medication.MedicationFrequency)(int)(freqPicker.SelectedRowInComponent (0)), pharmacyAddress: pharmacyTextField.Text); List<Medication> medList = new List<Medication> (petController.pet.medications); medList.Add (newMew); petController.pet.medications = medList.ToArray (); NavigationController.PopViewController (true); }
public Pet(string name, UIImage profilePicture = null, string breed = "", NSDate birthday = null, double weight = -1, string bodyColor = "", string eyeColor = "", double height = -1.0, double length = -1.0, string[] identifyingMarks = null, string idBrand = "", string idNumber = "", string notes = "", string[] allergies = null, string[] medicalConditions = null, string medicalOtherInfo = "", string[] vetNames = null, Medication[] medications = null ) { this.name = name; this.profilePicture = profilePicture; this.breed = breed; this.birthday = birthday; this.weight = weight; this.bodyColor = bodyColor; this.eyeColor = eyeColor; this.height = height; this.length = length; this.identifyingMarks = identifyingMarks ?? new string[0]; this.idBrand = idBrand; this.idNumber = idNumber; this.notes = notes; this.allergies = allergies ?? new string[0]; this.medicalConditions = medicalConditions ?? new string[0]; this.medicalOtherInfo = medicalOtherInfo; this.vetNames = vetNames ?? new string[0]; this.medications = (medications ?? new Medication[0]); }