/// <summary> /// 新建对象设置Key值 /// </summary> /// <param name="newobj"></param> void gridViewOperation_CreatingObjectEvent(E_ExamResult newobj) { }
void gridViewOperation_FocusedRowChanged(object sender, E_ExamResult obj) { if (FocusedRowChanged != null) FocusedRowChanged(gridView1, gridView1.GetFocusedRow() as E_ExamResult); }
/// <summary> /// 是否已开始考试,true,之前已开始,false之前没有开始 /// </summary> /// <param name="examid"></param> /// <param name="userid"></param> /// <returns></returns> public bool SendExamStart() { bool result = true; try { E_Examination exam = Exam; ExamAllTime = double.Parse(exam.BySCol1) * 60; string sqlwhere = " where E_ID='" + exam.ID + "' and EP_ID='" + exam.EP_ID + "' and UserID='" + UserID + "'"; IList<E_ExamResult> erlist = Client.ClientHelper.PlatformSqlMap.GetListByWhere<E_ExamResult>(sqlwhere); //没有考试,可以开始考试 if (erlist.Count == 0) { E_ExamResult er = new E_ExamResult(); er.E_ID = exam.ID; er.EP_ID = exam.EP_ID; er.UserID = UserID; er.RealStartTime = GetSysTime(); er.IsExamed = false; Client.ClientHelper.PlatformSqlMap.Create<E_ExamResult>(er); result = false ; } else { E_ExamResult eer = erlist[0]; HasExamTime= GetSysTime().Subtract(eer.RealStartTime).TotalSeconds; } } catch (Exception ee) { } return result; }