/// <summary> /// /// </summary> public void Get练习的日期() { int FK_User = CurrentUserModel.UserID; DateTime 考核日期 = Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd")); Eastcom.Model.日度练习考核内容 model1 = new Eastcom.BLL.日度练习考核内容().GetModelByUser(FK_User, 考核日期); if (model1 == null) { throw new Exception("对不起,今日你未生成考题,请联系管理员!"); } else { if (model1.提交情况 == Eastcom.ConfigUntility.ConfigArgs.提交情况.已提交.ToString()) { Eastcom.Common.MessageBox.ShowAndJs(this, "您已经提交了不能再次修改答案", "window.location.href='./MyIndex.aspx'"); } FK_YDKHNR = model1.id.ToString(); } //Eastcom.Model.日度练习考核内容_详细 model_3 = new Eastcom.BLL.日度练习考核内容_详细().GetUndoneId(CommonClass.StringHander.Common.GetInt(this.FK_YDKHNR)); //if (model_3 == null) // undoneid = 0; //else // undoneid = Common.GetInt(model_3.考核题目编号); }
/// <summary> /// /// </summary> public void AjaxMethod() { Eastcom.BLL.日度练习考核内容_详细 BLL_model_详细 = new Eastcom.BLL.日度练习考核内容_详细(); Eastcom.BLL.日度练习考核内容 BLL_model_列表 = new Eastcom.BLL.日度练习考核内容(); Eastcom.Model.日度练习考核内容_详细 model_详细 = null; Eastcom.Model.日度练习考核内容 model_列表 = null; StringBuilder strMsg = new StringBuilder(); int isReload = 0;//0:不刷新父页面 1:刷新父页面 bool IsError = false; switch (handleType) //this.PageType { case "Save": #region 保存 model_详细 = BLL_model_详细.GetModelByBH_YD(CommonClass.StringHander.Common.GetInt(FK_YDKHNR), CommonClass.StringHander.Common.GetInt(id)); strMsg.Append(this.CommonModel(model_详细)); if (strMsg.Length == 0) { if (BLL_model_详细.Update(model_详细)) { IsError = false; strMsg.Append(""); Get练习的日期(); } else { IsError = true; strMsg.Append("更新失败"); } } else { IsError = false; } #endregion break; case "Submit": #region 提交 //List<Eastcom.Model.日度练习考核内容_详细> ModelList = new List<Eastcom.Model.日度练习考核内容_详细>(); //ModelList = BLL_model_详细.GetModelList("FK_月度考核内容='" + FK_YDKHNR + "'"); //model_列表 = BLL_model_列表.GetModel(Common.GetInt(FK_YDKHNR)); //decimal 总得分 = 0; //if (undoneid != 0) //{ // IsError = true; // strMsg.Append("你还有未完成的题!"); //} //else //{ // foreach (Eastcom.Model.月度考核内容_详细 m in ModelList) // { // string 用户答案 = m.用户答案 == "" ? ",,," : m.用户答案; // Eastcom.Model.考试题库 model_题库 = new Eastcom.Model.考试题库(); // model_题库 = new Eastcom.BLL.考试题库().GetModel(Common.GetInt(m.题目编号)); // if (model_题库 != null) // { // UserPoint c = new UserPoint(); // c = c.Get用户得分情况(用户答案, model_题库.标准答案.Trim()); // m.得分 = c.用户得分; // m.回答情况 = c.得分情况; // BLL_model_详细.Update(m); // 总得分 += Common.GetDecimal(m.得分); // } // } //} //model_列表.得分 = 总得分; //model_列表.提交时间 = DateTime.Now; //model_列表.提交情况 = Eastcom.ConfigUntility.ConfigArgs.提交情况.已提交.ToString(); ////strMsg.Append(this.CommonModel(model_详细)); //if (strMsg.Length == 0) //{ // if (BLL_model_列表.Update(model_列表)) // { // IsError = false; // strMsg.Append("提交成功"); // } // else // { // IsError = true; // strMsg.Append("更新失败"); // } //} //else //{ // IsError = true; //} #endregion break; default: strMsg.Append("页面操作类型不明确,操作失败!"); break; } CommonClass.Message.Log.WriteMessage(new CommonClass.Message.GoAjaxPara() { msg = strMsg.ToString(), isReload = isReload, isError = IsError, msnLog = "", Data = new ExamId() { nextid = nextid.ToString(), preid = preid.ToString(), Undoneid = undoneid.ToString() } }); }