Ejemplo n.º 1
0
        private void busHoldersEntryToolStripMenuItem_Click(object sender, EventArgs e)
        {
            frmBusHolderStudents frm = new frmBusHolderStudents();

            frm.lblUser.Text = User.Text;
            con = new SqlConnection(cs.DBcon);
            con.Open();
            cmd             = con.CreateCommand();
            cmd.CommandText = "SELECT RTRIM(Saves),RTRIM(Getdata)  from UserGrants inner join Users on UserGrants.UserId=Users.ID where Forms='Student BusHolder Entry' and Users.UserID='" + User.Text + "' ";
            rdr             = cmd.ExecuteReader();
            if (rdr.Read())
            {
                frm.lblSave.Text    = rdr[0].ToString().Trim();
                frm.lblGetdata.Text = rdr[1].ToString().Trim();
            }
            if ((rdr != null))
            {
                rdr.Close();
            }
            if (con.State == ConnectionState.Open)
            {
                con.Close();
            }

            if (frm.lblSave.Text == "True")
            {
                frm.btnSave.Enabled = true;
            }
            else
            {
                frm.btnSave.Enabled = false;
            }

            if (frm.lblGetdata.Text == "True")
            {
                frm.btnGetData.Enabled = true;
            }
            else
            {
                frm.btnGetData.Enabled = false;
            }
            frm.ShowDialog();
        }
Ejemplo n.º 2
0
 public frmStudentList(frmBusHolderStudents par1)
 {
     frmBusholder = par1;
     InitializeComponent();
 }