public frmEditParent(String title, Parent ParentToEdit) { InitializeComponent(); this.Text = title; dbConnection = new Database(); isEdit = true; txtFirstName.Text = ParentToEdit.FirstName; txtLastName.Text = ParentToEdit.LastName; if (ParentToEdit.Gender == 'M') { cmbGender.Text = "Male"; } else if (ParentToEdit.Gender == 'F') { cmbGender.Text = "Female"; } editID = ParentToEdit.ParentID; txtTitle.Text = ParentToEdit.Title; txtHomePhone.Text = ParentToEdit.HomePhone; txtWorkPhone.Text = ParentToEdit.WorkPhone; txtMobilePhone.Text = ParentToEdit.MobilePhone; txtHomeAddress1.Text = ParentToEdit.HomeAddress.Address1; txtHomeCounty.Text = ParentToEdit.HomeAddress.County; txtHomePostCode.Text = ParentToEdit.HomeAddress.PostCode; txtHomeTown.Text = ParentToEdit.HomeAddress.City; txtWorkAddress1.Text = ParentToEdit.WorkAddress.Address1; txtWorkCounty.Text = ParentToEdit.WorkAddress.County; txtWorkPostCode.Text = ParentToEdit.WorkAddress.PostCode; txtWorkTown.Text = ParentToEdit.WorkAddress.City; }
public frmEditChild(Child childToEdit) { InitializeComponent(); dbConnection = new Database(); ChildToEdit = childToEdit; editing = true; txtFirstName.Text = ChildToEdit.FirstName; txtLastName.Text = ChildToEdit.LastName; txtExtra.Text = ChildToEdit.ExtraDays.ToString(); txtTeas.Text = ChildToEdit.Teas.ToString(); if (ChildToEdit.Gender == 'M' ) { cmbGender.Text = "Male"; } else if (ChildToEdit.Gender == 'F') { cmbGender.Text = "Female"; } cmbLanguage.Text = ChildToEdit.FirstLanguage; cmbRoom.Text = ChildToEdit.RoomAttending; dtpDOB.Value = ChildToEdit.DOB; if (ChildToEdit.DateLeft != new DateTime(0001, 1, 1, 0, 0, 0)) { dtpLeaveDate.Value = ChildToEdit.DateLeft; } dtpStartDate.Value = ChildToEdit.DateApplied; chk1.Checked = ChildToEdit.Attendance[0]; chk2.Checked = ChildToEdit.Attendance[1]; chk3.Checked = ChildToEdit.Attendance[2]; chk4.Checked = ChildToEdit.Attendance[3]; chk5.Checked = ChildToEdit.Attendance[4]; }
private void btnSave_Click(object sender, EventArgs e) { medicalToAdd.Allergies = txtAllergies.Text; medicalToAdd.Medication = txtMedication.Text; medicalToAdd.Other = txtOther.Text; medicalToAdd.Doctor = txtDocname.Text; medicalToAdd.DoctorAddress = constructAddress(); Database db = new Database(); db.insertAddress(medicalToAdd.DoctorAddress); db.insertMedical(medicalToAdd); }
public frmMainMenu() { InitializeComponent(); data = new DataContainer(); db = new Database(); childIDList = new List<int>(); staffIDList = new List<string>(); parentIDList = new List<int>(); contactIDList = new List<int>(); //data.loadItems(); }
public DataContainer() { dbConnection = new Database(); loadItems(); }
//private Employee createdEmployee; public frmEditEmployee() { InitializeComponent(); dbConnection = new Database(); }
public frmEditChild() { InitializeComponent(); dbConnection = new Database(); }
//private static Parent parent; //public static Parent AddedParent { get; set;} public frmEditParent(String title) { InitializeComponent(); this.Text = title; dbConnection = new Database(); }
public frmMainSearch() { InitializeComponent(); dbConnection = new Database(); }