Example #1
0
        private void bunifuImageButton1_Click(object sender, EventArgs e)
        {
            addVendor add = new addVendor(this);

            add.Show();
            add.btnUpdate.Enabled = false;
        }
Example #2
0
        private void dataGridVendors_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            String    colName = dataGridVendors.Columns[e.ColumnIndex].Name;
            addVendor add     = new addVendor(this);

            if (colName == "Delete")
            {
                stocks.delVendor(dataGridVendors.Rows[e.RowIndex].Cells[0].Value.ToString());
                loadDataVendor();
            }

            if (colName == "update")
            {
                add.lblID.Text        = dataGridVendors.Rows[e.RowIndex].Cells[0].Value.ToString();
                add.txtVendors.Text   = dataGridVendors.Rows[e.RowIndex].Cells[1].Value.ToString();
                add.txtAddress.Text   = dataGridVendors.Rows[e.RowIndex].Cells[2].Value.ToString();
                add.txtContact.Text   = dataGridVendors.Rows[e.RowIndex].Cells[3].Value.ToString();
                add.txtTelephone.Text = dataGridVendors.Rows[e.RowIndex].Cells[4].Value.ToString();
                add.txtEmail.Text     = dataGridVendors.Rows[e.RowIndex].Cells[5].Value.ToString();
                add.txtFax.Text       = dataGridVendors.Rows[e.RowIndex].Cells[6].Value.ToString();

                add.submit.Enabled    = false;
                add.btnUpdate.Enabled = true;
                add.Show();
            }
        }