}//Load the Packages private void frmAddPackage_Load(object sender, EventArgs e) { loadList(); //Populate the comboboxes Placeholder_Service_List = S_L.ViewServices(); Placeholder_SLA_List = SLA_L.ViewSLA(); Placeholder_EQC_List = EQC_L.viewEquiptmentCatagory(); foreach (Service S in S_L.ViewServices()) { cmbPService.Items.Add("Service ID: " + S.Id.ToString() + " " + S.Description); } foreach (ServiceLevelAgreement S in SLA_L.ViewSLA()) { cmbPSLA.Items.Add("SLA ID: " + S.Id.ToString() + " " + S.Description); } foreach (EquipmentCategory EC in EQC_L.viewEquiptmentCatagory()) { cbxEquitptmentCatagory.Items.Add("EQC Name: " + EC.Name); } }//Load the listof packages
}//load packages private void frmEditPackages_Load(object sender, EventArgs e) { loadPackages(); //populate the comboboxes Placeholder_Service_List = S_L.ViewServices(); Placeholder_SLA_List = SLA_L.ViewSLA(); foreach (Service S in S_L.ViewServices()) { cmbPService.Items.Add("Service ID: " + S.Id.ToString() + " " + S.Description); } foreach (ServiceLevelAgreement S in SLA_L.ViewSLA()) { cmbPSLA.Items.Add("SLA ID: " + S.Id.ToString() + " " + S.Description); } }//Populate Combo boxes and load list of packages
}//Show the add service form public void LoadServices() { List_Of_Services_Ob = Sl.ViewServices(); foreach (Service S in List_Of_Services_Ob) { ListViewItem lst = new ListViewItem(new string[] { S.Id.ToString(), S.Description, S.ExpectedDuration.ToString() }); lst.Tag = S; lstServiceView.Items.Add(lst); } }//Load the Services into the list view when form loads
} //Update service void loadList() { // Display the services List_Of_Services_Ob = Sl.ViewServices(); foreach (Service S in List_Of_Services_Ob) { ListViewItem lst = new ListViewItem(new string[] { S.Id.ToString(), S.Description, S.ExpectedDuration.ToString() }); lst.Tag = S; } }//Load the services from Service logic