private void button_stock_Click(object sender, EventArgs e)
        {
            textBox_itemname.Hide();
            textBox_itemdescription.Hide();
            button_add.Hide();
            button_deduct.Hide();
            expiry_date.Hide();
            button_create.Hide();
            button_update.Hide();
            button_reset.Hide();
            label2.Hide();
            Item_name.Hide();
            labelbel.Hide();
            label3.Hide();
            checkbox_expiry.Hide();
            label4.Hide();
            dataGridView1.Hide();
            dataGridView2.Show();
            textBox_initial_quant.Hide();
            label_initial_quant.Hide();
            label9.Hide();
            textBox_reorder.Hide();
            label_supplier.Hide();
            textBox_supplier.Hide();
            bunifuFlatButton2.Hide();


            string query = "SELECT stock_id, stock_inventory_id, stock_label, stock_name, stock_value, stock_description, stock_date," +
                           "stock_appointment_id, stock_appointment_name from stock";

            conn.Open();
            MySqlCommand     com = new MySqlCommand(query, conn);
            MySqlDataAdapter adp = new MySqlDataAdapter(com);

            conn.Close();
            DataTable dt = new DataTable();

            adp.Fill(dt);

            dataGridView2.DataSource = dt;
            dataGridView2.Columns["stock_id"].Visible                  = false;
            dataGridView2.Columns["stock_inventory_id"].Visible        = false;
            dataGridView2.Columns["stock_label"].HeaderText            = "In / out";
            dataGridView2.Columns["stock_name"].HeaderText             = "Item Name ";
            dataGridView2.Columns["stock_value"].HeaderText            = "No. Items";
            dataGridView2.Columns["stock_description"].HeaderText      = "Reason";
            dataGridView2.Columns["stock_date"].HeaderText             = "Date issued";
            dataGridView2.Columns["stock_appointment_id"].HeaderText   = "Appointment No.";
            dataGridView2.Columns["stock_appointment_name"].HeaderText = "Name";


            dataGridView2.Sort(dataGridView2.Columns[1], ListSortDirection.Ascending);
        }
        private void label_equip_Click(object sender, EventArgs e)
        {
            dataGridView2.Hide();
            dataGridView1.Hide();
            loadAll();
            label4.Hide();
            label5.Hide();
            expiry_date.Enabled = false;
            button_add.Hide();
            button_deduct.Hide();
            Item_name.Hide();
            label2.Hide();
            labelbel.Hide();
            label3.Hide();
            label4.Hide();
            textBox_itemname.Hide();
            textBox_itemdescription.Hide();
            expiry_date.Hide();
            checkbox_expiry.Hide();
            button_create.Hide();
            button_update.Hide();
            button_reset.Hide();
            bunifuFlatButton2.Hide();
            textBox_supplier.Hide();
            label_supplier.Hide();
            label_initial_quant.Hide();
            textBox_initial_quant.Hide();
            label9.Hide();
            textBox_reorder.Hide();


            dataGridView3.Show();
            Label_equipmentname.Show();
            label_equipmentdesc.Show();
            label_status.Show();
            textBox_equipmentname.Show();
            textBox_equipmentdesc.Show();
            comboBox_status.Show();
            button__create.Show();
            button__update.Show();
            button__reset.Show();
        }
Example #3
0
        private void button_stock_Click(object sender, EventArgs e)
        {
            textBox_itemname.Hide();
            textBox_itemdescription.Hide();
            button_add.Hide();
            button_deduct.Hide();
            expiry_date.Hide();
            button_create.Hide();
            button_update.Hide();
            button_reset.Hide();
            label2.Hide();
            Item_name.Hide();
            labelbel.Hide();
            label3.Hide();

            string query = "SELECT * from stock";

            conn.Open();
            MySqlCommand     com = new MySqlCommand(query, conn);
            MySqlDataAdapter adp = new MySqlDataAdapter(com);

            conn.Close();
            DataTable dt = new DataTable();

            adp.Fill(dt);

            dataGridView1.DataSource = dt;
            dataGridView1.Columns["stock_id"].Visible             = false;
            dataGridView1.Columns["stock_inventory_id"].Visible   = false;
            dataGridView1.Columns["stock_label"].HeaderText       = "In / out";
            dataGridView1.Columns["stock_name"].HeaderText        = "Item Name ";
            dataGridView1.Columns["stock_value"].HeaderText       = "No. Items";
            dataGridView1.Columns["stock_description"].HeaderText = "Reason";
            dataGridView1.Columns["stock_date"].HeaderText        = "Date issued";

            dataGridView1.Sort(dataGridView1.Columns[1], ListSortDirection.Ascending);
        }