public virtual bool Create(SysPermissionModel model) { try { tbl_SysPermission entity = m_Rep.GetById(model.Id); if (entity != null) { return(false); } entity = new tbl_SysPermission(); entity.Id = model.Id; entity.RoleId = model.RoleId; entity.ModuleId = model.ModuleId; entity.IsShow = model.IsShow; if (m_Rep.Create(entity)) { return(true); } else { return(false); } } catch (Exception ex) { return(false); } }
public virtual SysPermissionModel GetById(string id) { if (IsExists(id)) { tbl_SysPermission entity = m_Rep.GetById(id); SysPermissionModel model = new SysPermissionModel(); model.Id = entity.Id; model.RoleId = entity.RoleId; model.ModuleId = entity.ModuleId; model.IsShow = entity.IsShow; return(model); } else { return(null); } }