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