示例#1
0
 public frmBrowse(string tabel)
 {
     InitializeComponent();
     this.tabel = tabel;
     if (tabel == "barang")
     {
         dgvBrowse.DataSource = Barang.FindAll();
     }
     else if (tabel == "customer")
     {
         dgvBrowse.DataSource = Customer.FindAll();
     }
     else if (tabel == "supplier")
     {
         dgvBrowse.DataSource = Supplier.FindAll();
     }
     else if (tabel == "penjualan")
     {
         dgvBrowse.DataSource = Penjualan.FindAll();
     }
     else if (tabel == "pembelian")
     {
         dgvBrowse.DataSource = Pembelian.FindAll();
     }
     dgvBrowse.Refresh();
     data = new Dictionary <string, string> {
     };
     dt   = (DataTable)dgvBrowse.DataSource;
 }
        private void frmLihat_Shown(object sender, EventArgs e)
        {
            mtcDaftar.SelectTab(0);
            dgvBarang.DataSource = Barang.FindAll();
            dgvBarang.Refresh();
            dgvCustomer.DataSource = Customer.FindAll();
            dgvCustomer.Refresh();
            dgvSupplier.DataSource = Supplier.FindAll();
            dgvSupplier.Refresh();

            dtBarang   = (DataTable)dgvBarang.DataSource;
            dtCustomer = (DataTable)dgvCustomer.DataSource;
            dtSupplier = (DataTable)dgvCustomer.DataSource;
        }