private void GetBook(HttpContext context) { Edu_BookService MajorBll = new Edu_BookService(); try { Hashtable ht = new Hashtable(); ht.Add("PageIndex", context.Request["PageIndex"].SafeToString()); ht.Add("PageSize", context.Request["PageSize"].SafeToString()); ht.Add("Name", context.Request["Name"].SafeToString()); bool Ispage = true; if (context.Request["Ispage"].SafeToString().Length > 0) { Ispage = Convert.ToBoolean(context.Request["Ispage"]); } jsonModel = MajorBll.GetPage(ht, Ispage); } catch (Exception ex) { jsonModel = new JsonModel() { errNum = 400, errMsg = ex.Message, retData = "" }; LogService.WriteErrorLog(ex.Message); } }
private void AddBook(HttpContext context) { Edu_BookService MajorBll = new Edu_BookService(); try { Edu_Book entity = new Edu_Book(); entity.MajorID = Convert.ToInt32(context.Request["MajorID"]); entity.Name = context.Request["Name"].SafeToString(); entity.VersionID = Convert.ToInt32(context.Request["VersionID"]); entity.SubID = Convert.ToInt32(context.Request["SubID"]); jsonModel = MajorBll.Add(entity); } catch (Exception ex) { jsonModel = new JsonModel() { errNum = 400, errMsg = ex.Message, retData = "" }; LogService.WriteErrorLog(ex.Message); } }