private bool tryValidate(Model.Department model, out string errMsg) { errMsg = ""; bool re = true; if (model.Name == null || model.Name.Length == 0 || model.Name.Length > 20 || model.Description.Length > 200) { errMsg = "输入数据不合法"; re = false; } if (re && DepartmentManager.CheckRepeat(model)) { errMsg = "不能重复"; re = false; } if (re && model.Modifier != auth.UserId) { errMsg = "登录信息异常,请刷新浏览器以重启应用(APP请退出应用后重新打开)"; re = false; } return(re); }