Esempio n. 1
0
    protected string LoadPersonalExmST()
    {
        try
        {
            DataAccess.ExamManager ExamMng = new DataAccess.ExamManager(_strConnectionString, _intTimeOut, _strDBSchema);

            // No Of Question
            int intNoOfQ = 0;
            intNoOfQ = ExamMng.GetSumNumberQuestion(_MBRInfo.MBR_IDCARD, true);

            //Total Point
            int intTotalPoint = 0;
            intTotalPoint = ExamMng.GetSumPoint(_MBRInfo.MBR_IDCARD, false);

            //Point Per Week
            int intPointPerWeek = 0;
            intPointPerWeek = ExamMng.GetSumPoint(_MBRInfo.MBR_IDCARD, true);

            //Label lbAccInfoST = (Label)Master.FindControl("lbAccInfoST");

            //lbAccInfoST.Text = AccInfo.DSPL_NM + " | �դ�ṹ��� " + intTotalPoint.ToString() + " ��ṹ";

            string strResult = _MBRInfo.MBR_USR_NM + " | Total Score " + intTotalPoint.ToString() + " Points";

            return strResult;
        }
        catch
        {
            //Response.Redirect("Error.aspx", false);
            return "";
        }
    }
Esempio n. 2
0
    private Boolean SaveTXN(DataAccess.TXN_Exam TXN)
    {
        try
        {
            DataAccess.ExamManager ExamMng = new DataAccess.ExamManager(_strConnectionString, _intTimeOut, _strDBSchema);

            return ExamMng.InserTXNExam(TXN);

        }
        catch
        {
            return false;
        }
    }
Esempio n. 3
0
    private void LoadExam()
    {
        try
        {
            lbCorrectResult.Visible = false;
            lbCorrectResult.Text = "";
            //int intNoOfQ = 0;
            int intNoRemainExam = 0;

            DataAccess.Exam QExam = new DataAccess.Exam();
            DataAccess.ExamManager ExamMng = new DataAccess.ExamManager(_strConnectionString, _intTimeOut, _strDBSchema);

            intNoRemainExam = ExamMng.GetNoRemainQuestion(_MBRInfo.MBR_IDCARD);

            if (intNoRemainExam < _intLimitQuestionPerWeek)
            {
                _intLimitQuestionPerWeek = intNoRemainExam;
            }

            //intNoOfQ = ExamMng.GetSumNumberQuestion(_AccInfo.AC_ID, true);
            //QExam = ExamMng.LoadExam(_AccInfo.AC_ID,_intLimitQuestionPerWeek);
            QExam = ExamMng.LoadExam(_MBRInfo.MBR_IDCARD, _intLimitQuestionPerWeek, _intStartDTOfWeek, _DTStartDTcampaign);

            if (QExam == null)
            {
                Response.Redirect("CompletePerWeek.aspx",false);
            }
            else
            {
                if (string.IsNullOrEmpty(QExam.QSTN_ID.ToString()))
                {
                    Response.Redirect("CompletePerWeek.aspx",false);
                }
                else
                {
                    if (QExam.QSTN_ID == "xxx")
                    {
                        Response.Redirect("Error.aspx", false);
                    }
                    else
                    {
                        MapQuestionToImg(QExam);

                        Session.Remove("Exam");
                        Session["Exam"] = QExam;
                    }
                }
            }

        }
        catch
        {
            Response.Redirect("Error.aspx",false);
        }
    }
Esempio n. 4
0
    private void LoadTheWinner()
    {
        try
        {
            ContentPlaceHolder cph = (ContentPlaceHolder)this.Master.FindControl("MainContentPlaceHolder");
            Label lbTheWinner = (Label)cph.FindControl("lbTheWinner");

            DataTable dtbResult = new DataTable();
            DataAccess.ExamManager ExamMng = new DataAccess.ExamManager(_strConnectionString, _intTimeOut, _strDBSchema);

            string strIsTimeToWinner = "";
            strIsTimeToWinner = ConfigurationManager.AppSettings["IsTimeToWinner"].ToString();

            if (strIsTimeToWinner == "Y")
            {
                DateTime StartDT;
                DateTime EndDT;

                StartDT = DateTime.Parse(ConfigurationManager.AppSettings["StartDTWinner"].ToString());
                EndDT = DateTime.Parse(ConfigurationManager.AppSettings["EndDTWinner"].ToString());

                dtbResult = ExamMng.GetWinnerByDate(StartDT, EndDT);

                if (dtbResult == null)
                {
                    lbTheWinner.Visible = false;

                }
                else
                {
                    if (dtbResult.Rows.Count == 0)
                    {
                        lbTheWinner.Visible = false;

                    }
                    else
                    {
                        if(string.IsNullOrEmpty(dtbResult.Rows[0][0].ToString()))
                        {
                            lbTheWinner.Visible = false;

                        }
                        else
                        {

                            lbTheWinner.Visible = true;
                            lbTheWinner.Text = "��骹Ф�� �س " + dtbResult.Rows[0]["Name"].ToString() + " ���¤�ṹ " + dtbResult.Rows[0]["Point"].ToString() + " ��ṹ";
                        }
                    }
                }

            }
            else
            {
                lbTheWinner.Visible = false;

            }

        }
        catch
        {
            Response.Redirect("Error.aspx",false);
        }
    }