Ejemplo n.º 1
0
        /// <summary>
        /// notice exam coming
        /// </summary>
        /// <param name="userId">userid</param>
        /// <returns>stduent's coming exam Name datatable</returns>
        public ExamDS.ExamNoticeDataTable GetExamNoticeById(int userId)
        {
            ExamManager examManager = new ExamManager();

            OesWCFContract.ExamDS.ExamNoticeDataTable table = new ExamDS.ExamNoticeDataTable();
            table.Merge(examManager.GetExamNoticeById(userId));
            return(table);
        }
Ejemplo n.º 2
0
        //Notice content
        private void LoadExamNotice(int userId)
        {
            ExamService.ExamServiceClient examManager = new ExamService.ExamServiceClient();
            ExamDS.ExamNoticeDataTable    table       = examManager.GetExamNoticeById(userId);
            foreach (var item in table)
            {
                FlowLayoutPanel panel = new FlowLayoutPanel();
                panel.AutoSize = false;
                panel.Height   = 20;
                panel.Width    = 700;

                Label fragStart = new Label();
                fragStart.Height   = 20;
                fragStart.AutoSize = true;
                fragStart.Text     = item.No + FRAG_STR;

                Label fragExamName = new Label();
                fragExamName.Height    = 20;
                fragExamName.Width     = 30;
                fragExamName.AutoSize  = true;
                fragExamName.ForeColor = Color.FromArgb(41, 103, 147);
                fragExamName.Text      = BACKSLASH + item.exam_name + BACKSLASH;
                fragExamName.Cursor    = Cursors.Hand;
                fragExamName.Click    += (object sender, EventArgs e) =>
                {
                    FormPassValue.languageState      = Thread.CurrentThread.CurrentCulture.ToString();
                    FormPassValue.currentWindowState = this.WindowState;
                    FormPassValue.isNoticeStart      = 1;

                    ExamDescription examDescription = new ExamDescription();
                    FormPassValue.examId = item.id;
                    DialogResult result = examDescription.ShowDialog();

                    if (result == DialogResult.OK)
                    {
                        FormTakeExam formTakeExam = new FormTakeExam();
                        formTakeExam.Show(this);
                        this.Hide();
                    }
                };

                DateTime dateTime = item.effective_time;
                string   yearStr  = dateTime.Year + SHORT_LINE + dateTime.Month + SHORT_LINE + dateTime.Day;
                string   timeStr  = dateTime.Hour + COLON + (dateTime.Minute.ToString().Equals(ZERO) ? ZEROTWO : dateTime.Minute.ToString()) + DOT;

                Label fragEnd = new Label();
                fragEnd.Height   = 20;
                fragEnd.AutoSize = true;
                fragEnd.Text     = FRAGSTRTWO + yearStr + EMPTY_STR + timeStr;

                panel.Controls.Add(fragStart);
                panel.Controls.Add(fragExamName);
                panel.Controls.Add(fragEnd);

                this.pnlNoticeContent.Controls.Add(panel);
            }
        }
Ejemplo n.º 3
0
        public void TestGetExamNoticeById()
        {
            ExamDS.ExamNoticeDataTable table = examManager.GetExamNoticeById(userId);

            foreach (var item in table)
            {
                Assert.AreEqual("computer", item.exam_name);
                Assert.AreEqual("2015-10-1 0:00:00", item.effective_time.ToString());
            }
        }