public void Question_Add() { var model = new VM_Question(); M_Exam_Sys_Questions questMod = Question_FillMod(); if (Mid > 0) { questBll.GetUpdate(questMod); } else { questMod.p_id = questBll.GetInsert(questMod); } SafeSC.WriteFile(questMod.GetOPDir(), Request.Form["Optioninfo_Hid"]); if (model.IsSmall > 0)//判断当前是否是添加小题状态 { DataTable dt = questBll.SelByIDSForType(questMod.p_id.ToString()); string json = JsonConvert.SerializeObject(dt); //function.Script(this, "parent.SelQuestion(" + json + ")"); } else { function.WriteSuccessMsg("操作成功!", "QuestList?NodeID=" + model.NodeID); return; } }
public ActionResult SmallQuest_Add() { M_Exam_Sys_Questions questMod = Question_FillMod(); questMod.IsSmall = 1; if (Mid > 0) { questBll.GetUpdate(questMod); } else { questMod.p_id = questBll.GetInsert(questMod); } DataTable dt = questBll.SelByIDSForType(questMod.p_id.ToString()); string json = JsonConvert.SerializeObject(dt); return(Content("<Script>parent.SelQuestion(" + json + "," + Mid + ");</Script>")); }
/// <summary> /// 保存事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void EBtnSubmit_Click(object sender, EventArgs e) { string[] cont = GetContent(); bq = new B_Exam_Sys_Questions(); int id = DataConverter.CLng(hfpid.Value); M_Exam_Sys_Questions questions = bq.GetSelect(id); questions.p_Shipin = hffilename.Value; questions.p_shuming = this.shuming.Text; questions.p_Content = this.txtP_Content.Text; questions.p_ChoseNum = DataConverter.CLng(ddlNumber1.SelectedValue); questions.p_defaultScores = DataConverter.CFloat(txtCourse.Text); if (cont != null && cont.Length > 0) { questions.p_Answer = cont[1]; } if (cont != null && cont.Length > 0) { SafeSC.WriteFile(M_Exam_Sys_Questions.OptionDir + id + ".opt", cont[0]); } //questions.p_Optioninfo = cont[0]; if (id > 0) //修改 { bool result = bq.GetUpdate(questions); if (result) { function.WriteSuccessMsg("修改成功!"); Response.Write("<script>window.close();</script>"); } else { function.WriteErrMsg("修改失败!"); } } else //添加 { questions.p_Type = DataConverter.CLng(ddlType.SelectedValue); questions.p_Inputer = badmin.GetAdminLogin().AdminName; //当前登录ID questions.p_CreateTime = DateTime.Now.Date; questions.p_Views = 1; questions.parentId = DataConverter.CLng(hfParentId.Value); int result = bq.GetInsert(questions); if (result > 0) { Response.Write("<script>alert('添加成功!');window.close();</script>"); } else { function.WriteErrMsg("添加失败!"); } } }
public void Question_Add() { var model = new VM_Question(); M_Exam_Sys_Questions questMod = Question_FillMod(); if (Mid > 0) { questBll.GetUpdate(questMod); } else { questMod.p_id = questBll.GetInsert(questMod); } SafeSC.WriteFile(questMod.GetOPDir(), Request.Form["Optioninfo_Hid"]); function.WriteSuccessMsg("操作成功!", "QuestList?NodeID=" + model.NodeID); return; }
public IActionResult Question_Add() { var model = new VM_Question(HttpContext); M_Exam_Sys_Questions questMod = Question_FillMod(); if (Mid > 0) { questBll.GetUpdate(questMod); } else { questMod.p_id = questBll.GetInsert(questMod); } SafeC.WriteFile(questMod.GetOPDir(), RequestEx["Optioninfo_Hid"]); return(WriteOK("操作成功!", "QuestList?NodeID=" + model.NodeID)); }
// 保存 protected void EBtnSubmit_Click(object sender, EventArgs e) { M_Exam_Sys_Questions questMod = FillMod(); if (Mid > 0) { questBll.GetUpdate(questMod); } else { questMod.p_id = questBll.GetInsert(questMod); } SafeSC.WriteFile(questMod.GetOPDir(), Optioninfo_Hid.Value); if (IsSmall > 0)//判断当前是否是添加小题状态 { DataTable dt = questBll.SelByIDSForType(questMod.p_id.ToString()); string json = JsonConvert.SerializeObject(dt); function.Script(this, "parent.SelQuestion(" + json + ")"); } else { function.WriteSuccessMsg("操作完成!", "QuestList.aspx?NodeID=" + NodeID); } }