protected void Page_Load(object sender, EventArgs e) { string strId = Request.QueryString.Get("PaperId"); string strExamId = Request.QueryString.Get("ExamId"); ViewState["BeginTime"] = DateTime.Now.ToString(); ViewState["OrgID"] = PrjPub.CurrentStudent.OrgID; ViewState["StudentID"] = PrjPub.StudentID; if (strId != null && strId != "") { try { ExamResultBLL examResultBLL = new ExamResultBLL(); RailExam.Model.ExamResult examResults = examResultBLL.GetExamResult(int.Parse(strId), int.Parse(strExamId), PrjPub.CurrentStudent.EmployeeID); if (examResults != null) { Response.Write("<script>alert('您已经参加过该考试!'); top.window.close();</script>"); return; } } catch { Pub.ShowErrorPage("无法连接路局服务器,请检查站段服务器网络连接是否正常!"); } ExamBLL examBLL = new ExamBLL(); RailExam.Model.Exam exam = examBLL.GetExam(int.Parse(strExamId)); HiddenFieldExamTime.Value = DateTime.Now.AddMinutes(exam.ExamTime).ToString(); HfExamTime.Value = (exam.ExamTime * 60).ToString(); FillPage(strId); } }
protected void btnAdd_Click(object sender, EventArgs e) { string strId = Request.QueryString.Get("id"); int i = Grid1.Rows.Count; ExamArrange examArrange = new ExamArrange(); ExamBLL examBLL = new ExamBLL(); RailExam.Model.Exam exam = examBLL.GetExam(int.Parse(strId)); if (exam != null) { examArrange.ExamId = int.Parse(strId); examArrange.PaperId = exam.paperId; examArrange.UserIds = "选择考生!"; examArrange.JudgeIds = "选择评卷人!"; examArrange.BeginTime = DateTime.Now; examArrange.EndTime = DateTime.Now.AddHours(1); examArrange.OrderIndex = 1; examArrange.Memo = ""; ExamArrangeBLL examArrangeBLL = new ExamArrangeBLL(); examArrangeBLL.AddExamArrange(examArrange); Grid1.DataBind(); } }
//Fill Grid Subject public void fillGridSubjects() { try { lblError.Text = ""; long Classid = Convert.ToInt64(ddlClasses.SelectedValue); ExamBLL Edal = new ExamBLL(); if (Classid != -1) { List <Exam> examList = Edal.getAllSubjects(Classid); List <Result> re = Rdal.getAllSubjects(Convert.ToInt64(ddlClasses.SelectedValue)); Session["grd"] = examList; gvSubject.DataSource = examList; gvSubject.DataBind(); btnSubmit.Visible = true; } else { gvSubject.DataSource = null; } gvSubject.DataBind(); gvMarks.DataSource = null; gvMarks.DataBind(); } catch (Exception ex) { lblError.Text = "No Data Found"; lblError.Visible = true; lblSuccess.Visible = false; gvSubject.DataSource = null; gvSubject.DataBind(); } }
private bool SettingsAreOK() { PassingRateBLL passingRateBLL = new PassingRateBLL(); int passingRate = passingRateBLL.GetCurrentPassingRate(); if (passingRate == 0) { //Console.WriteLine("PASSING RATE NOT SET"); return(false); } ExamineeFailureBLL examineeFailureBLL = new ExamineeFailureBLL(); int currentWaitDays = examineeFailureBLL.GetCurrentWaitDays(); if (currentWaitDays == 0) { //Console.WriteLine("WAIT DAYS NOT SET"); return(false); } ExamBLL examBLL = new ExamBLL(); bool isIncomplete = false; isIncomplete = examBLL.HasIncompleteExam(); if (isIncomplete) { //Console.WriteLine("INCOMPLETE ACTIVE EXAM"); return(false); } return(true); }
public UCtrlExam() { InitializeComponent(); _subjectBLL = new SubjectBLL(); _subjectList = _subjectBLL.GetSubjectList(); cboSubject.ValueMember = "SubjectId"; cboSubject.DisplayMember = "SubjectName"; cboSubject.DataSource = _subjectList; cboSubject.SelectedIndex = -1; List <KeyValuePair <ExamType, string> > kvp = new List <KeyValuePair <ExamType, string> >(); kvp.Add(new KeyValuePair <ExamType, string>(ExamType.MultipleChoice, "Multiple Choice")); kvp.Add(new KeyValuePair <ExamType, string>(ExamType.TrueOrFalse, "True or False")); kvp.Add(new KeyValuePair <ExamType, string>(ExamType.TypeTheAnswer, "Type the Answer")); cboExamType.ValueMember = "Key"; cboExamType.DisplayMember = "Value"; cboExamType.DataSource = kvp; cboExamType.SelectedIndex = -1; _examBLL = new ExamBLL(); dgvExam.AutoGenerateColumns = false; dgvTotal.AutoGenerateColumns = false; }
public FrmExam(ExamineeTake examineeTake) { InitializeComponent(); _examineeTakeInfo = examineeTake; _examBLL = new ExamBLL(); _examList = _examBLL.GetActiveExamList(); _minutes = _examList.Sum(e => e.TimeLimit); _timeSpan = new TimeSpan(0, _minutes, 0); //_oneSecond = new TimeSpan(0, 0, 1); _subjectScoreList = new List <SubjectScore>(); _questionBankList = new List <QuestionBank>(); foreach (var question in _examList) { _questionBankList.AddRange(question.QuestionBank); } _examScore = 0; _index = 0; _questionNumber = 0; _counter = 0; _millisecond = 0; _doLoop = true; _examineeExamList = _examineeTakeInfo.ExamineeExam.ToList(); _examId = _examineeExamList[_index].ExamId; SetQuestion(); // set the first question }
protected void Page_Load(object sender, EventArgs e) { BindData(); //保存修改 if (Request.Form["SortId"] != null) { Array ids = Request.Form["SortId"].ToString().Split(','); Array numbers = Request.Form["TopicSortNumber"].ToString().Split(','); Array scores = Request.Form["TopicSortScore"].ToString().Split(','); for (int i = 0; i < ids.Length; i++) { Sort sort = new Sort() { SortId = int.Parse(ids.GetValue(i).ToString()), TopicSortNumber = int.Parse(numbers.GetValue(i).ToString()), TopicSortScore = int.Parse(scores.GetValue(i).ToString()) }; ExamBLL examBll = new ExamBLL(); if (examBll.UpdateExamSort(sort) < 0) { alert("修改失败"); return; } } BindData(); alert("修改成功", "ExamSort.aspx"); } BindData(); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { DataSet ds = GetDataSet(); if (ds != null && ds.Tables.Count == 2) { gradesGrid.DataSource = ds; gradesGrid.DataBind(); } else { SessionSet.PageMessage = "数据错误!"; return; } string strId = Request.QueryString.Get("eid"); RailExam.Model.Exam exam = new RailExam.Model.Exam(); ExamBLL eBll = new ExamBLL(); exam = eBll.GetExam(int.Parse(strId)); TextBoxExamCategory.Text = exam.CategoryName; TextBoxExamName.Text = exam.ExamName; TextBoxExamTime.Text = exam.BeginTime.ToString() + "/" + exam.EndTime.ToString(); } }
//确认开始考试 protected void Button2_Click(object sender, EventArgs e) { ExamBLL examBll = new ExamBLL(); StuExamBLL stuExamBll = new StuExamBLL(); examName = examBll.GetExamName(nowExam); nowExam = examBll.GetNowExam(); string sId = TextBox1.Text.Trim(); DateTime now = DateTime.Now.ToLocalTime(); DateTime beginTime = DateTime.Parse(nowExam.ExamBegTime.ToString()); if (DateTime.Compare(now, beginTime) < 0) { infoAlert("请待考试开始"); return; } else { int paperId = stuExamBll.StuBeginExam(sId, nowExam.ExamId.ToString()); //alert(paperId.ToString()); if (paperId > 0) { string examId = examBll.GetNowExam().ExamId.ToString(); Response.Cookies["examId"].Value = examId; //当前考试Id Response.Redirect("ExamMain.aspx"); } else { errAlert("登陆出错,请联系管理员"); } } }
public void FillPage() { int orgID; if (PrjPub.IsServerCenter) { orgID = 0; } else { orgID = Convert.ToInt32(ConfigurationManager.AppSettings["StationID"]); } if (hfEmployeeID.Value != string.Empty) { ExamBLL bkLL = new ExamBLL(); IList <RailExam.Model.Exam> ExamList = bkLL.GetExamByUserId(hfEmployeeID.Value, orgID, PrjPub.ServerNo); string str = ""; foreach (RailExam.Model.Exam exam in ExamList) { str += "<tr><td align='center' style='border: solid 1px #E0E0E0;padding: 5px;white-space:nowrap;'><a onclick=AttendExam('" + exam.ExamId + "','" + exam.paperId + "','" + exam.ExamType + "') href=# title='参加考试' style='font-size:x-large;color: red;cursor:hand; font-weight:bold;text-decoration: underline'> " + exam.ExamName + " </a></td>"; str += "<td align='center' style='border: solid 1px #E0E0E0;padding: 5px;white-space:nowrap;'>" + exam.BeginTime.ToString("f") + "——" + exam.EndTime.ToString("f") + "</td></tr>"; } Response.Write(str); } }
public object ExamBody( dynamic obj ) { string weightsum = obj.weightsum; string BMI = obj.BMI; string fatRate = obj.fatRate; string muscle = obj.muscle; string moisture = obj.moisture; string boneMass = obj.boneMass; string subcutaneousFat = obj.subcutaneousFat; string BMR = obj.BMR; string proteinRate = obj.proteinRate; string physicalAge = obj.physicalAge; string weightScore = obj.weightScore; string clientId = obj.clientId; string result = obj.result; string risk = obj.risk; string advice = obj.advice; var examRet = GetResultModel(result, risk, advice); ExamBLL.SaveBody(weightsum, BMI, fatRate, muscle, moisture, boneMass, subcutaneousFat, BMR, proteinRate, physicalAge, weightScore, clientId, examRet); return(new { Result = true }); }
public object GetAllExamResult(dynamic obj) { string clientId = obj.clientId; int pageNum = obj.pageNum; int pageSize = obj.pageSize; return(ExamBLL.GetAllExamResult(clientId, pageNum, pageSize)); }
//考生开始考试 返回考生的试卷编号 public int StuBeginExam(string sId, string examId) { int res = 0; using (TransactionScope scope = new TransactionScope()) { try { ExamBLL examBll = new ExamBLL(); Student stu = db.Student.First(t => t.StudentId == sId); StuExam stuExam = GetStuExamByExamId(sId, examId); db.SubmitChanges(); int paperId = int.Parse(stuExam.PaperId.ToString()); //考生第一次登陆 if (stu.StuExamState == (int)StudentBLL.StudentExamState.AdmitExam) { stuExam.BeginExamTIme = DateTime.Now.ToLocalTime();//开始答题时间 //初始化考生答案 List <Decimal> topicIds = db.PaperDetail.Where(t => t.PaperId == paperId).Select(t => t.TopicId).ToList(); stuExam.Score = 0; foreach (var item in topicIds) { StuPaper stuPaper = new StuPaper() { TopicId = item, StudentId = sId, StuAnswer = "", ExamId = decimal.Parse(examId) }; db.StuPaper.InsertOnSubmit(stuPaper); } } //修改考生考试状态 开始时间 ip地址 stu.StuExamState = (int)StudentBLL.StudentExamState.Default; stuExam.IPAddress = GetComputerIp(); db.SubmitChanges(); res = paperId; scope.Complete(); } catch (Exception e) { res = 0; } } return(res); }
public List <object> ViewHistory(dynamic obj) { string name = obj.name; string clientId = obj.clientId; DateTime fromDate = obj.fromDate; DateTime endDate = obj.endDate; return(ExamBLL.ViewHistory(name, clientId, fromDate, endDate)); }
public object ExamTemperature(dynamic obj) { float value = obj.value; string clientId = obj.clientId; string result = obj.result; string risk = obj.risk; string advice = obj.advice; var examRet = GetResultModel(result, risk, advice); ExamBLL.SaveTemperature(value, clientId, examRet); return(new { Result = true }); }
public object ExamCardiogram(dynamic obj) { string value = String.Join(",", obj.value); string clientId = obj.clientId; string result = obj.result; string risk = obj.risk; string advice = obj.advice; var examRet = GetResultModel(result, risk, advice); ExamBLL.SaveCardiogram(value, clientId, examRet); return(new { Result = true }); }
public object ExamBloodFat(dynamic obj) { float value = obj.value; string clientId = obj.clientId; string result = obj.result; string risk = obj.risk; string advice = obj.advice; //var examRet = ExamBLL.SimpleExam("bloodfat", value); var examRet = GetResultModel(result, risk, advice); ExamBLL.SaveBloodFat(value, clientId, examRet); return(new { Result = true }); }
public object ExamBloodSugar(dynamic obj) { float value = obj.value; string clientId = obj.clientId; int status = obj.status; string result = obj.result; string risk = obj.risk; string advice = obj.advice; var examRet = GetResultModel(result, risk, advice); ExamBLL.SaveBloodSugar(value, status, clientId, examRet); return(new { Result = true }); }
public object ExamUricAcid(dynamic obj) { float value = obj.value; int sex = obj.sex; string clientId = obj.clientId; string result = obj.result; string risk = obj.risk; string advice = obj.advice; var examRet = GetResultModel(result, risk, advice); ExamBLL.SaveUricAcid(value, sex, clientId, examRet); return(new { Result = true }); }
protected void ImageButton1_Click(object sender, ImageClickEventArgs e) { this.labelTitle.Text = "即将考试"; Grid1.Visible = false; Grid2.Visible = true; Grid3.Visible = false; Grid4.Visible = false; string struesrId = PrjPub.StudentID; ExamBLL bkLL = new ExamBLL(); IList <RailExam.Model.Exam> ExamList1 = bkLL.GetComingExamByUserId(struesrId); this.Grid2.DataSource = ExamList1; this.Grid2.DataBind(); }
public object ExamBloodOxy(dynamic obj) { float value = obj.value; float bpm = obj.bpm; float pi = obj.pi; string clientId = obj.clientId; string result = obj.result; string risk = obj.risk; string advice = obj.advice; var examRet = GetResultModel(result, risk, advice); ExamBLL.SaveBloodOxy(value, bpm, pi, clientId, examRet); return(new { Result = true }); }
//绑定所有题型 protected void bindAllTitleList() { ExamBLL examBll = new ExamBLL(); Exam nowExam = examBll.GetNowExam(); if (nowExam != null) { StuExamBLL stuExamBll = new StuExamBLL(); List <Sort> sorts = stuExamBll.GetExamTopicBySort(studentId, nowExam.ExamId.ToString()); AllTitleList.DataSource = sorts; AllTitleList.DataBind(); } }
//绑定试卷标题 protected void bindHeadLine() { ExamBLL examBll = new ExamBLL(); Exam nowExam = examBll.GetNowExam(); examName = examBll.GetExamName(nowExam); if (examName == null || examName == "") { //Response.Write("<script>alert('获取试卷信息有误')</script>"); Response.Redirect("StuLogIn.aspx"); } headLine.Text = examName; endTime = nowExam.ExamEndTime.ToString(); }
public object ExamBloodPressure(dynamic obj) { float highVal = obj.highVal; float lowVal = obj.lowVal; float heartRate = obj.heartRate; string clientId = obj.clientId; string result = obj.result; string risk = obj.risk; string advice = obj.advice; // var examRet = ExamBLL.ExamBloodPressure(highVal, lowVal); var examRet = GetResultModel(result, risk, advice); ExamBLL.SaveBloodPressure(highVal, lowVal, heartRate, clientId, examRet); return(new { Result = true }); }
//学生登录 protected void Button1_Click(object sender, EventArgs e) { if (TextBox1.Text == "" || TextBox2.Text == "") { errAlert("请输入学号和姓名!"); return; } // stuExamBll = new StuExamBLL(); ExamBLL examBll = new ExamBLL(); StuExamBLL stuExamBll = new StuExamBLL(); Exam nowExam = examBll.GetNowExam();//当前考试 if (nowExam == null) { errAlert("当前暂无考试!"); return; } string erroeInfo = ""; int res = stuExamBll.StuLogIn(TextBox1.Text.Trim(), TextBox2.Text.Trim(), nowExam.ExamId.ToString(), ref erroeInfo); if (res <= 0) { errAlert(erroeInfo); return; } else { Panel1.Visible = false; //判断手机号是否为空 Student stu = db.Student.First(t => t.StudentId == TextBox1.Text.Trim()); if (stu.StudentPhone.Trim() == "") { Panel3.Visible = true; } else { Panel2.Visible = true; // 显示确认开始考试 } examName = examBll.GetExamName(nowExam); string sId = TextBox1.Text.Trim(); //Session["sId"] = sId; Response.Cookies["sId"].Value = sId; } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { ViewState["mode"] = Request.QueryString.Get("mode"); hfMode.Value = ViewState["mode"].ToString(); string strId = Request.QueryString.Get("id"); ExamBLL examBLL = new ExamBLL(); RailExam.Model.Exam exam = examBLL.GetExam(int.Parse(strId)); if (exam != null) { txtPaperName.Text = exam.ExamName; if (exam.paperId != 0) { PaperBLL paperBLL = new PaperBLL(); IList <RailExam.Model.Paper> paperList = paperBLL.GetPaperByPaperId(exam.paperId); if (paperList != null) { Grid1.DataSource = paperList; Grid1.DataBind(); } } } } else { if (!string.IsNullOrEmpty(hfPaperId.Value)) { PaperBLL paperBLL = new PaperBLL(); IList <RailExam.Model.Paper> paperList = paperBLL.GetPaperByPaperId(int.Parse(hfPaperId.Value)); if (paperList != null) { Grid1.DataSource = paperList; Grid1.DataBind(); } } } }
private void BindGrid() { GridView2.DataBind(); if (PrjPub.StudentID != null && PrjPub.StudentID != "") { string struesrId = PrjPub.StudentID; ExamBLL bkLL = new ExamBLL(); IList <RailExam.Model.Exam> ExamList = bkLL.GetExamByUserId(struesrId, 0, PrjPub.ServerNo); this.GridView4.DataSource = ExamList; this.GridView4.DataBind(); //即将考试 IList <RailExam.Model.Exam> ExamList1 = bkLL.GetComingExamByUserId(struesrId); this.GridView3.DataSource = ExamList1; this.GridView3.DataBind(); //历史考试 IList <RailExam.Model.Exam> ExamList2 = bkLL.GetHistoryExamByUserId(struesrId); this.GridView5.DataSource = ExamList2; this.GridView5.DataBind(); gvExamResult.Visible = true; } else { ExamBLL bkLL = new ExamBLL(); IList <RailExam.Model.Exam> ExamList = bkLL.GetNowExam(); this.GridView4.DataSource = ExamList; this.GridView4.DataBind(); IList <RailExam.Model.Exam> ExamList1 = bkLL.GetComingExam(); this.GridView3.DataSource = ExamList1; this.GridView3.DataBind(); IList <RailExam.Model.Exam> ExamList2 = bkLL.GetHistoryExam(); this.GridView5.DataSource = ExamList2; this.GridView5.DataBind(); gvExamResult.Visible = false; } }
private void BindGrid() { ExamBLL examBll = new ExamBLL(); int categoryId = hfCategoryId.Value == "" ? -1 : Convert.ToInt32(hfCategoryId.Value); DateTime beginDate = dateStartDateTime.DateValue == null ? Convert.ToDateTime("0001-01-01") : Convert.ToDateTime(dateStartDateTime.DateValue); DateTime endDate = dateEndDateTime.DateValue == null ? Convert.ToDateTime("0001-01-01") : Convert.ToDateTime(dateEndDateTime.DateValue); int orgId = Convert.ToInt32(Request.QueryString.Get("Orgid")); examsGrid.DataSource = examBll.GetExamsInfoByOrgID(txtExamName.Text, categoryId, beginDate, endDate, orgId, hfIsServer.Value); examsGrid.DataBind(); }
protected void btnSaveAndNext_Click(object sender, EventArgs e) { string strId = Request.QueryString.Get("id"); if (Grid1.Items.Count == 0) { SessionSet.PageMessage = "请先选择试卷!"; return; } if (!string.IsNullOrEmpty(hfPaperId.Value)) { //先删除后新增 ExamBLL examBLL = new ExamBLL(); examBLL.UpdateExamPaper(int.Parse(strId), int.Parse(hfPaperId.Value)); } Response.Redirect("SelectEmployeeDetail.aspx?mode=" + ViewState["mode"].ToString() + "&id=" + strId); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (PrjPub.CurrentLoginUser == null) { Response.Redirect("/RailExamBao/Common/Error.aspx?error=Session过期请重新登录本系统!"); return; } if (PrjPub.IsServerCenter && SessionSet.OrganizationID != 1) { HfUpdateRight.Value = "False"; } else { HfUpdateRight.Value = PrjPub.HasEditRight("手工评卷").ToString(); } hfJudgeId.Value = PrjPub.CurrentLoginUser.EmployeeID.ToString(); string strId = Request.QueryString.Get("eid"); hfExamID.Value = strId; RailExam.Model.Exam exam = new RailExam.Model.Exam(); ExamBLL eBll = new ExamBLL(); exam = eBll.GetExam(int.Parse(strId)); TextBoxExamCategory.Text = exam.CategoryName; TextBoxExamName.Text = exam.ExamName; TextBoxExamTime.Text = exam.BeginTime.ToString() + "/" + exam.EndTime.ToString(); } else { papersGrid.DataBind(); } string strRefresh = Request.Form.Get("Refresh"); if (strRefresh != null && strRefresh != "") { papersGrid.DataBind(); } }