/// <summary> /// 添加权限 /// </summary> /// <param name="model"></param> /// <param name="msg"></param> /// <returns></returns> public bool AddPms(Model.PermissionInfo model, out string msg) { //if (string.IsNullOrWhiteSpace(model.PermissionKey)) //{ // msg = "权限键值代码不能为空!"; // return false; //} //if (IsRepeatPmsKey(model.PermissionKey)) //{ // msg = "权限键值代码重复!"; // return false; //} model.PermissionID = long.Parse(GetGUID(Common.TransacType.PermissionAdd)); bool result = Add(model); if (result) { msg = "添加成功!"; } else { msg = "添加失败!"; } return(result); }
/// <summary> /// 判断权限键值代码是否重复 /// </summary> /// <param name="pmsKey"></param> /// <returns></returns> public bool IsRepeatPmsKey(string pmsKey) { Model.PermissionInfo model = GetPmsByPmsKey(pmsKey); if (model != null) { return(true); } return(false); }