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();
        }
        //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;
        }
Beispiel #3
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;
            }
        }
        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;
        }
Beispiel #5
0
        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;
        }
Beispiel #6
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;
            }
        }
Beispiel #7
0
        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);
            }
        }
Beispiel #8
0
        public BuatResep(string kode_resep)
        {
            InitializeComponent();
            conn = DBConnection.dbConnection();
            cmd  = new DBCommand(conn);
            sp   = new SmartCardOperation();

            var apoteker = cmd.GetDataApoteker().ToList().First();

            lbApoteker.Content += "\t" + apoteker.nama;

            this.kode_resep = kode_resep;
            DisplayData(kode_resep);
        }
Beispiel #9
0
        public MainWindow()
        {
            InitializeComponent();
            sp = new SmartCardOperation();

            var userPrefs = new UserPreferences();

            Height      = userPrefs.WindowHeight;
            Width       = userPrefs.WindowWidth;
            Top         = userPrefs.WindowTop;
            Left        = userPrefs.WindowLeft;
            WindowState = userPrefs.WindowState;
            CheckRole();
        }
Beispiel #10
0
        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 MainWindow()
        {
            InitializeComponent();
            sp = new SmartCardOperation();

            //MessageBox.Show(Properties.Settings.Default.IDStaff);
            //MessageBox.Show(Application.Current.Windows.Count.ToString());

            var userPrefs = new UserPreferences();

            Height      = userPrefs.WindowHeight;
            Width       = userPrefs.WindowWidth;
            Top         = userPrefs.WindowTop;
            Left        = userPrefs.WindowLeft;
            WindowState = userPrefs.WindowState;
        }
        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);
            }
        }
Beispiel #13
0
        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);
            }
        }
Beispiel #14
0
        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;
        }
Beispiel #15
0
        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;
        }
Beispiel #16
0
        public BuatResep()
        {
            InitializeComponent();
            conn = DBConnection.dbConnection();
            cmd  = new DBCommand(conn);
            sp   = new SmartCardOperation();

            var apoteker = cmd.GetDataApoteker().ToList().First();

            lbApoteker.Content += "\t" + apoteker.nama;

            //MessageBox.Show(cmd.GetKodeResepByRm("RM00"));

            try
            {
                clientApotik = new SimpleTcpClient();
                clientApotik.Connect(Settings.Default.SocketAntriApotik,
                                     Settings.Default.PortAntriApotik);
                clientApotik.DataReceived += ClientApotik_DataReceived;
            }
            catch (Exception)
            {
            }
        }