private void AdminForm_Load(object sender, EventArgs e) { String s = "Salesman"; String a = "All employee"; String pList = "Product"; String section = comboBox2.Text; pd = new ShopQDataContext(@"Data Source=(LocalDB)\v11.0;AttachDbFilename=C:\Users\USER\Documents\Informatio.mdf;Integrated Security=True;Connect Timeout=30"); ProductList p = new ProductList(); if (section.Equals(pList)) { var x = from Barcode in pd.ProductLists select Barcode; dataGridView1.DataSource = x; //comboBox2.DataSource = x.Distinct(); //var y = from Barcode in pd.ProductLists select Barcode; // comboBox1.DataSource = y.Distinct(); //comboBox1.DisplayMember = "Product Name"; } else if (section.Equals(s)) { var x = from Id in pd.Salesmans select Id; dataGridView1.DataSource = x; } else if (section.Equals(a)) { var x = from Barcode in pd.Employes select Barcode; dataGridView1.DataSource = x; } else { MessageBox.Show("Selec section first !!"); } }
partial void UpdateProductList(ProductList instance);
partial void DeleteProductList(ProductList instance);
partial void InsertProductList(ProductList instance);