private void removeExpenseBtn_MouseDown(object sender, MouseButtonEventArgs e) { var idExpense = ((Image)sender).Uid; TripDAO.RemoveExpense(idTrip, idExpense); DisplayDetail(); DisplayCostChart(); MessageBox.Show("Đã xóa chi phí thành công.", "Thông báo"); }
private void editExpenseBtn_MouseDown(object sender, MouseButtonEventArgs e) { var idExpense = ((Image)sender).Uid; var expenseCurrent = TripDAO.GetExpenseById(idTrip, idExpense); var addExpenseDialog = new AddExpenseDialog(); addExpenseDialog.NewExpense = expenseCurrent; if (addExpenseDialog.ShowDialog() == true) { var newExpense = addExpenseDialog.NewExpense; TripDAO.RemoveExpense(idTrip, idExpense); TripDAO.InsertExpense(idTrip, newExpense); DisplayDetail(); DisplayCostChart(); MessageBox.Show("Đã cập nhật thành công!"); } }