예제 #1
0
        protected DataSet GetDataSet()
        {
            string  qsTypeId = Request.QueryString.Get("type");
            string  qsExamId = Request.QueryString.Get("eid");
            DataSet ds       = new DataSet();

            if (!string.IsNullOrEmpty(qsTypeId) && !string.IsNullOrEmpty(qsExamId))
            {
                int     nOrganizationId     = string.IsNullOrEmpty(hfOrganizationId.Value) ? PrjPub.DEFAULT_INT_IN_DB : int.Parse(hfOrganizationId.Value);
                string  strExamineeName     = string.IsNullOrEmpty(txtExamineeName.Text) ? string.Empty : txtExamineeName.Text;
                decimal dScoreLower         = string.IsNullOrEmpty(txtScoreLower.Text) ? 0 : decimal.Parse(txtScoreLower.Text);
                decimal dScoreUpper         = string.IsNullOrEmpty(txtScoreUpper.Text) ? 500 : decimal.Parse(txtScoreUpper.Text);
                int     nExamStatusId       = string.IsNullOrEmpty(ddlStatusId.SelectedValue) ? PrjPub.DEFAULT_INT_IN_DB : int.Parse(ddlStatusId.SelectedValue);
                string  strOrganizationName = string.IsNullOrEmpty(txtOrganizationName.Text) ? string.Empty : txtOrganizationName.Text;

                ExamResultBLL bllExamResult = new ExamResultBLL();
                IList <RailExam.Model.ExamResult> examResults = bllExamResult.GetExamResults(
                    int.Parse(qsExamId), strOrganizationName, strExamineeName, string.Empty, dScoreLower,
                    dScoreUpper, nExamStatusId);

                ExamResultStatusBLL bllExamResultStatus = new ExamResultStatusBLL();
                IList <RailExam.Model.ExamResultStatus> examResultStatuses = bllExamResultStatus.GetExamResultStatuses();

                DataTable dtExamResults = ConvertToDataTable((IList)examResults);


                DataTable dtExamResultStatuses = ConvertToDataTable((IList)examResultStatuses);

                if (dtExamResults != null)
                {
                    ds.Tables.Add(dtExamResults);
                }
                else
                {
                    ds.Tables.Add(ConvertToDataTable(typeof(RailExam.Model.ExamResult)));
                }
                ds.Tables.Add(dtExamResultStatuses);
                ds.Relations.Add(ds.Tables["ExamResultStatus"].Columns["ExamResultStatusId"],
                                 ds.Tables["ExamResult"].Columns["StatusId"]);
            }

            return(ds);
        }
예제 #2
0
        protected DataSet GetDataSet(bool isFirst)
        {
            string  qsExamId = Request.QueryString.Get("eid");
            int     orgID    = Convert.ToInt32(Request.QueryString.Get("OrgID"));
            DataSet ds       = new DataSet();

            if (!string.IsNullOrEmpty(qsExamId))
            {
                string  OrganizationName = txtOrganizationName.Text;
                string  workShopName     = txtWorkShop.Text;
                string  strExamineeName  = txtExamineeName.Text;
                string  strWorkNo        = txtWorkNo.Text;
                decimal dScoreLower      = string.IsNullOrEmpty(txtScoreLower.Text) ? -1000 : decimal.Parse(txtScoreLower.Text);
                decimal dScoreUpper      = string.IsNullOrEmpty(txtScoreUpper.Text) ? 1000 : decimal.Parse(txtScoreUpper.Text);

                IList <RandomExamResult> examResults   = null;
                RandomExamResultBLL      bllExamResult = new RandomExamResultBLL();

                try
                {
                    //RandomExamBLL objBll = new RandomExamBLL();
                    //RailExam.Model.RandomExam obj = objBll.GetExam(Convert.ToInt32(qsExamId));

                    //如果在站段是随到随考,需要综合路局和本地考试情况。
                    //if(obj.StartMode == PrjPub.START_MODE_NO_CONTROL && !PrjPub.IsServerCenter)
                    //{
                    //    examResults = bllExamResult.GetRandomExamResultsFromServer(int.Parse(qsExamId), OrganizationName, strExamineeName, dScoreLower,
                    //         dScoreUpper, orgID);
                    //}
                    //else
                    //{
                    //    examResults = bllExamResult.GetRandomExamResults(int.Parse(qsExamId), OrganizationName, strExamineeName, dScoreLower,
                    //             dScoreUpper, orgID);
                    //}

                    examResults = bllExamResult.GetRandomExamResults(int.Parse(qsExamId), OrganizationName, workShopName, strExamineeName, strWorkNo, dScoreLower,
                                                                     dScoreUpper, orgID);

                    if (isFirst)
                    {
                        lblNowCount.Text = examResults.Count.ToString();
                    }
                }
                catch
                {
                    Pub.ShowErrorPage("无法连接站段服务器,请检查站段服务器是否打开以及网络连接是否正常!");
                }

                ExamResultStatusBLL      bllExamResultStatus = new ExamResultStatusBLL();
                IList <ExamResultStatus> examResultStatuses  = bllExamResultStatus.GetExamResultStatuses();

                DataTable dtExamResults        = ConvertToDataTable((IList)examResults);
                DataTable dtExamResultStatuses = ConvertToDataTable((IList)examResultStatuses);

                if (dtExamResults != null)
                {
                    ds.Tables.Add(dtExamResults);
                }
                else
                {
                    ds.Tables.Add(ConvertToDataTable(typeof(RandomExamResult)));
                }
                ds.Tables.Add(dtExamResultStatuses);
                ds.Relations.Add(ds.Tables["ExamResultStatus"].Columns["ExamResultStatusId"],
                                 ds.Tables["RandomExamResult"].Columns["StatusId"]);
            }

            return(ds);
        }
예제 #3
0
        protected DataSet GetDataSet()
        {
            string  qsTypeId = Request.QueryString.Get("type");
            string  qsExamId = Request.QueryString.Get("eid");
            int     orgID    = Convert.ToInt32(Request.QueryString.Get("OrgID"));
            DataSet ds       = new DataSet();

            if (!string.IsNullOrEmpty(qsTypeId) && !string.IsNullOrEmpty(qsExamId))
            {
                int     nOrganizationId     = string.IsNullOrEmpty(hfOrganizationId.Value) ? PrjPub.DEFAULT_INT_IN_DB : int.Parse(hfOrganizationId.Value);
                string  strExamineeName     = string.IsNullOrEmpty(txtExamineeName.Text) ? string.Empty : txtExamineeName.Text;
                string  strWorkNo           = string.IsNullOrEmpty(txtWorkNo.Text) ? string.Empty : txtWorkNo.Text;
                decimal dScoreLower         = string.IsNullOrEmpty(txtScoreLower.Text) ? 0 : decimal.Parse(txtScoreLower.Text);
                decimal dScoreUpper         = string.IsNullOrEmpty(txtScoreUpper.Text) ? 500 : decimal.Parse(txtScoreUpper.Text);
                int     nExamStatusId       = string.IsNullOrEmpty(ddlStatusId.SelectedValue) ? PrjPub.DEFAULT_INT_IN_DB : int.Parse(ddlStatusId.SelectedValue);
                string  strOrganizationName = string.IsNullOrEmpty(txtOrganizationName.Text) ? string.Empty : txtOrganizationName.Text;

                IList <RailExam.Model.ExamResult> examResults = null;
                ExamResultBLL bllExamResult = new ExamResultBLL();

                try
                {
                    if (orgID == 1)
                    {
                        examResults = bllExamResult.GetExamResults(int.Parse(qsExamId), strOrganizationName, strExamineeName, strWorkNo, dScoreLower,
                                                                   dScoreUpper, nExamStatusId);
                    }
                    else
                    {
                        examResults = bllExamResult.GetExamResultsByOrgID(
                            int.Parse(qsExamId), strOrganizationName, strExamineeName, strWorkNo, dScoreLower,
                            dScoreUpper, nExamStatusId, orgID);
                    }
                }
                catch
                {
                    Pub.ShowErrorPage("无法连接站段服务器,请检查站段服务器是否打开以及网络连接是否正常!");
                }

                ExamResultStatusBLL bllExamResultStatus = new ExamResultStatusBLL();
                IList <RailExam.Model.ExamResultStatus> examResultStatuses = bllExamResultStatus.GetExamResultStatuses();

                DataTable dtExamResults        = ConvertToDataTable((IList)examResults);
                DataTable dtExamResultStatuses = ConvertToDataTable((IList)examResultStatuses);

                if (dtExamResults != null)
                {
                    ds.Tables.Add(dtExamResults);
                }
                else
                {
                    ds.Tables.Add(ConvertToDataTable(typeof(RailExam.Model.ExamResult)));
                }

                ds.Tables.Add(dtExamResultStatuses);
                ds.Relations.Add(ds.Tables["ExamResultStatus"].Columns["ExamResultStatusId"],
                                 ds.Tables["ExamResult"].Columns["StatusId"]);
            }

            return(ds);
        }