void GetExam() { int? examDescId = Request.QueryString["examDescription_id"].AsNullInt(); int limit = Request.QueryString["limit"].AsInt(); int page = Request.QueryString["page"].AsInt(); StringBuilder s_whereCluase = new StringBuilder(); Dictionary <string, object> dic = new Dictionary <string, object>(); if (examDescId != null) { s_whereCluase.AppendAnd("examDescription_id=@examDescription_id"); dic.Add("examDescription_id", examDescId); } List <Models.exam> dataList = new BLL.examBLL().Query(s_whereCluase.ToString(), dic); var tmp = dataList.OrderBy(a => a.orderNo).Skip((page - 1) * limit).Take(limit).ToList(); var obj = new { code = 0, msg = "", count = dataList.Count, data = tmp }; ResponseJson(obj); }
private void DelExam() { var obj = new { code = 0, msg = "" }; try { int id = Request.Form["id"].AsInt(); var bll = new BLL.examBLL(); Models.exam exam = new Models.exam { id = id }; if (exam != null) { bll.Delete(exam); } } catch (Exception ex) { obj = new { code = 99, msg = ex.ToString() }; } ResponseJson(obj); }