protected void Callback1_Callback(object sender, CallBackEventArgs e) { try { string strId = ViewState["ExamID"].ToString(); RandomExamResultCurrentBLL objResultCurrentBll = new RandomExamResultCurrentBLL(); RailExam.Model.RandomExamResultCurrent objResultCurrent = objResultCurrentBll.GetRandomExamResult(Convert.ToInt32(ViewState["RandomExamResultID"].ToString())); if (objResultCurrent.RandomExamId == 0) { hfStart.Value = "2"; } else { objResultCurrent.ExamTime = Convert.ToInt32(ViewState["LastExamTime"].ToString()) + GetSecondBetweenTwoDate(DateTime.Now, DateTime.Parse(ViewState["BeginTime"].ToString())); objResultCurrentBll.UpdateRandomExamResultCurrent(objResultCurrent); RandomExamBLL objBll = new RandomExamBLL(); RailExam.Model.RandomExam objRandomExam = objBll.GetExam(Convert.ToInt32(strId)); hfStart.Value = objRandomExam.IsStart.ToString(); } if (hfStart.Value == "2") { RandomExamResultBLL objResultBll = new RandomExamResultBLL(); RandomExamResult objResult = objResultBll.GetNewRandomExamResultByExamineeID(Convert.ToInt32(ViewState["EmployeeID"].ToString()), Convert.ToInt32(strId)); hfResultID.Value = objResult.RandomExamResultId.ToString(); } } catch { hfStart.Value = "-1"; } hfResultID.RenderControl(e.Output); hfStart.RenderControl(e.Output); }