private void btnSelesai_Click(object sender, RoutedEventArgs e) { var total = 0; foreach (ModelDetailResep dr in dtgDetailResep.ItemsSource) { total += dr.sub_total; } //MessageBox.Show(total.ToString()); if (cmd.CreateTransactionResep(Settings.Default.KodeApoteker, txtKodeResep.Text, total)) { if (cmd.UpdateStatusAntrianApotik(kode_resep)) { try { clientApotik.WriteLine("Update"); } catch (Exception) { } ClearData(); } } }