Exemplo n.º 1
0
        private void partToolStripMenuItem_Click(object sender, EventArgs e)
        {
            frmPart fmPart = new frmPart();

            fmPart.MdiParent = this;
            fmPart.Show();
            fmPart.WindowState = FormWindowState.Maximized;
            fmPart.Focus();
        }
Exemplo n.º 2
0
        private void frmPart_Load(object sender, EventArgs e)
        {
            frmPart fp = new frmPart();

            fp.WindowState = FormWindowState.Maximized;
            DBConnect dbconnect = new DBConnect();

            dbconnect.connection.Open();
            MySqlCommand command = new MySqlCommand();

            command.Connection = dbconnect.connection;
            string qry;

            qry = "select parts.id, parts.part_name,parts.number, inventory.quantity from parts LEFT JOIN inventory  ON parts.ID =inventory.part_id order by parts.id asc;";

            command.CommandText = qry;

            DataTable        data    = new DataTable();
            MySqlDataAdapter adapter = new MySqlDataAdapter(command);

            adapter.Fill(data);

            dataGridView1.DataSource = data;
        }