public int RemoveEvent(string searchId) { SqlConnection connection = new SqlConnection("Server=Tanmoy-PC; Database=Wedding Management; User Id=sa; Password=1238628257"); connection.Open(); SqlCommand del = new SqlCommand("DELETE FROM EventList WHERE EventId LIKE '" + searchId + "'", connection); int i = del.ExecuteNonQuery(); connection.Close(); CenterService cs = new CenterService(); cs.UpdateCenterStatus(searchId, "Available"); return(i); }
private void printButton_Click(object sender, RoutedEventArgs e) { System.Windows.Controls.PrintDialog prnt = new System.Windows.Controls.PrintDialog(); if (prnt.ShowDialog() == true) { prnt.PrintVisual(FullPaymentInvoiceGrid, "Printing Grid"); } EventService Es = new EventService(); Es.UpdateEventList(eventIdBox.Text, GienMoneyBox.Text, retunMoneyBox.Text); CenterService cs = new CenterService(); cs.UpdateCenterStatus(eventIdBox.Text, "Available"); EventCalculation.returnMoney = ""; EventCalculation.givenMoney = ""; EventCalculation.returnMoney = ""; EventCalculation.centerId = ""; EventCalculation.eventId = ""; this.Close(); }