public void ReloadOBForm() { SiteClass site = new SiteClass(); OfficerClass officer = new OfficerClass(); ConstantClass.ToStringType = "OBCombo"; OBEntry.PopulateOBList(); lblReturnOBnumber.Text = OBEntry.GetNewReturnOBNumber(); cmbSite.DataSource = site.GetSiteData(); cmbOfficer.DataSource = officer.GetOfficerData(); txtTime.Text = DateTime.Now.ToString("HH:mm:ss"); txtDate.Text = DateTime.Now.ToString("dd/MM/yyyy"); txtOBNumber.Text = personClassAdminForm.PSiRA; txtOccurenceNote.Text = ""; cmbOccurence.SelectedIndex = -1; cmbOfficer.SelectedIndex = -1; cmbShift.SelectedIndex = -1; cmbSite.SelectedIndex = -1; txtOBNumber.Enabled = true; txtOccurenceNote.Enabled = true; cmbOccurence.Enabled = true; cmbOfficer.Enabled = true; cmbShift.Enabled = true; cmbSite.Enabled = true; btnLogEntry.Text = "Log Occurrence"; }
private void lstOfficers_SelectedIndexChanged(object sender, EventArgs e) { if (lstOfficers.SelectedIndex != -1) { OfficerClass officer = (OfficerClass)lstOfficers.SelectedItem; txtOfficerPSiRA.Text = officer.PSiRA; txtOfficerPSiRA.Enabled = false; txtOfficerName.Text = officer.Name; txtOfficerSurname.Text = officer.Surname; txtOfficerConNum.Text = officer.ContactNumber; int index = 0; foreach (SiteClass item in cmbOfficerSiteName.Items) { if (item.Callsighn == officer.Site) { cmbOfficerSiteName.SelectedIndex = index; } index++; } btnLogOfficer.Text = "Update Officer"; } }