/// <summary> /// 按照关键字段删除 /// </summary> /// <param name="Id">关键字段</param> /// <returns>是否成功</returns> public bool DelSysRole(string Id) { using (ISysRoleBLL SysRoleBLL = BLLContainer.Resolve <ISysRoleBLL>()) { try { SysRole item = SysRoleBLL.GetFirstOrDefault(Id); return(SysRoleBLL.Delete(item)); } catch { return(false); } } }
/// <summary> /// 按照关键字段删除 /// </summary> /// <param name="Ids">关键字段数组</param> /// <returns>是否成功</returns> public bool DelSysRoles(string[] Ids) { using (ISysRoleBLL SysRoleBLL = BLLContainer.Resolve <ISysRoleBLL>()) { try { List <SysRole> entitys = new List <SysRole>(); foreach (string id in Ids) { SysRole item = SysRoleBLL.GetFirstOrDefault(id); entitys.Add(item); } return(SysRoleBLL.Delete(entitys)); } catch { return(false); } } }