//By Klaus private void btn_Delete_Click(object sender, RoutedEventArgs e) { switch ((string)lbl_Title.Content) { case "Job": { Job chosenJob = new Job(); chosenJob.DeleteJob(SelectedTemp.ChosenJob.JobID); } break; case "User": { User chosenUser = new User(); chosenUser.DeleteUser(SelectedTemp.ChosenUser.UserID); } break; case "Tarif": { Tarif chosenTarif = new Tarif(); chosenTarif.Delete(SelectedTemp.ChosenTarif.TarifID); } break; case "ESP": { ESP chosenESP = new ESP(); chosenESP.Delete(SelectedTemp.ChosenESP.ESP_ID); } break; case "Resource": { Resource chosenResource = new Resource(); chosenResource.DeleteResource(SelectedTemp.ChosenR.ResourceID); } break; case "Resource type": { ResourceType chosenType = new ResourceType(); chosenType.Delete(SelectedTemp.ChosenRT.ResourceTypeID); } break; default: break; } Show returnWindow = new Show(); returnWindow.Show(); this.Close(); }
private void Btn_Edit_Click(object sender, RoutedEventArgs e) { if ((string)lbl_Title.Content == "Job") { Job.Editing = true; Job chosenJob = new Job(); chosenJob.EditJobShow(SelectedTemp.ChosenJob.JobID, SelectedTemp.ChosenJob.CreatedUserID); Job.EditingJobID = SelectedTemp.ChosenJob.JobID; Job.EditingJobUserID = SelectedTemp.ChosenJob.CreatedUserID; } // done else if ((string)lbl_Title.Content == "User") { User.Editing = true; User chosenUser = new User(); UserO selectedUser = SelectedTemp.ChosenUser; chosenUser.EditUserShow(selectedUser.UserID); User.EditUserID = selectedUser.UserID; } else if ((string)lbl_Title.Content == "Tarif") { Tarif.editing = true; Tarif.editingTarifID = SelectedTemp.ChosenTarif.TarifID; Tarif.EditShow(SelectedTemp.ChosenTarif.Cost, SelectedTemp.ChosenTarif.StartTime, SelectedTemp.ChosenTarif.EndTime, SelectedTemp.ChosenTarif.TarifID); } else if ((string)lbl_Title.Content == "ESP") { ESP.editing = true; ESP.editingESPID = SelectedTemp.ChosenESP.ESP_ID; ESP.EditShow(SelectedTemp.ChosenESP.ESP_ID); } else if ((string)lbl_Title.Content == "Resource") { Resource.EditResourceShow(SelectedTemp.ChosenR.ResourceID); Resource.editing = true; Resource.editingResourceID = SelectedTemp.ChosenR.ResourceID; } else if ((string)lbl_Title.Content == "Resource type") { ResourceType.EditShow(SelectedTemp.ChosenRT.ResourceTypeID); ResourceType.editing = true; ResourceType.EditResourceTypeID = SelectedTemp.ChosenRT.ResourceTypeID; } }
// skal kun kunne ses af admin private void Button_Click(object sender, RoutedEventArgs e) { Tarif CT = new Tarif(); CT.ShowDialog(); }
public static void EditShow(double cost, TimeSpan start, TimeSpan End, int ID) { Tarif nw = new Tarif(); nw.Show(); }