Ejemplo n.º 1
0
    public void Piechart()
    {
        int    A     = 0;
        int    B     = 0;
        int    C     = 0;
        int    D     = 0;
        int    E     = 0;
        int    count = 0;
        AbcDAL MyDAL = new AbcDAL("");

        DataTable ResultTable      = MyDAL.SelectStudentByAuthID(1);
        string    StudentID        = ResultTable.Rows[0]["StudentID"].ToString().Trim();
        DataTable ResultTableClass = MyDAL.PopulateClassByStudentID(StudentID);

        RadChart radChart = new RadChart();

        radChart.ChartTitle.TextBlock.Text = "My RadChart";
        ChartSeries chartSeries = new ChartSeries();

        chartSeries.Name = "Overall Grade";
        chartSeries.Type = ChartSeriesType.Bar;
        // add new items to the series,
        // passing a value and a label string

        foreach (DataRow row in ResultTableClass.Rows)
        {
            if (ResultTableClass.Rows[count]["Grade"].ToString().Trim() == "A")
            {
                A++;
            }
            else if (ResultTableClass.Rows[count]["Grade"].ToString().Trim() == "B")
            {
                B++;
            }
            else if (ResultTableClass.Rows[count]["Grade"].ToString().Trim() == "C")
            {
                C++;
            }
            else if (ResultTableClass.Rows[count]["Grade"].ToString().Trim() == "D")
            {
                D++;
            }
            else if (ResultTableClass.Rows[count]["Grade"].ToString().Trim() == "E")
            {
                E++;
            }
            count++;
        }
        chartSeries.AddItem(A, "A");
        chartSeries.AddItem(B, "B");
        chartSeries.AddItem(C, "C");
        chartSeries.AddItem(D, "D");
        chartSeries.AddItem(E, "E");

        RCStudent.AddChartSeries(chartSeries);
    }
Ejemplo n.º 2
0
    public void PopulateStudentName()
    {
        int    Present = 0;
        int    Absent  = 0;
        int    count   = 0;
        AbcDAL MyDAL   = new AbcDAL("");

        DataTable ResultTable = MyDAL.SelectStudentByAuthID(1);

        if (ResultTable.Rows.Count != 0)
        {
            Piechart();
            string StudentID = ResultTable.Rows[0]["StudentID"].ToString().Trim();

            RLName.Text    = ResultTable.Rows[0]["StudentName"].ToString();
            RLPhoneNo.Text = ResultTable.Rows[0]["PhoneNo"].ToString();
            RLAddress.Text = ResultTable.Rows[0]["Address"].ToString();

            DataTable ResultTableClass = MyDAL.PopulateClassByStudentID(StudentID);

            //string Attendance = ResultTableClass.Rows[0]["Attendance"].ToString().Trim();
            foreach (DataRow row in ResultTableClass.Rows)
            {
                if (ResultTableClass.Rows[count]["Attendance"].ToString().Trim() == "Present")
                {
                    Present++;
                }
                else
                {
                    Absent++;
                }
                count++;
            }
            if (Present == Absent)
            {
                RLAttendance.Text = "Fair";
            }

            else if (Present > Absent)
            {
                RLAttendance.Text = "Good";
            }
            else
            {
                RLAttendance.Text = "Poor";
            }
        }
        else
        {
            RLName.Text       = "Super Admin";
            RLAttendance.Text = "Super Admin has Logged in";
        }
    }
Ejemplo n.º 3
0
    public void DropdownlistGrade()
    {
        AbcDAL    MyDAL       = new AbcDAL("");
        DataTable ResultTable = new DataTable();

        ResultTable = MyDAL.PopulateClassByStudentID(RCBStudentName.SelectedValue.ToString().Trim());
        string grade;

        int count = 0;

        foreach (DataRow row in ResultTable.Rows)
        {
            grade = ResultTable.Rows[count]["Grade"].ToString().Trim();
            if (RCBSubject.SelectedValue.ToString().Trim() == ResultTable.Rows[count]["SubjectID"].ToString().Trim())
            {
                if (grade == "A")
                {
                    RDDLGrade.SelectedIndex = 1;
                    break;
                }
                else if (grade == "B")
                {
                    RDDLGrade.SelectedIndex = 2;
                    break;
                }
                else if (grade == "C")
                {
                    RDDLGrade.SelectedIndex = 3;
                    break;
                }
                else if (grade == "D")
                {
                    RDDLGrade.SelectedIndex = 4;
                    break;
                }
                else if (grade == "E")
                {
                    RDDLGrade.SelectedIndex = 5;
                    break;
                }
                else if (grade == "F")
                {
                    RDDLGrade.SelectedIndex = 6;
                    break;
                }
            }
            count++;
        }
    }
Ejemplo n.º 4
0
    protected void RCBStudentName_SelectedIndexChanged(object sender, Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs e)
    {
        string Attendance = "";

        RLStudentName.Text = RCBStudentName.Text;
        AbcDAL    MyDAL       = new AbcDAL("");
        DataTable ResultTable = new DataTable();

        ResultTable = MyDAL.PopulateClassByStudentID(RCBStudentName.SelectedValue.ToString().Trim());
        int count     = 0;
        int countStop = 0;

        foreach (DataRow row in ResultTable.Rows)
        {
            Attendance = ResultTable.Rows[count]["Attendance"].ToString().Trim();
            if (RCBSubject.SelectedValue.ToString().Trim() == ResultTable.Rows[count]["SubjectID"].ToString().Trim())
            {
                DropdownlistGrade();
                ClassID = ResultTable.Rows[count]["ClassID"].ToString();
                if (Attendance == "Present")
                {
                    countStop++;
                    RDDLAttendance.SelectedIndex = 0;
                    break;
                }
                else if (Attendance == "Absent")
                {
                    countStop++;
                    RDDLAttendance.SelectedIndex = 1;
                    break;
                }
                else
                {
                    countStop++;
                    RDDLAttendance.SelectedIndex = 2;
                    break;
                }
            }

            count++;
        }

        if (countStop == 0)
        {
            RDDLAttendance.SelectedIndex = 2;
        }
    }