private void barBtnDataBarang_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { ListBarang form = ListBarang.GetForm(); form.MdiParent = this; form.Show(); form.Activate(); }
private void navBarDataBarang_LinkClicked(object sender, DevExpress.XtraNavBar.NavBarLinkEventArgs e) { ListBarang form = ListBarang.GetForm(); form.MdiParent = this; form.Show(); form.Activate(); }
private void TxtCariBarang_TextChanged(object sender, EventArgs e) { //cari nama barang SqlConnection conn = konn.GetConn(); conn.Open(); cmd = new SqlCommand("execute cari_barang '" + TxtCariBarang.Text + "'", conn); ds = new DataSet(); da = new SqlDataAdapter(cmd); da.Fill(ds, "barang"); ListBarang.DataSource = ds; ListBarang.DataMember = "barang"; ListBarang.Refresh(); conn.Close(); }
//prosedur refresh barang void refresh_barang() { SqlConnection conn = konn.GetConn(); try { conn.Open(); cmd = new SqlCommand("select * from barang", conn); ds = new DataSet(); da = new SqlDataAdapter(cmd); da.Fill(ds, "barang"); ListBarang.DataSource = ds; ListBarang.DataMember = "barang"; ListBarang.Refresh(); } catch (Exception e) { MessageBox.Show(e.ToString()); } finally { conn.Close(); } }