//插入 public ActionResult InserLibrayManagent(IEnumerable <LibrayManagent> adminDatas) { ILibrayManagentDAL dal = new LibrayManagetnDal(ConfigurationManager.AppSettings["assembly"]); ILibrayInsertDatabase update = new InsertData(); bool isUpdate = update.Insert(adminDatas, dal); if (isUpdate) { IGetEntity get = new GetEntity(); ILibrayManagentDAL sc = new LibrayManagetnDal(ConfigurationManager.AppSettings["assembly"]); LibrayManagent adminTable = new LibrayManagent(); var jsonData = get.GetEntitys(x => true, sc).ToList(); //将对象序列化为JSON格式 var json = CreateJson(jsonData); return(Json(json, JsonRequestBehavior.AllowGet)); } return(new HttpStatusCodeResult(404, "无法保存")); }
public ActionResult XzViews() { var adminObj = Session["AdministratorObject"] as AdministratorObject; var account = adminObj.Account; var authority = adminObj.Authority; if (authority != "学籍管理") { return(new HttpStatusCodeResult(404, "您没有权限查看此页面")); } IGetEntity get = new GetEntity(); ISchoolAdministratorDal sc = new SchoolAdministratorDal(ConfigurationManager.AppSettings["assembly"]); SchoolAdministrator adminTable = new SchoolAdministrator(); var jsonData = get.GetEntitys(x => true, sc).ToList(); //将对象序列化为JSON格式 var json = CreateJson(jsonData); return(Json(json, JsonRequestBehavior.AllowGet)); }