Exemplo n.º 1
0
    protected void DropDownList_stu_SelectedIndexChanged(object sender, EventArgs e)
    {
        SqlFuns sf   = new SqlFuns();
        uint    snum = uint.Parse(DropDownList_stu.SelectedValue);
        Student stu  = sf.SearchStudent(snum);

        Label_name.Text   = stu.Name;
        Label_birth.Text  = stu.Birth.ToLongDateString();
        Label_jodate.Text = stu.Joindate.ToLongDateString();
        Label_mobile.Text = stu.Mobile;
        Label_email.Text  = stu.Email;
        Label_addr.Text   = stu.Address;
        bind(sf.SearchPayment(snum));
        bind(sf.SearchStudentRank(snum));
        bind(sf.SearchAttendanceSNUM(snum));
        Label1.Text = Label2.Text = "";
        IList <StuParent> spr = sf.SearchStuParent(snum);

        for (int i = 0; i < spr.Count; i++)
        {
            if (spr[i].Stpar == true)
            {
                Student pst = sf.SearchStudent(spr[i].Spnum);
                if (spr[i].Mord == true)
                {
                    Label1.Text = "Student Number: " + pst.Stnum + ", <br />Name: " + pst.Name + ", <br />Birthday: " + pst.Birth.ToShortDateString() + ", <br />Join Date: " + pst.Joindate.ToShortDateString() + ", <br />Address: " + pst.Address + ", <br />Phone Number: " + pst.Mobile + ", <br />Email: " + pst.Email;
                }
                else
                {
                    Label2.Text = "Student Number: " + pst.Stnum + ", <br />Name: " + pst.Name + ", <br />Birthday: " + pst.Birth.ToShortDateString() + ", <br />Join Date: " + pst.Joindate.ToShortDateString() + ", <br />Address: " + pst.Address + ", <br />Phone Number: " + pst.Mobile + ", <br />Email: " + pst.Email;
                }
            }
            else
            {
                Parent par = sf.SearchParent(spr[i].Spnum);
                if (spr[i].Mord == true)
                {
                    Label1.Text = "Name: " + par.Name + ", <br />Phone Number: " + par.Mobile + ", <br />Email: " + par.Email;
                }
                else
                {
                    Label2.Text = "Name: " + par.Name + ", <br />Phone Number: " + par.Mobile + ", <br />Email: " + par.Email;
                }
            }
        }
    }