コード例 #1
0
        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;
        }
コード例 #2
0
        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);
            }
        }