public int InsertCateLog(BookCatelogModel entity) { string sql = $@"insert into {tableName}({dbField}) values('{entity.id}','{entity.pId}','{entity.BookId}','{entity.ParentName}','{entity.name}','{entity.sort}','{entity.BookContent}')"; return(db.ExecuteNoneQuery(sql)); }
public ContentResult AddCatelog() { string content = ""; string booktitle = ""; string Bookid = ""; string ParentName = ""; int sort = 0; string pid = ""; string Id = Guid.NewGuid().ToString(); if (string.IsNullOrEmpty(Request["ParentName"])) { ParentName = Request["ParentName"]; } if (!string.IsNullOrEmpty(Request["content"])) { content = Request["content"]; } if (!string.IsNullOrEmpty(Request["booktitle"])) { booktitle = Request["booktitle"]; } if (!string.IsNullOrEmpty(Request["pId"])) { pid = Request["pId"]; } if (!string.IsNullOrEmpty(Request["sort"])) { sort = Convert.ToInt32(Request["sort"]); } if (!string.IsNullOrEmpty(Request["Bookid"])) { Bookid = Request["Bookid"].ToString(); } BookCatelogModel catelogModel = new BookCatelogModel(); catelogModel.id = Id; catelogModel.pId = pid; catelogModel.ParentName = ParentName; catelogModel.BookId = Bookid; catelogModel.name = booktitle; catelogModel.BookContent = content; catelogModel.sort = sort; int result = catelogIBLL.InsertCatelog(catelogModel); return(Content(result.ToString())); }
public int InsertCatelog(BookCatelogModel entity) { return(catelogDao.InsertCateLog(entity)); }