private void populateGrid()
        {
            string selectStatement = "SELECT supplier_code as 'Supplier Code', supplier_name as 'Supplier' , contact_name as 'Contact Person', contact_number as 'Contact Number', email as 'Email' FROM SUPPLIER";

            DatabaseHandler.populateViewwithNoParameters(selectStatement, dataGridView1);

            string selectStatement4 = "SELECT STORE.item_code as 'Item Code', STORE.item_name as 'Item Name', STORE.description as 'Description', SUPPLIER.supplier_code as 'Supplier Code', SUPPLIER.supplier_name as 'Supplier' FROM SUPPLIER INNER JOIN STORE ON SUPPLIER.supplier_code = STORE.supplier_code WHERE STORE.pending_removal='Yes'";

            DatabaseHandler.populateViewwithNoParameters(selectStatement4, dataGridView3);

            if (!String.IsNullOrEmpty(findById.Text))
            {
                string selectStatement2 = "SELECT STORE.item_code as 'Item Code', STORE.item_name as 'Item Name', STORE.description as 'Description', SUPPLIER.supplier_code as 'Supplier Code', SUPPLIER.supplier_name as 'Supplier' FROM SUPPLIER INNER JOIN STORE ON SUPPLIER.supplier_code = STORE.supplier_code WHERE SUPPLIER.supplier_code like '%" + findById.Text + "%'";
                DatabaseHandler.populateViewwithNoParameters(selectStatement2, dataGridView2);
            }
            else if (!String.IsNullOrEmpty(findByName.Text))
            {
                string selectStatement3 = "SELECT STORE.item_code as 'Item Code', STORE.item_name as 'Item Name', STORE.description as 'Description', SUPPLIER.supplier_code as 'Supplier Code', SUPPLIER.supplier_name as 'Supplier' FROM SUPPLIER INNER JOIN STORE ON SUPPLIER.supplier_code = STORE.supplier_code WHERE SUPPLIER.supplier_name like '%" + findByName.Text + "%'";
                DatabaseHandler.populateViewwithNoParameters(selectStatement3, dataGridView2);
            }
            else
            {
                string selectStatement3 = "SELECT STORE.item_code as 'Item Code', STORE.item_name as 'Item Name', STORE.description as 'Description', SUPPLIER.supplier_code as 'Supplier Code', SUPPLIER.supplier_name as 'Supplier' FROM SUPPLIER INNER JOIN STORE ON SUPPLIER.supplier_code = STORE.supplier_code";
                DatabaseHandler.populateViewwithNoParameters(selectStatement3, dataGridView2);
            }
        }
Exemplo n.º 2
0
        private void populateGrid()
        {
            string selectStatement = "SELECT STORE.item_code as 'Item Code', STORE.item_name as 'Item Name', STORE.description as 'Item Description', SUPPLIER.supplier_name as 'Supplier' FROM STORE INNER JOIN SUPPLIER ON STORE.supplier_code = SUPPLIER.supplier_code WHERE SUPPLIER.supplier_code = '" + selectedSupplier + "'";

            DatabaseHandler.populateViewwithNoParameters(selectStatement, dataGridView1);

            populateNonComboGrids();
        }
Exemplo n.º 3
0
 private void findMemId_TextChanged(object sender, EventArgs e)
 {
     try
     {
         string selectStatement = "SELECT member_name as 'Member Name', username as 'Username' , role as 'User Role' FROM user WHERE username like '%" + findMemId.Text + "%'";
         DatabaseHandler.populateViewwithNoParameters(selectStatement, dataGridView1);
     }
     catch (Exception err)
     {
         Console.WriteLine(err);
     }
 }
 private void removeSupplierId_TextChanged(object sender, EventArgs e)
 {
     try
     {
         string selectStatement = "SELECT supplier_code as 'Supplier Code', supplier_name as 'Supplier' , contact_name as 'Contact Person', contact_number as 'Contact Number', email as 'Email' FROM SUPPLIER WHERE supplier_code like '%" + removeSupplierId.Text + "%'";
         DatabaseHandler.populateViewwithNoParameters(selectStatement, dataGridView1);
     }
     catch (Exception err)
     {
         Console.WriteLine(err);
     }
 }
 private void findByName_TextChanged(object sender, EventArgs e)
 {
     try
     {
         string selectStatement = "SELECT hospital as 'Hospital', identifier_code as 'Identifier Code' , area as 'Area', contact_name as 'Contact Name',contact_number as 'Contact Number', email as 'Email' FROM CLIENT WHERE hospital like '%" + findByName.Text + "%'";
         DatabaseHandler.populateViewwithNoParameters(selectStatement, dataGridView1);
     }
     catch (Exception err)
     {
         Console.WriteLine(err);
     }
 }
        private void findByName_TextChanged(object sender, EventArgs e)
        {
            try
            {
                string selectStatement = "SELECT supplier_code as 'Supplier Code', supplier_name as 'Supplier' , contact_name as 'Contact Person', contact_number as 'Contact Number', email as 'Email' FROM SUPPLIER WHERE supplier_name like '%" + findByName.Text + "%'";
                DatabaseHandler.populateViewwithNoParameters(selectStatement, dataGridView1);

                string selectStatement2 = "SELECT STORE.item_code as 'Item Code', STORE.item_name as 'Item Name', STORE.description as 'Description', SUPPLIER.supplier_code as 'Supplier Code', SUPPLIER.supplier_name as 'Supplier' FROM SUPPLIER INNER JOIN STORE ON SUPPLIER.supplier_code = STORE.supplier_code WHERE SUPPLIER.supplier_name like '%" + findByName.Text + "%'";
                DatabaseHandler.populateViewwithNoParameters(selectStatement2, dataGridView2);
            }
            catch (Exception err)
            {
                Console.WriteLine(err);
            }
        }
Exemplo n.º 7
0
        private void populateGrid()
        {
            string selectStatement = "SELECT member_name as 'Member Name', username as 'Username' , role as 'User Role' FROM user";

            DatabaseHandler.populateViewwithNoParameters(selectStatement, dataGridView1);
        }
        private void populateGrid()
        {
            string selectStatement = "SELECT hospital as 'Hospital', identifier_code as 'Identifier Code' , area as 'Area', contact_name as 'Contact Name',contact_number as 'Contact Number', email as 'Email' FROM CLIENT";

            DatabaseHandler.populateViewwithNoParameters(selectStatement, dataGridView1);
        }