Exemple #1
0
        public GroupList SelectRows(DbTransaction pTran, System.Int32?Id, System.String name)
        {
            GroupList GroupList = new GroupList();
            Exception exception = null;

            DbParameter[] Parameters = new DbParameter[2];
            Parameters[0] = _getIdParameter(Id, ParameterDirection.Input);
            Parameters[1] = _getnameParameter(name, ParameterDirection.Input);

            DbDataReader Dr = ExecuteReader(pTran, "[Lookups].[SelectGroup]", Parameters);

            try
            {
                if (Dr != null)
                {
                    while (Dr.Read())
                    {
                        Group Group = new Group();
                        if (Dr["Id"] != DBNull.Value)
                        {
                            Group.Id = (System.Int32)Dr["Id"];
                        }
                        if (Dr["name"] != DBNull.Value)
                        {
                            Group.name = (System.String)Dr["name"];
                        }
                        if (Dr["status"] != DBNull.Value)
                        {
                            Group.status = (System.Boolean?)Dr["status"];
                        }
                        GroupList.FillRow(Group);
                        Group = null;
                    }
                }
            }
            catch (Exception Ex)
            {
                exception = Ex;
            }
            finally
            {
                if (Dr != null)
                {
                    if (Dr.IsClosed == false)
                    {
                        Dr.Close();
                    }
                    Dr = null;
                }
            }
            return(GroupList);
        }