private void studentToolStripMenuItem3_Click(object sender, EventArgs e)
        {
            this.Hide();
            Frm_student frm = new Frm_student();

            frm.lblUser.Text     = User.Text;
            frm.lblUserType.Text = UserType.Text;
            frm.Show();
        }
예제 #2
0
 private void frmStudentRecordSearch_FormClosing(object sender, FormClosingEventArgs e)
 {
     if (label4.Text == "Student Record")
     {
         this.Hide();
         frmClassFeePaymentcs frm = new frmClassFeePaymentcs();
         frm.lblUserType.Text = lblUserType.Text;
         frm.lblUser.Text     = lblUser.Text;
         frm.Show();
     }
     else
     {
         this.Hide();
         Frm_student frm = new Frm_student();
         frm.lblUserType.Text = lblUserType.Text;
         frm.lblUser.Text     = lblUser.Text;
         frm.Show();
     }
 }
예제 #3
0
        private void DataGridView1_RowHeaderMouseClick(object sender, DataGridViewCellMouseEventArgs e)
        {
            try
            {
                if (label4.Text == "Student Record")
                {
                    DataGridViewRow dr = DataGridView1.SelectedRows[0];
                    this.Hide();
                    frmClassFeePaymentcs frm = new  frmClassFeePaymentcs();
                    frm.Show();
                    frm.txtAdmissionNo.Text   = dr.Cells[2].Value.ToString();
                    frm.txtEnrollmentNo.Text  = dr.Cells[3].Value.ToString();
                    frm.txtSession.Text       = dr.Cells[15].Value.ToString();
                    frm.txtStudentName.Text   = dr.Cells[4].Value.ToString();
                    frm.txtClass.Text         = dr.Cells[18].Value.ToString();
                    frm.txtSection.Text       = dr.Cells[19].Value.ToString();
                    frm.txtSchoolName.Text    = dr.Cells[1].Value.ToString();
                    frm.lblUser.Text          = lblUser.Text;
                    frm.lblUserType.Text      = lblUserType.Text;
                    frm.cmbMonth.Enabled      = true;
                    frm.DataGridView1.Enabled = true;
                    frm.groupBox5.Enabled     = true;
                    frm.groupBox4.Enabled     = true;
                    frm.GetData();

                    frm.btnDelete.Enabled        = false;
                    frm.btnUpdate_record.Enabled = false;

                    frm.btnSave.Enabled = true;
                    label4.Text         = "";
                }
                else
                {
                    DataGridViewRow dr = DataGridView1.SelectedRows[0];
                    this.Hide();
                    Frm_student frm = new Frm_student();
                    frm.Show();
                    frm.txtSchoolID.Text         = dr.Cells[0].Value.ToString();
                    frm.cmbSchoolName.Text       = dr.Cells[1].Value.ToString();
                    frm.txtAdmissionNo.Text      = dr.Cells[2].Value.ToString();
                    frm.txtEnrollmentNo.Text     = dr.Cells[3].Value.ToString();
                    frm.txtStudentName.Text      = dr.Cells[4].Value.ToString();
                    frm.txtFathername.Text       = dr.Cells[5].Value.ToString();
                    frm.txtMotherName.Text       = dr.Cells[6].Value.ToString();
                    frm.txtFatherContactNo.Text  = dr.Cells[7].Value.ToString();
                    frm.txtPermanentAddress.Text = dr.Cells[8].Value.ToString();
                    frm.txtTemrorayAddress.Text  = dr.Cells[9].Value.ToString();
                    frm.txtContactNo.Text        = dr.Cells[10].Value.ToString();
                    frm.txtEmailID.Text          = dr.Cells[11].Value.ToString();
                    frm.dtpDOB.Text           = dr.Cells[12].Value.ToString();
                    frm.txtGender.Text        = dr.Cells[13].Value.ToString();
                    frm.dtpAdmissionDate.Text = dr.Cells[14].Value.ToString();
                    frm.txtSession.Text       = dr.Cells[15].Value.ToString();
                    frm.cmbCategory.Text      = dr.Cells[16].Value.ToString();
                    frm.cmbReligion.Text      = dr.Cells[17].Value.ToString();
                    frm.cmbStatus.Text        = dr.Cells[20].Value.ToString();
                    frm.txtNationality.Text   = dr.Cells[21].Value.ToString();
                    frm.cmbClass.Text         = dr.Cells[18].Value.ToString();
                    frm.CmbSection.Text       = dr.Cells[19].Value.ToString();
                    byte[]       data = (byte[])dr.Cells[22].Value;
                    MemoryStream ms   = new MemoryStream(data);
                    frm.Picture.Image            = Image.FromStream(ms);
                    frm.lblUser.Text             = lblUser.Text;
                    frm.lblUserType.Text         = lblUserType.Text;
                    frm.btnSave.Enabled          = false;
                    frm.btnDelete.Enabled        = true;
                    frm.btnUpdate_record.Enabled = true;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }