AJH.CMS.Core.Data.UserDataMapper.GetUsersNotInForm C# (CSharp) Method

GetUsersNotInForm() static private method

static private GetUsersNotInForm ( int FormID ) : List
FormID int
return List
        internal static List<User> GetUsersNotInForm(int FormID)
        {
            List<User> colUsers = null;
            User user = null;

            using (SqlConnection sqlConnection = new SqlConnection(CMSCoreBase.CMSCoreConnectionString))
            {
                SqlCommand sqlCommand = new SqlCommand(SN_USER_GET_NOT_IN_FORM, sqlConnection);
                sqlCommand.CommandType = System.Data.CommandType.StoredProcedure;

                SqlParameter parameter = new SqlParameter(FormDataMapper.PN_FORM_ID, System.Data.SqlDbType.Int);
                parameter.Direction = System.Data.ParameterDirection.Input;
                parameter.Value = FormID;
                sqlCommand.Parameters.Add(parameter);

                sqlCommand.Connection.Open();
                using (SqlDataReader sqlDataReader = sqlCommand.ExecuteReader(System.Data.CommandBehavior.CloseConnection))
                {
                    colUsers = new List<User>();
                    while (sqlDataReader.Read())
                    {
                        user = GetUser(colUsers, sqlDataReader);
                        FillFromReader(user, sqlDataReader);
                    }

                    sqlDataReader.Close();
                    sqlCommand.Connection.Close();
                }
            }
            return colUsers;
        }