private static void Main(string[] args) { so = new SmartCardOperation(); if (so.IsReaderAvailable()) { so.isoReaderInit(); var user = Util.ToArrayByte16("ADM001"); var pass = Util.ToArrayByte32(Encryptor.MD5Hash("ADM001")); if (so.WriteBlock(Msb, BlockUsername, user)) { //Console.WriteLine(user.ToString()); Console.WriteLine(Util.ToASCII(so.ReadBlock(Msb, BlockUsername), 0, user.Length)); } if (so.WriteBlockRange(Msb, BlockPasswordFrom, BlockPasswordTo, pass)) { Console.WriteLine(Util.ToASCII(so.ReadBlockRange(Msb, BlockPasswordFrom, BlockPasswordTo), 0, pass.Length)); } } else { Console.WriteLine("Reader not available"); } Console.ReadLine(); }
public TambahDokter(DaftarDokter du) { InitializeComponent(); conn = DBConnection.dbConnection(); cmd = new DBCommand(conn); sp = new SmartCardOperation(); dd = du; DataContext = new MDokter(" ", " ", " ", " ", " ", " "); //DataContext = new MDaftarBaru("123", "123", "ad", "123", " 123123"); if (sp.IsReaderAvailable()) { } else { MessageBox.Show("Tidak ada reader tersedia, pastikan reader sudah terhubung dengan komputer.", "Error", MessageBoxButton.OK, MessageBoxImage.Error); } var cbp = cmd.GetDataPoliklinik(); cbPoliklinik.DisplayMemberPath = "nama_poliklinik"; cbPoliklinik.SelectedValuePath = "kode_poliklinik"; cbPoliklinik.ItemsSource = cbp; cbPoliklinik.SelectedIndex = 0; }
public UbahStaffPendaftaran(string id, string nama, string alamat, string telp, string jenisK, DaftarPendaftaran df) { InitializeComponent(); DataContext = new MPendaftaran(id, nama, alamat, telp, " ", jenisK); sp = new SmartCardOperation(); conn = DBConnection.dbConnection(); cmd = new DBCommand(conn); if (sp.IsReaderAvailable()) { } else { MessageBox.Show("Tidak ada reader tersedia, pastikan reader sudah terhubung dengan komputer.", "Error", MessageBoxButton.OK, MessageBoxImage.Error); } this.df = df; if (jenisK == "Pria") { cbJenisKelamin.SelectedIndex = 0; } else if (jenisK == "Wanita") { cbJenisKelamin.SelectedIndex = 1; } }
//private Socket sck2; #region constructor public daftar_berobat() { InitializeComponent(); conn = DBConnection.dbConnection(); var cmd = new DBCommand(conn); sp = new SmartCardOperation(); try { sck = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); sck.Connect(Settings.Default.SocketServerAntrianPoli, Settings.Default.SocketPortAntriaPoli); } catch (Exception) { //MessageBox.Show("Apliasi antrian tidak aktif, pastikan aplikasi antrian aktif.", "Warning", MessageBoxButton.OK, MessageBoxImage.Warning); } if (sp.IsReaderAvailable()) { } else { MessageBox.Show("Tidak ada reader tersedia, pastikan reader sudah terhubung dengan komputer.", "Error", MessageBoxButton.OK, MessageBoxImage.Error); } var cbp = cmd.GetPoliklinik(); cbPoliklinik.DisplayMemberPath = "kode_poliklinik"; cbPoliklinik.SelectedValuePath = "nama_poliklinik"; cbPoliklinik.ItemsSource = cbp; cbPoliklinik.SelectedIndex = 0; }
public UbahApoteker(string id, string nama, string alamat, string no_telp, string jenisK, DaftarApoteker ua) { InitializeComponent(); conn = DBConnection.dbConnection(); cmd = new DBCommand(conn); sp = new SmartCardOperation(); if (sp.IsReaderAvailable()) { } else { MessageBox.Show("Tidak ada reader tersedia, pastikan reader sudah terhubung dengan komputer.", "Error", MessageBoxButton.OK, MessageBoxImage.Error); } DataContext = new MApoteker(id, nama, no_telp, alamat, " "); da = ua; if (jenisK == "Pria") { cbJenisKelamin.SelectedIndex = 0; } else if (jenisK == "Wanita") { cbJenisKelamin.SelectedIndex = 1; } }
public UpdateKeuangan(DaftarKeuangan dk, ModelKeuangan ku) { InitializeComponent(); conn = DBConnection.dbConnection(); cmd = new DBCommand(conn); this.dk = dk; sp = new SmartCardOperation(); if (sp.IsReaderAvailable()) { } else { MessageBox.Show("Tidak ada reader tersedia, pastikan reader sudah terhubung dengan komputer.", "Error", MessageBoxButton.OK, MessageBoxImage.Error); } DataContext = new ModelKeuangan(ku.id, ku.nama, ku.telp, ku.jenis_kelamin, ku.password, ku.alamat); if (ku.jenis_kelamin == "Pria") { cbJenisKelamin.SelectedIndex = 0; } else if (ku.jenis_kelamin == "Wanita") { cbJenisKelamin.SelectedIndex = 1; } DataContext = ku; }
private void btnBrowseResep_Click(object sender, RoutedEventArgs e) { var cntAntrian = cmd.CountAntrianApotik(); if (cntAntrian >= 1) { if (chkScanKartu.IsChecked ?? true) { if (sp.IsReaderAvailable()) { try { sp.isoReaderInit(); var readData = sp.ReadBlock(0x00, blockRekamMedis); var asciiData = ""; if (readData != null) { asciiData = Util.ToASCII(readData, 0, 16, false); } Debug.WriteLine(asciiData); kode_resep = cmd.GetKodeResepByRm(asciiData); Debug.WriteLine($"Kode resep: {kode_resep}"); DisplayData(kode_resep); } catch (Exception) { MessageBox.Show( "Pastikan reader sudah terpasang dan kartu sudah berada pada jangkauan reader.", "Error", MessageBoxButton.OK, MessageBoxImage.Error); sp.isoReaderInit(); } } else { MessageBox.Show("Tidak ada reader tersedia, pastikan reader sudah terhubung dengan komputer.", "Error", MessageBoxButton.OK, MessageBoxImage.Error); } } else { kode_resep = cmd.GetKodeResepByNoUrut(); DisplayData(kode_resep); } } else { MessageBox.Show("Tidak ada data antrian pasien.", "Informasi", MessageBoxButton.OK, MessageBoxImage.Information); } }
private void BtnBrowsePasien_Click(object sender, RoutedEventArgs e) { if (cmd.CountDataAntrian() >= 1) { if (chkScanKartu.IsChecked ?? true) { sp = new SmartCardOperation(); if (sp.IsReaderAvailable()) { try { sp.isoReaderInit(); //card = new MifareCard(isoReader); var readData = sp.ReadBlock(Msb, blockNoRekamMedis); Debug.WriteLine(Util.ToASCII(readData, 0, 16, false)); if (readData != null) { no_rm = Util.ToASCII(readData, 0, 16, false); } DisplayDataPasien(no_rm); } catch (Exception) { MessageBox.Show( "Pastikan reader sudah terpasang dan kartu sudah berada pada jangkauan reader.", "Error", MessageBoxButton.OK, MessageBoxImage.Error); sp.isoReaderInit(); } } else { MessageBox.Show("Tidak ada reader tersedia, pastikan reader sudah terhubung dengan komputer.", "Error", MessageBoxButton.OK, MessageBoxImage.Error); } } else { no_rm = cmd.GetNoRmByNoUrut(); DisplayDataPasien(no_rm); } } else { MessageBox.Show("Tidak ada data antrian pasien.", "Informasi", MessageBoxButton.OK, MessageBoxImage.Information); } }
public DaftarKeuangan() { InitializeComponent(); sp = new SmartCardOperation(); LoadData(); if (!sp.IsReaderAvailable()) { MessageBox.Show("Tidak ada reader tersedia, pastikan reader sudah terhubung dengan komputer.", "Error", MessageBoxButton.OK, MessageBoxImage.Error); } }
public TambahKeuangan(DaftarKeuangan dk) { InitializeComponent(); conn = DBConnection.dbConnection(); cmd = new DBCommand(conn); this.dk = dk; DataContext = _mDaftarBaru; sp = new SmartCardOperation(); if (!sp.IsReaderAvailable()) { MessageBox.Show("Tidak ada reader tersedia, pastikan reader sudah terhubung dengan komputer.", "Error", MessageBoxButton.OK, MessageBoxImage.Error); } }
public daftar_ulang() { InitializeComponent(); conn = DBConnection.dbConnection(); DisplayDataPasien(); sp = new SmartCardOperation(); if (sp.IsReaderAvailable()) { } else { MessageBox.Show("Tidak ada reader tersedia, pastikan reader sudah terhubung dengan komputer.", "Error", MessageBoxButton.OK, MessageBoxImage.Error); } }
public UbahDokter(string id, string nama, string telp, string alamat, string spesialisasi, string jenisK, string kodepoli, DaftarDokter dd) { InitializeComponent(); conn = DBConnection.dbConnection(); cmd = new DBCommand(conn); sp = new SmartCardOperation(); DataContext = new MDokter(id, nama, telp, spesialisasi, alamat, " "); var cbp = cmd.GetDataPoliklinik(); this.dd = dd; if (jenisK == "Pria") { cbJenisKelamin.SelectedIndex = 0; } else if (jenisK == "Wanita") { cbJenisKelamin.SelectedIndex = 1; } if (sp.IsReaderAvailable()) { } else { MessageBox.Show("Tidak ada reader tersedia, pastikan reader sudah terhubung dengan komputer.", "Error", MessageBoxButton.OK, MessageBoxImage.Error); } cbPoliklinik.DisplayMemberPath = "nama_poliklinik"; cbPoliklinik.SelectedValuePath = "kode_poliklinik"; cbPoliklinik.ItemsSource = cbp; //cbPoliklinik.SelectedIndex = 0; cbPoliklinik.Text = kodepoli; }
public daftar_baru() { InitializeComponent(); sp = new SmartCardOperation(); if (sp.IsReaderAvailable()) { } else { MessageBox.Show("Tidak ada reader tersedia, pastikan reader sudah terhubung dengan komputer.", "Error", MessageBoxButton.OK, MessageBoxImage.Error); } conn = DBConnection.dbConnection(); DataContext = new MDaftarBaru(" ", " ", " ", " ", " "); conn = DBConnection.dbConnection(); try { clientPoli = new SimpleTcpClient(); clientPoli.Connect(Settings.Default.SocketServerAntrianPoli, Settings.Default.SocketPortAntriaPoli); } catch (Exception ex) { MessageBox.Show(ex.Message); } var dbcmd = new DBCommand(conn); var cbp = dbcmd.GetPoliklinik(); cbPoliklinik.DisplayMemberPath = "kode_poliklinik"; cbPoliklinik.SelectedValuePath = "nama_poliklinik"; cbPoliklinik.ItemsSource = cbp; cbPoliklinik.SelectedIndex = 0; }
public Login() { InitializeComponent(); conn = DBConnection.dbConnection(); cmd = new DBCommand(conn); var readers = GetReaders(); //MessageBox.Show(Properties.Settings.Default.IDStaff); if (sp.IsReaderAvailable()) { } else { MessageBox.Show("Tidak ada reader tersedia, pastikan reader sudah terhubung dengan komputer.", "Error", MessageBoxButton.OK, MessageBoxImage.Error); Close(); } var monitorFactory = MonitorFactory.Instance; subscription = monitorFactory.CreateObservable(SCardScope.System, readers) .Subscribe(onNext, onError); }