private void AddExamDesc() { var obj = new { code = 0, msg = "" }; try { Models.examDescription examDesc = new Models.examDescription { costTime = Request.Form["costTime"].AsInt(), isPublished = Request.Form["isPublished"].AsInt(), passScore = Request.Form["passScore"].AsInt(), title = Request.Form["title"].AsString(), }; new BLL.examDescriptionBLL().Insert(examDesc); } catch (Exception ex) { obj = new { code = 99, msg = ex.Message }; } ResponseJson(obj); }
private void DelExamDesc() { var obj = new { code = 0, msg = "" }; try { string data = Request.Form["data"]; var exam_desc_ids = Newtonsoft.Json.JsonConvert.DeserializeObject <int[]>(data); var bll = new BLL.examDescriptionBLL(); foreach (int id in exam_desc_ids) { Models.examDescription examDesc = new Models.examDescription { id = id }; if (examDesc != null) { bll.Delete(examDesc); } } } catch (Exception ex) { obj = new { code = 99, msg = ex.ToString() }; } ResponseJson(obj); }
protected void Page_Load(object sender, EventArgs e) { if (!string.IsNullOrEmpty(action)) { return; } //ID int exam_des_id = Request.QueryString["exam_des_id"].AsInt(); ExamDesc = new BLL.examDescriptionBLL().SingleQuery(new object[] { exam_des_id }); }