public JsonResult Edit(UserPermissionModel model) { if (model == null) { return(Json(new { result = 0, msg = "无法获取数据对象" })); } var result = 0; if (string.IsNullOrWhiteSpace(model.EndVersion)) { model.EndVersion = "9.9.9"; } model.LastUpdateBy = HttpContext.User.Identity.Name; if (model.Id <= 0) { model.CreateBy = model.LastUpdateBy; result = DALUserPermission.Add(model); } else { model.LastUpdateDateTime = DateTime.Now; result = DALUserPermission.Update(model); } var oprLog = new Tuhu.Provisioning.DataAccess.Entity.OprLog { ObjectID = model.Id, ObjectType = "UserPermission", Author = HttpContext.User.Identity.Name, Operation = model.Id > 0 ? "更新" : "新增" + "UserLivingRights配置" }; var operLogManager = new Business.OprLogManagement.OprLogManager(); return(Json(new { result = result, msg = "操作成功" })); }