private void alllocateButton_Click(object sender, RoutedEventArgs e) { try { if (selectedEqID != "" && selected_allocation_id != "") { string transportCost = ""; EnterTransportationCost nn = new EnterTransportationCost(); nn.ShowDialog(); if (nn.DialogResult.Value) { transportCost = nn.trCost; } string resp = DBManager.InsertIntoAllocationTable("('" + selected_allocation_id + "','" + selectedEqID + "','" + fromSiteID + "','" + toSiteID + "','" + transportCost + "')"); if (resp.Contains("Success")) { myMessageBox mm = new myMessageBox("Successfully allocated. Waiting for OM approval", "Success", "OK", 0); mm.ShowDialog(); // MessageBox.Show("Successfully Allocated waiting for OM approval", "Success", MessageBoxButton.OK, MessageBoxImage.Information); eqAll.Clear(); } else { myMessageBox mm = new myMessageBox("Allocation Failed!\n Maybe the selected equipment id was already allocated to this project", "Error", "OK", 1); mm.ShowDialog(); // MessageBox.Show("", "Error", MessageBoxButton.OK, MessageBoxImage.Error); eqAll.Clear(); } } } catch { } }