/// <summary> /// 根据关键字段的值获取记录 /// </summary> /// <param name="Id">关键字段的值</param> /// <returns>符合查询条件的记录</returns> public SysRoleUser GetSysRoleUserById(string Id) { using (ISysRoleUserBLL SysRoleUserBLL = BLLContainer.Resolve <ISysRoleUserBLL>()) { SysRoleUser model = SysRoleUserBLL.GetFirstOrDefault(Id); return(model); } }
/// <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); } } }