private void TransaksiPembelian_Loaded(object sender, RoutedEventArgs e) { DataTable dt = Kenko.getData("sp_Kategori_Read", ""); listKategori.ItemsSource = dt.DefaultView; listKategori.DisplayMemberPath = "nama_kategori"; listKategori.SelectedValuePath = "id_kategori"; dtKeranjang = new DataTable(); dtKeranjang.Columns.Add("id_obat"); dtKeranjang.Columns.Add("nama_obat"); dtKeranjang.Columns.Add("tgl_exp"); dtKeranjang.Columns.Add("jumlah"); dtKeranjang.Columns.Add("harga_total"); dtKeranjang.Columns.Add("harga_beli"); dtKeranjang.Columns.Add("harga_jual"); txtKasir.Text = "Samodra"; txtTglTransaksi.Text = DateTime.Now.ToString("dd-MM-yyyy"); DataTable dtSupplier = Kenko.getData("sp_Supplier_Read", ""); cmbSupplier.ItemsSource = dtSupplier.DefaultView; cmbSupplier.DisplayMemberPath = "nama_supplier"; cmbSupplier.SelectedValuePath = "id_supplier"; DataTable dtObat = Kenko.getData("sp_Obat_Read", ""); dataMaster.ItemsSource = dtObat.DefaultView; }
private void ClearForm() { txtIdObat.Text = ""; id_pasien = ""; id_reservasi = ""; txtNamaPasien.Text = ""; txtUmur.Text = ""; txtJenkel.Text = ""; txtGol.Text = ""; txtKeluhan.Text = ""; txtPekerjaan.Text = ""; txtNamaObat.Text = ""; txtJumlahObat.Text = ""; txtSatuan.Text = ""; txtKeterangan.Text = ""; dtResep.Rows.Clear(); dataResep.ItemsSource = dtResep.DefaultView; DataTable dtReservasi = Kenko.getData("sp_Transaksi_Reservasi_GetData", id_dokter); dataReservasi.ItemsSource = dtReservasi.DefaultView; dataRiwayat.ItemsSource = new DataTable().DefaultView; DataTable dtObat = Kenko.getData("sp_Obat_Read", ""); dataObat.ItemsSource = dtObat.DefaultView; }
private void listKategori_SelectionChanged(object sender, SelectionChangedEventArgs e) { int index = listKategori.SelectedIndex; string idkategori = listKategori.SelectedValue.ToString(); SelectedMenuChange(index); dataMaster.ItemsSource = Kenko.getData("sp_Obat_GetKategori", idkategori).DefaultView; }
private void TransaksiReservasi_Loaded(object sender, RoutedEventArgs e) { dataMaster.ItemsSource = Kenko.getData("sp_Pasien_Read", "").DefaultView; cmbDokter.ItemsSource = Kenko.getData("sp_Dokter_Read", "").DefaultView; cmbDokter.SelectedValuePath = "id_dokter"; cmbDokter.DisplayMemberPath = "nama_dokter"; txtKasir.Text = Application.Current.Properties["nama"].ToString(); txtTglTransaksi.Text = DateTime.Now.ToString("dd-MM-yyyy"); lblAntrian.Text = Kenko.getAntrian(); }
private void cmbDokter_SelectionChanged(object sender, SelectionChangedEventArgs e) { DataTable dt = Kenko.getData("sp_Dokter_GetDokter", cmbDokter.SelectedValue.ToString()); if (dt.Rows.Count > 0) { txtSpesialisasi.Text = dt.Rows[0]["spesialisasi"].ToString(); lblNamaDokter.Content = dt.Rows[0]["nama_dokter"].ToString(); } else { MessageBox.Show("Data tidak ditemukan", "Gagal", MessageBoxButton.OK, MessageBoxImage.Error); } }
private void NewTransaksi() { dtKeranjang.Rows.Clear(); lblSubtotal.Content = 0; lblJumlahBarang.Content = 0; lblTotalPembayaran.Text = "0"; cmbSupplier.SelectedIndex = -1; string idkategori = listKategori.SelectedValue.ToString(); subtotal = 0; jumlahBarang = 0; dataMaster.ItemsSource = Kenko.getData("sp_Obat_GetKategori", idkategori).DefaultView; }
private void TransaksiPenjualan_Loaded(object sender, RoutedEventArgs e) { DataTable dt = Kenko.getData("sp_Kategori_Read", ""); cmbKategori.ItemsSource = dt.DefaultView; cmbKategori.DisplayMemberPath = "nama_kategori"; cmbKategori.SelectedValuePath = "id_kategori"; dtPenjualan = new DataTable(); dtPenjualan.Columns.Add("id_obat"); dtPenjualan.Columns.Add("nama_obat"); dtPenjualan.Columns.Add("jumlah"); dtPenjualan.Columns.Add("harga"); txtKasir.Text = Application.Current.Properties["nama"].ToString(); txtTglTransaksi.Text = DateTime.Now.ToString("dd-MM-yyyy"); }
private void NewTransaksi() { Baru(); dtPenjualan.Rows.Clear(); lblSubtotal.Content = 0; lblJumlahBarang.Content = 0; txtPoin.Text = ""; lblTotalPembayaran.Text = "0"; txtBayar.Text = ""; lblKembalian.Content = 0; btnBayar.IsEnabled = false; string idkategori = ""; subtotal = 0; jumlahBarang = 0; dataMaster.ItemsSource = Kenko.getData("sp_Obat_GetKategori", idkategori).DefaultView; }
private void TransaksiResep_Loaded(object sender, RoutedEventArgs e) { string id_dokter = Application.Current.Properties["id"].ToString(); DataTable dtReservasi = Kenko.getData("sp_Transaksi_Reservasi_GetData", id_dokter); dataReservasi.ItemsSource = dtReservasi.DefaultView; DataTable dtObat = Kenko.getData("sp_Obat_Read", ""); dataObat.ItemsSource = dtObat.DefaultView; dtResep = new DataTable(); dtResep.Columns.Add("id_obat"); dtResep.Columns.Add("nama_obat"); dtResep.Columns.Add("jumlah"); dtResep.Columns.Add("keterangan"); }
private void btnTambahReservasi_Click(object sender, RoutedEventArgs e) { DataRowView dataRowView = (DataRowView)((Button)e.Source).DataContext; id_pasien = dataRowView[4].ToString(); id_reservasi = dataRowView[1].ToString(); txtNamaPasien.Text = dataRowView[9].ToString(); txtJenkel.Text = dataRowView[10].ToString(); txtUmur.Text = dataRowView[16].ToString(); txtPekerjaan.Text = dataRowView[12].ToString(); txtGol.Text = dataRowView[11].ToString(); txtKeluhan.Text = dataRowView[6].ToString(); DataTable pasien = Kenko.getData("sp_Transaksi_Reservasi_GetPasien", id_pasien); dataRiwayat.ItemsSource = pasien.DefaultView; }
private void btnCariMember_Click(object sender, RoutedEventArgs e) { if (txtIdMember.Text == "") { MessageBox.Show("Isi ID Member terlebih dahulu.", "Gagal", MessageBoxButton.OK, MessageBoxImage.Error); } else { DataTable dt = Kenko.getData("sp_Member_GetMember", txtIdMember.Text); if (dt.Rows.Count > 0) { txtIdMember.IsReadOnly = true; txtNamaMember.Text = dt.Rows[0]["nama"].ToString(); txtJumlahPoin.Text = dt.Rows[0]["poin"].ToString(); txtPoin.IsEnabled = true; } else { MessageBox.Show("Data tidak ditemukan", "Gagal", MessageBoxButton.OK, MessageBoxImage.Error); } } }
private void btnSave_Click(object sender, RoutedEventArgs e) { if (!validateAll()) { MessageBox.Show("Data gagal disimpan", "Gagal", MessageBoxButton.OK, MessageBoxImage.Error); } else { SqlConnection connection = new SqlConnection(ConfigurationManager.AppSettings["ConString"]); SqlCommand cmd = new SqlCommand("sp_Pasien_Create", connection); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("nama_pasien", txtNamaPasien.Text); cmd.Parameters.AddWithValue("jenis_kelamin", Kenko.getJenkel(rdLaki)); cmd.Parameters.AddWithValue("tgl_lahir", Kenko.FormatLocalDate(txtTglLahir.Text)); cmd.Parameters.AddWithValue("alamat", txtAlamat.Text); cmd.Parameters.AddWithValue("no_telp", txtNoTelp.Text); cmd.Parameters.AddWithValue("golongan_darah", getGol()); cmd.Parameters.AddWithValue("pekerjaan", String.IsNullOrEmpty(txtPekerjaan.Text) ? DBNull.Value : (object)txtPekerjaan.Text); try { connection.Open(); cmd.ExecuteNonQuery(); MessageBox.Show("Data berhasil disimpan!", "Information", MessageBoxButton.OK, MessageBoxImage.Information); connection.Close(); ClearForm(); dataMaster.ItemsSource = Kenko.getData("sp_Pasien_Read", "").DefaultView; } catch (Exception ex) { MessageBox.Show("Data gagal disimpan : " + ex.Message, "Gagal", MessageBoxButton.OK, MessageBoxImage.Error); } } }
private void RefreshDataGrid(string cari = "") { dataMaster.ItemsSource = Kenko.getData("sp_User_Read", cari).DefaultView; }
private void cmbKategori_SelectionChanged(object sender, SelectionChangedEventArgs e) { string idkategori = cmbKategori.SelectedValue.ToString(); dataMaster.ItemsSource = Kenko.getData("sp_Obat_GetKategori", idkategori).DefaultView; }
private void RefreshDataGrid(string cari = "") { DataTable dtObat = Kenko.getData("sp_Obat_Read", cari); dataObat.ItemsSource = dtObat.DefaultView; }