Exemple #1
0
        private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            this.Visible = false;
            StudentReg f2 = new StudentReg();

            f2.btnupdate.Visible = true;
            f2.txtv.Visible      = false;
            f2.txtid1.Visible    = true;
            f2.btnsave.Visible   = false;
            f2.txtid1.text       = this.dataGridView1.CurrentRow.Cells[0].Value.ToString();
            f2.txtname.text      = this.dataGridView1.CurrentRow.Cells[1].Value.ToString();
            f2.txtsurname.text   = this.dataGridView1.CurrentRow.Cells[2].Value.ToString();
            f2.mrktxtdob.Text    = this.dataGridView1.CurrentRow.Cells[3].Value.ToString();
            f2.cmbgender.Text    = this.dataGridView1.CurrentRow.Cells[4].Value.ToString();
            f2.mrktxtcontct.Text = this.dataGridView1.CurrentRow.Cells[5].Value.ToString();
            f2.txtadd.Text       = this.dataGridView1.CurrentRow.Cells[6].Value.ToString();
            f2.txtourses.text    = this.dataGridView1.CurrentRow.Cells[7].Value.ToString();
            f2.cmbduration.Text  = this.dataGridView1.CurrentRow.Cells[8].Value.ToString();
            f2.cmbmoth.Text      = this.dataGridView1.CurrentRow.Cells[9].Value.ToString();
            f2.mrktxtdate.Text   = this.dataGridView1.CurrentRow.Cells[10].Value.ToString();
            f2.txtemail.text     = this.dataGridView1.CurrentRow.Cells[12].Value.ToString();
            // f2.pictureBox1.Image = this.dataGridView1.CurrentRow.Cells[12].Value as Image;

            f2.ShowDialog();
        }
Exemple #2
0
        private void bunifuFlatButton2_Click(object sender, EventArgs e)
        {
            string user, pass;

            user = txtuname.Text;
            pass = txtpwd.Text;
            if (user == "admin" && pass == "admin")
            {
                txtuname.Text = "";
                txtpwd.Text   = "";
                frmdashboard dsb = new frmdashboard();
                StudentReg   std = new StudentReg();
                this.Visible    = false;
                dsb.lblusr.Text = "Admin";
                //std.lbluser12.Text = "Admin";
                this.Visible = false;


                dsb.ShowDialog();
            }
            else
            {
                lblcolor.Text      = "Invalid Username &  Password";
                lblcolor.ForeColor = System.Drawing.Color.Red;
            }
        }
        private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            try
            {
                if (txtid.text == "")
                {
                    lblid.Text = "Student Id Is blank !";
                }
                else
                {
                    StudentReg    std       = new StudentReg();
                    SqlDataReader myReader  = null;
                    SqlCommand    myCommand = new SqlCommand(@"SELECT * FROM stdreg where studen_id='" + txtid.text + "' ", cn);
                    //  @" SELECT * FROM Images where id = @id
                    cn.Close();
                    cn.Open();
                    myReader = myCommand.ExecuteReader();

                    if (myReader.Read())
                    {
                        txtname.text      = (myReader["name"].ToString());
                        txtsurname.text   = (myReader["surname"].ToString());
                        mrktxtcontct.Text = (myReader["contact"].ToString());
                        txtourses.text    = (myReader["course"].ToString());
                        cmbduration.Text  = (myReader["duration"].ToString());
                        cmbmoth.Text      = (myReader["moth"].ToString());
                        mrktxtdate.Text   = (myReader["jdate"].ToString());

                        button1_Click(sender, e);
                        lblid.Text = "Record Found";
                    }
                    else
                    {
                        lblid.Text = "Not Found";
                    }
                }
            }
            catch
            {
                MessageBox.Show("Something Went Wrong !");
            }
        }
Exemple #4
0
        private void timer1_Tick(object sender, EventArgs e)
        {
            Random rand  = new Random();
            int    one   = rand.Next(0, 255);
            int    two   = rand.Next(0, 255);
            int    three = rand.Next(0, 255);
            int    four  = rand.Next(0, 255);

            lblcolor.ForeColor = Color.FromArgb(one, two, three, four);


            string user, pass;

            user = txtuname.Text;
            pass = txtpwd.Text;
            if (user == "admin" && pass == "admin")
            {
                txtuname.Text = "";
                txtpwd.Text   = "";
                lblcolor.Text = "Login Successfully..";
                frmdashboard dsb = new frmdashboard();
                StudentReg   std = new StudentReg();
                this.Visible    = false;
                dsb.lblusr.Text = "Admin";
                //std.lbluser12.Text = "Admin";
                this.Visible = false;


                dsb.ShowDialog();
            }
            else
            {
                lblcolor.Text = "Checking Credential...";
                //    lblcolor.ForeColor = System.Drawing.Color.Red;
            }
        }
Exemple #5
0
        private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            try
            {
            this.Visible = false;
            studentfees f2 = new studentfees();
            // f2.btnupdate.Visible = true;
            //f2.label2.Visible = true;
            f2.txtid.Visible = true;
            f2.btnsave.Visible = false;
            f2.txtfeesid.text = this.dataGridView1.CurrentRow.Cells[0].Value.ToString();
            f2.txtid.text = this.dataGridView1.CurrentRow.Cells[1].Value.ToString();

            f2.txtourses.text = this.dataGridView1.CurrentRow.Cells[2].Value.ToString();
            f2.txtfees.text = this.dataGridView1.CurrentRow.Cells[3].Value.ToString();
            f2.mrktxtpdat.Text = this.dataGridView1.CurrentRow.Cells[4].Value.ToString();
            f2.txtrmfees.text = this.dataGridView1.CurrentRow.Cells[5].Value.ToString();
            f2.paidfees.text = this.dataGridView1.CurrentRow.Cells[6].Value.ToString();
            f2.btnupdate.Visible = true;
            f2.linkLabel1.Visible = false;
            f2.txtid.Enabled = false;
           
            
                if (f2.txtid.text == "")
                {
                    //f2.lblid.Text = "Student Id Is blank !";
                }
                else
                {

                    StudentReg std = new StudentReg();
                    SqlDataReader myReader = null;
                    SqlCommand myCommand = new SqlCommand(@"SELECT * FROM stdreg where studen_id='" + f2.txtid.text + "' ", cn);
                    //  @" SELECT * FROM Images where id = @id
                    cn.Close();
                    cn.Open();
                    myReader = myCommand.ExecuteReader();

                    if (myReader.Read())
                    {
                        f2.txtname.text = (myReader["name"].ToString());
                        f2.txtsurname.text = (myReader["surname"].ToString());
                        f2.mrktxtcontct.Text = (myReader["contact"].ToString());
                        f2.txtourses.text = (myReader["course"].ToString());
                        f2.cmbduration.Text = (myReader["duration"].ToString());
                        f2.cmbmoth.Text = (myReader["moth"].ToString());
                        f2.mrktxtdate.Text = (myReader["jdate"].ToString());
                        f2.btnupdate.Visible = true;
                        f2.linkLabel1.Visible = false;
                        f2.txtid.Enabled = false;
                        f2.ShowDialog();

                        //f2. button1_Click(sender, e);
                        //          lblid.Text = "Record Found";
                    }
                    else
                    {
                        //            lblid.Text = "Not Found";
                    }

                }

            }
            catch
            {
                MessageBox.Show("Something Went Wrong !");
            }

            
        }
Exemple #6
0
        private void btnrecord_Click(object sender, EventArgs e)
        {
            StudentReg stdreg = new StudentReg();

            stdreg.ShowDialog();
        }