Example #1
0
 private void passDataToPrintForm(PrintStudentProfile print)
 {
     print.LabelAdmissionNo.Text = LabelAdmissionNo.Text.ToString();
     print.LabelID.Text = LabelID.Text.ToString();
     print.LabelGender.Text = LabelGender.Text.ToString();
     print.LabelCentre.Text = LabelCentre.Text.ToString();
     print.LabelFullName.Text = LabelFullName.Text.ToString();
     print.LabelAddress.Text = LabelAddress.Text.ToString();
     print.LabelSuburb.Text = LabelSuburb.Text.ToString();
     print.LabelCity.Text = LabelCity.Text.ToString();
     print.LabelZipCode.Text = LabelZipCode.Text.ToString();
     print.LabelTotal.Text = LabelTotal.Text.ToString();
     print.LabelDue.Text = LabelDue.Text.ToString();
     registeredSubjects(print);
 }
Example #2
0
        private void registeredSubjects(PrintStudentProfile print)
        {
            int rows = getRows();
            
            // Populating first column with data
            if (rows > 0)
                print.labelCode1.Text = Convert.ToString(subjectDGV.Rows[0].Cells[0].Value);
            else
                print.labelCode1.Visible = false;

            if (rows > 1)
                print.labelCode2.Text = Convert.ToString(subjectDGV.Rows[1].Cells[0].Value);
            else
                print.labelCode2.Visible = false;

            if (rows > 2)
                print.labelCode3.Text = Convert.ToString(subjectDGV.Rows[2].Cells[0].Value);
            else
                print.labelCode3.Visible = false;

            if (rows > 3)
                print.labelCode4.Text = Convert.ToString(subjectDGV.Rows[3].Cells[0].Value);
            else
                print.labelCode4.Visible = false;

            // Populating second column with data
            if (rows > 0)
                print.labelName1.Text = Convert.ToString(subjectDGV.Rows[0].Cells[1].Value);
            else
                print.labelName1.Visible = false;

            if (rows > 1)
                print.labelName2.Text = Convert.ToString(subjectDGV.Rows[1].Cells[1].Value);
            else
                print.labelName2.Visible = false;

            if (rows > 2)
                print.labelName3.Text = Convert.ToString(subjectDGV.Rows[2].Cells[1].Value);
            else
                print.labelName3.Visible = false;

            if (rows > 3)
                print.labelName4.Text = Convert.ToString(subjectDGV.Rows[3].Cells[1].Value);
            else
                print.labelName4.Visible = false;

            // Populating the third column with data
            if (rows > 0)
                print.labelYear1.Text = Convert.ToString(subjectDGV.Rows[0].Cells[2].Value);
            else
                print.labelYear1.Visible = false;

            if (rows > 1)
                print.labelYear2.Text = Convert.ToString(subjectDGV.Rows[1].Cells[2].Value);
            else
                print.labelYear2.Visible = false;

            if (rows > 2)
                print.labelYear3.Text = Convert.ToString(subjectDGV.Rows[2].Cells[2].Value);
            else
                print.labelYear3.Visible = false;

            if (rows > 3)
                print.labelYear4.Text = Convert.ToString(subjectDGV.Rows[3].Cells[2].Value);
            else
                print.labelYear4.Visible = false;
        }
Example #3
0
 private void printToolStripButton_Click(object sender, EventArgs e)
 {
     print = new PrintStudentProfile();
     passDataToPrintForm(print);
     print.ShowDialog();
 }