private void busHoldersToolStripMenuItem_Click(object sender, EventArgs e)
        {
            frmBusHolders frm = new frmBusHolders();

            if (UserType.Text == "Admin")
            {
                frm.label3.Text = UserType.Text;
                frm.Show();
            }
            else
            {
                frm.label3.Text = UserType.Text;
                frm.Show();
            }
        }
Exemplo n.º 2
0
        private void dataGridView5_RowHeaderMouseClick(object sender, DataGridViewCellMouseEventArgs e)
        {
            DataGridViewRow dr = dataGridView5.SelectedRows[0];

            this.Hide();
            frmBusHolders frm = new frmBusHolders();

            // or simply use column name instead of index
            //dr.Cells["id"].Value.ToString();
            frm.Show();
            frm.ScholarNo.Text         = dr.Cells[0].Value.ToString();
            frm.StudentName.Text       = dr.Cells[1].Value.ToString();
            frm.Course.Text            = dr.Cells[2].Value.ToString();
            frm.Branch.Text            = dr.Cells[3].Value.ToString();
            frm.cmbSourceLocation.Text = dr.Cells[4].Value.ToString();
            frm.dtpStartingDate.Text   = dr.Cells[5].Value.ToString();
            if (label5.Text == "Admin")
            {
                frm.btnDelete.Enabled        = true;
                frm.btnUpdate_record.Enabled = true;
                frm.ScholarNo.Focus();
                frm.label3.Text     = label5.Text;
                frm.btnSave.Enabled = false;
            }
            else
            {
                frm.btnDelete.Enabled        = false;
                frm.btnUpdate_record.Enabled = false;
                frm.btnSave.Enabled          = false;
                frm.ScholarNo.Focus();
                frm.label3.Text = label5.Text;
            }
        }