protected void btnreport_Click(object sender, EventArgs e)
    {
        try
        {
            obj_BAL_Student_Dashboard = new Student_DashBoard_BLogic();
            obj_Student_Dashboard     = new StudentDash();

            obj_Student_Dashboard.BMSID     = Convert.ToInt64(Session["BMSID"]);
            obj_Student_Dashboard.SubjectID = Convert.ToInt16(ddlsubject.SelectedValue);
            obj_Student_Dashboard.StudentID = Convert.ToInt64(Session["StudentID"]);

            DataSet dsSettings = new DataSet();

            DataSet dsSelect = new DataSet();
            dsSelect = obj_BAL_Student_Dashboard.BAL_Select_Covered_Syllabus(obj_Student_Dashboard);


            dt1.Columns.Add("Chapter", typeof(string));
            dt1.Columns.Add("Persentage", typeof(string));

            if (dsSelect.Tables[1].Rows.Count > 0)
            {
                for (int j = 0; j < dsSelect.Tables[0].Rows.Count; j++)
                {
                    dt2 = new DataTable("tblTest1");

                    dt2.Columns.Add("Chapter", typeof(string));
                    dt2.Columns.Add("ChapterID", typeof(string));
                    dt2.Columns.Add("TopicID", typeof(string));

                    for (int i = 0; i < dsSelect.Tables[1].Rows.Count; i++)
                    {
                        if (dsSelect.Tables[0].Rows[j]["ChapterID"].ToString() == dsSelect.Tables[1].Rows[i]["ChapterID"].ToString())
                        {
                            DataRow dr;
                            dr              = dt2.NewRow();
                            dr["Chapter"]   = dsSelect.Tables[0].Rows[j]["Chapter"].ToString();
                            dr["ChapterID"] = dsSelect.Tables[0].Rows[j]["ChapterID"].ToString();
                            dr["TopicID"]   = dsSelect.Tables[1].Rows[i]["TopicID"].ToString();
                            dt2.Rows.Add(dr);
                        }
                    }
                    BindGridData1(dt2);
                    Right = 0;
                    Wrong = 0;
                }
            }
            else
            {
                DataTable dt = new DataTable();
                grchapterwiseperformance.DataSource = dt;
                grchapterwiseperformance.DataBind();
            }
        }
        catch (Exception)
        {
            grchapterwiseperformance.DataSource = null;
            grchapterwiseperformance.DataBind();
        }
    }
Ejemplo n.º 2
0
    public void fill_ALL_Covered_Chaptes_Topics()
    {
        obj_BAL_Student_Dashboard = new Student_DashBoard_BLogic();
        obj_Student_Dashboard     = new StudentDash();

        obj_Student_Dashboard.BMSID      = Convert.ToInt64(Session["BMSID"]);
        obj_Student_Dashboard.SubjectID  = Convert.ToInt16(Session["SubjectID"]);
        obj_Student_Dashboard.DivisionID = Convert.ToInt16(Session["DivisionID"]);
        obj_Student_Dashboard.StudentID  = Convert.ToInt64(Session["StudentID"]);
        obj_Student_Dashboard.SchoolID   = Convert.ToInt64(Session["SchoolID"]);

        DataSet dsSelect = new DataSet();

        dsSelect = obj_BAL_Student_Dashboard.BAL_Select_Covered_Syllabus(obj_Student_Dashboard);

        if (dsSelect.Tables.Count == ((int)EnumFile.AssignValue.One))
        {
            if (dsSelect.Tables[0].Rows[0]["NoRecord"].ToString().Equals("0"))
            {
                WebMsg.Show("No Chapter available.");

                DropDownList[] disddl = { ddlChapter, ddlTopic };
                DisableDropDwon(disddl);
            }
        }

        else if (dsSelect.Tables.Count > ((int)EnumFile.AssignValue.Zero) && dsSelect.Tables[0].Rows.Count > ((int)EnumFile.AssignValue.Zero))
        {
            ddlChapter.DataSource     = dsSelect.Tables[0];
            ddlChapter.DataTextField  = "Chapter";
            ddlChapter.DataValueField = "ChapterID";
            ddlChapter.DataBind();
            ddlChapter.Items.Insert(Convert.ToInt32(EnumFile.AssignValue.Zero), new ListItem("-- Select --"));
            ddlChapter.SelectedIndex = Convert.ToInt32(EnumFile.AssignValue.Zero);

            DropDownList[] disddl = { ddlChapter, ddlTopic };
            EnableDropDwon(disddl);


            ViewState["TopicTable"] = (DataTable)dsSelect.Tables[1];

            ddlTopic.DataSource     = dsSelect.Tables[1];
            ddlTopic.DataTextField  = "Topic";
            ddlTopic.DataValueField = "TopicID";
            ddlTopic.DataBind();
            ddlTopic.Items.Insert(Convert.ToInt32(EnumFile.AssignValue.Zero), new ListItem("-- Select --"));
            ddlTopic.SelectedIndex = Convert.ToInt32(EnumFile.AssignValue.Zero);
        }
        else
        {
            DropDownList[] disddl = { ddlChapter, ddlTopic };
            DisableDropDwon(disddl);
        }
    }
Ejemplo n.º 3
0
    public void fill_Covered_Syllabus()
    {
        tvSyllabus.Nodes.Clear();

        obj_BAL_Student_Dashboard = new Student_DashBoard_BLogic();
        obj_Student_Dashboard     = new StudentDash();

        obj_Student_Dashboard.BMSID     = Convert.ToInt64(Session["BMSID"]);
        obj_Student_Dashboard.SubjectID = Convert.ToInt16(Session["SubjectID"]);
        obj_Student_Dashboard.StudentID = Convert.ToInt64(Session["StudentID"]);

        DataSet dsSelect = new DataSet();

        dsSelect = obj_BAL_Student_Dashboard.BAL_Select_Covered_Syllabus(obj_Student_Dashboard);

        if (dsSelect.Tables.Count > ((int)EnumFile.AssignValue.Zero))
        {
            DataTable dtChapter = new DataTable();
            DataTable dtTopic   = new DataTable();

            dtChapter = dsSelect.Tables[0];
            dtTopic   = dsSelect.Tables[1];

            if (dtChapter.Rows.Count > ((int)EnumFile.AssignValue.Zero) && dtTopic.Rows.Count > ((int)EnumFile.AssignValue.Zero))
            {
                foreach (DataRow c in dtChapter.Rows)
                {
                    TreeNode ParentNode = new TreeNode();
                    ParentNode.Text  = c["Chapter"].ToString();
                    ParentNode.Value = c["ChapterID"].ToString();
                    tvSyllabus.Nodes.Add(ParentNode);
                    foreach (DataRow d in dtTopic.Select("ChapterID  = " + Convert.ToInt32(c["ChapterID"].ToString())))
                    {
                        TreeNode ChildNode = new TreeNode();
                        ChildNode.Text  = d["Topic"].ToString();
                        ChildNode.Value = d["TopicID"].ToString();
                        ParentNode.ChildNodes.Add(ChildNode);
                    }
                }
            }
            else
            {
                tvSyllabus.Nodes.Clear();
            }
        }
        else
        {
            tvSyllabus.Nodes.Clear();
        }
    }