You have defined 2 parameters in your stored predure-
@RoleID int=0 output
@FunctionID int
But looking at the code, you are passing more parameters/values-
cmd.Parameters.Add("@FunByRoleID", SqlDbType.Int).Value = functionByRole.FunByRoleID;
cmd.Parameters["@FunByRoleID"].Direction = ParameterDirection.Output;
cmd.Parameters.Add("@FunctionID", SqlDbType.Int).Value = functionByRole.FunctionID;
cmd.Parameters["@FunctionID"].Direction = ParameterDirection.Input;
cmd.Parameters.Add("@RoleID", SqlDbType.Int).Value = functionByRole.RoleID;
cmd.Parameters["@RoleID"].Direction = ParameterDirection.Input;
@FunByRoleID is not defined in the stored procedure and the error message clearly indicates that. From your code it looks like you don't need that paramter. So try removing that section from the code i.e, following lined of code-
cmd.Parameters.Add("@FunByRoleID", SqlDbType.Int).Value = functionByRole.FunByRoleID;
cmd.Parameters["@FunByRoleID"].Direction = ParameterDirection.Output;
Or do the necessary changes and let me know if that helps or you still need help on this.
Thanks :)