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