Пример #1
0
    protected void BtnSubmit_Click(object sender, EventArgs e)
    {
        BtnPDF.Visible = false;

        obj_BAL_Teacher_Dashboard = new Teacher_Dashboard_BLogic();
        obj_Teacher_Dashboard     = new Teacher_Dashboard();

        obj_Teacher_Dashboard.SchoolID   = Convert.ToInt64(Session["SchoolID"]);
        obj_Teacher_Dashboard.BMSID      = Convert.ToInt64(Session["BMSID"]);
        obj_Teacher_Dashboard.SubjectID  = Convert.ToInt16(Session["SubjectID"]);
        obj_Teacher_Dashboard.DivisionID = Convert.ToInt16(Session["DivisionID"]);
        obj_Teacher_Dashboard.EmployeeID = Convert.ToInt64(Session["EmpolyeeID"]);

        obj_Teacher_Dashboard.ChapterID = Convert.ToInt64(ddlChapter.SelectedValue);
        obj_Teacher_Dashboard.TopicID   = Convert.ToInt64(ddlTopic.SelectedValue);

        Int64 bmssctid = Convert.ToInt64(obj_BAL_Teacher_Dashboard.Get_BMSSCTID(obj_Teacher_Dashboard));

        if (bmssctid == ((int)EnumFile.AssignValue.Zero))
        {
            WebMsg.Show("BMSSCT does not exists.");
        }
        else
        {
            obj_Teacher_Dashboard.BMSSCTID = Convert.ToInt64(bmssctid);

            DataSet dsStudentList = new DataSet();
            dsStudentList = obj_BAL_Teacher_Dashboard.Get_Student_ExamSummary_Report(obj_Teacher_Dashboard);

            if (dsStudentList.Tables[0].Columns.Contains("NoData"))
            {
                GridStudentList.DataSource = null;
                GridStudentList.DataBind();
                WebMsg.Show("No Data Found.");
                BtnPDF.Visible = false;
                return;
            }

            if (dsStudentList.Tables[0].Rows.Count > 0 && dsStudentList.Tables.Count > 0)
            {
                GridStudentList.DataSource = dsStudentList.Tables[0];
                GridStudentList.DataBind();
                Session["StudentResult"] = dsStudentList.Tables[0];
                Session["ChapName"]      = ddlChapter.SelectedItem.ToString();
                Session["TopicName"]     = ddlTopic.SelectedItem.ToString();
                Session["ExamName"]      = "";
                Session["ToatlQues"]     = "";
                Session["ToatlMarks"]    = "";
                BtnPDF.Visible           = true;
            }
            else
            {
                GridStudentList.DataSource = null;
                GridStudentList.DataBind();
                WebMsg.Show("No Data Found.");
                BtnPDF.Visible = false;
            }
        }
    }
    protected void ddlExam_SelectedIndexChanged(object sender, EventArgs e)
    {
        if (ddlExam.SelectedIndex > 0)
        {
            if (ddlTopic.SelectedIndex > 0)
            {
                DataTable dt = (DataTable)ViewState["ExamTable"];

                if (dt.Rows.Count > 0)
                {
                    DataTable dtResult = dt.Clone();
                    DataRow[] dr       = dt.Select("ExamID = " + Convert.ToInt32(ddlExam.SelectedValue));
                    ViewState["ExamID"] = Convert.ToInt32(ddlExam.SelectedValue);
                    foreach (DataRow drLoop in dr)
                    {
                        dtResult.ImportRow(drLoop);
                    }

                    if (dtResult.Rows.Count > 0)
                    {
                        ViewState["TotalMarks"] = dtResult.Rows[0]["TotalMarks"].ToString();
                        TxtTotalQuestions.Text  = dtResult.Rows[0]["TotalQues"].ToString();
                        TxtTotalMarks.Text      = dtResult.Rows[0]["TotalMarks"].ToString();
                    }
                }
                else
                {
                    DropDownList[] disddl = { ddlExam };
                    DisableDropDwon(disddl);

                    TxtTotalQuestions.Text = "0";
                    TxtTotalMarks.Text     = "0";
                }
            }
            else
            {
                DropDownList[] disddl = { ddlExam };
                DisableDropDwon(disddl);

                TxtTotalQuestions.Text = "0";
                TxtTotalMarks.Text     = "0";
            }
        }
        else
        {
            TxtTotalQuestions.Text = "0";
            TxtTotalMarks.Text     = "0";

            GridStudentList.DataSource = null;
            GridStudentList.DataBind();

            GridStudentList.Visible = false;
            btnSave.Visible         = false;
        }
    }
    protected void BtnSubmit_Click(object sender, EventArgs e)
    {
        obj_BAL_Teacher_Dashboard = new Teacher_Dashboard_BLogic();
        obj_Teacher_Dashboard     = new Teacher_Dashboard();

        obj_Teacher_Dashboard.SchoolID   = Convert.ToInt64(Session["SchoolID"]);
        obj_Teacher_Dashboard.BMSID      = Convert.ToInt64(Session["BMSID"]);
        obj_Teacher_Dashboard.DivisionID = Convert.ToInt16(Session["DivisionID"]);
        obj_Teacher_Dashboard.SubjectID  = Convert.ToInt16(Session["SubjectID"]);
        obj_Teacher_Dashboard.ChapterID  = Convert.ToInt64(ddlChapter.SelectedValue);
        obj_Teacher_Dashboard.TopicID    = Convert.ToInt64(ddlTopic.SelectedValue);
        obj_Teacher_Dashboard.ExamID     = Convert.ToInt64(ddlExam.SelectedValue);

        int bmssctid = obj_BAL_Teacher_Dashboard.BAL_Select_BMS_SCTID(obj_Teacher_Dashboard);

        ViewState["BMSSCT"] = bmssctid;

        DataSet dsStudentList = new DataSet();

        dsStudentList = obj_BAL_Teacher_Dashboard.Get_StudentList(obj_Teacher_Dashboard);

        //TrackLog_Utils.Log(Convert.ToInt32(AppSessions.SchoolID), Convert.ToInt32(AppSessions.EmpolyeeID), Convert.ToInt16(AppSessions.DivisionID), "ResultEntryPage", "BtnSubmit", "click", Convert.ToDateTime(System.DateTime.Now), HttpContext.Current.Session.SessionID, StringEnum.stringValueOf(EnumFile.Activity.ResultEntryPage),"", Convert.ToInt32(Session["BMSSCTID"]));
        TrackLog_Utils.Log(Convert.ToInt32(AppSessions.SchoolID), Convert.ToInt32(AppSessions.EmpolyeeID), Convert.ToInt16(AppSessions.DivisionID), "ResultEntryPage", "BtnSubmit", "Click", Convert.ToDateTime(System.DateTime.Now), HttpContext.Current.Session.SessionID, StringEnum.stringValueOf(EnumFile.Activity.StudentListPopulatedForExam), "BMSSCT ID = " + bmssctid + " Exam Name : " + ddlExam.SelectedItem.ToString() + " Exam Marks : " + TxtTotalMarks.Text, bmssctid);

        if (dsStudentList.Tables[0].Rows.Count > 0)
        {
            GridStudentList.Visible    = true;
            btnSave.Visible            = true;
            BtnPDF.Visible             = true;
            Session["ChapName"]        = ddlChapter.SelectedItem.ToString();
            Session["TopicName"]       = ddlTopic.SelectedItem.ToString();
            Session["ExamName"]        = ddlExam.SelectedItem.ToString();
            Session["ToatlQues"]       = TxtTotalQuestions.Text;
            Session["ToatlMarks"]      = TxtTotalMarks.Text;
            Session["StudentResult"]   = dsStudentList.Tables[0];
            GridStudentList.DataSource = dsStudentList.Tables[0];
            GridStudentList.DataBind();
        }
        else
        {
            GridStudentList.DataSource = null;
            GridStudentList.DataBind();
            GridStudentList.Visible = false;
            btnSave.Visible         = false;
            BtnPDF.Visible          = false;
            WebMsg.Show("No student available.");
        }
    }
    public void ClearControls()
    {
        DropDownList[] disddl3 = { ddlChapter, ddlTopic, ddlExam };
        DisableDropDwon(disddl3);

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

        TxtTotalQuestions.Text = "";
        TxtTotalMarks.Text     = "";

        GridStudentList.DataSource = null;
        GridStudentList.DataBind();

        GridStudentList.Visible = false;
        btnSave.Visible         = false;
    }
    protected void ddlTopic_SelectedIndexChanged(object sender, EventArgs e)
    {
        if (ddlTopic.SelectedIndex > 0)
        {
            DropDownList[] disddl = { ddlExam };
            DisableDropDwon(disddl);

            obj_BAL_Teacher_Dashboard = new Teacher_Dashboard_BLogic();
            obj_Teacher_Dashboard     = new Teacher_Dashboard();

            obj_Teacher_Dashboard.BMSID      = Convert.ToInt64(Session["BMSID"]);
            obj_Teacher_Dashboard.SubjectID  = Convert.ToInt16(Session["SubjectID"]);
            obj_Teacher_Dashboard.DivisionID = Convert.ToInt16(Session["DivisionID"]);
            obj_Teacher_Dashboard.EmployeeID = Convert.ToInt64(Session["EmpolyeeID"]);
            obj_Teacher_Dashboard.SchoolID   = Convert.ToInt64(Session["SchoolID"]);
            obj_Teacher_Dashboard.ChapterID  = Convert.ToInt64(ddlChapter.SelectedValue);
            obj_Teacher_Dashboard.TopicID    = Convert.ToInt64(ddlTopic.SelectedValue);

            Int64 bmssctid = Convert.ToInt64(obj_BAL_Teacher_Dashboard.Get_BMSSCTID(obj_Teacher_Dashboard));
            if (bmssctid == ((int)EnumFile.AssignValue.Zero))
            {
                WebMsg.Show("BMSSCT does not exists.");
            }
            else
            {
                obj_Teacher_Dashboard.BMSSCTID = Convert.ToInt64(bmssctid);
                DataSet ds = new DataSet();
                ds = obj_BAL_Teacher_Dashboard.Get_Exams(obj_Teacher_Dashboard);
                DataTable dt = ds.Tables[0];
                ViewState["ExamTable"] = dt;

                ddlExam.Items.Clear();

                if (dt.Rows.Count > 0)
                {
                    ddlExam.DataSource     = dt;
                    ddlExam.DataTextField  = "ExamName";
                    ddlExam.DataValueField = "ExamID";
                    ddlExam.DataBind();
                }
                ddlExam.Items.Insert(0, new System.Web.UI.WebControls.ListItem("-- Select --"));

                DropDownList[] disddl1 = { ddlExam };
                EnableDropDwon(disddl1);
            }
        }
        else
        {
            DropDownList[] disddl1 = { ddlExam };
            DisableDropDwon(disddl1);

            TxtTotalQuestions.Text = "0";
            TxtTotalMarks.Text     = "0";

            GridStudentList.DataSource = null;
            GridStudentList.DataBind();

            GridStudentList.Visible = false;
            btnSave.Visible         = false;
        }
    }