Ejemplo n.º 1
0
        public PaidGroup[] LoadAssosicatedPaidGroup(DBManager db)
        {
            if (this._teacherID == 0)
            {
                return(null);
            }

            String subQuery = "SELECT paid_group_id FROM paid_group_teacher_mapping WHERE teacher_id='" + this._teacherID + "'";
            String sql      = "SELECT * FROM paid_group WHERE paid_group_id IN ( " + subQuery + " )";

            OdbcDataReader         reader = db.Query(sql);
            LinkedList <PaidGroup> list   = new LinkedList <PaidGroup>();

            while (reader.Read())
            {
                list.AddLast(PaidGroup.CreateForm(reader));
            }

            PaidGroup[] entities = new PaidGroup[list.Count];
            int         i        = 0;

            foreach (PaidGroup pg in list)
            {
                entities[i++] = pg;
            }
            return(entities);
        }
Ejemplo n.º 2
0
        public static PaidGroup CreateForm(OdbcDataReader reader)
        {
            PaidGroup paidGroup = new PaidGroup();

            PaidGroup.CreateForm(reader, paidGroup);
            return(paidGroup);
        }
Ejemplo n.º 3
0
        public override bool LoadFromDB(DBManager db, string sqlCriteria)
        {
            OdbcDataReader reader = db.Query("SELECT * FROM paid_group WHERE " + sqlCriteria);

            if (!reader.Read())
            {
                return(false);
            }
            return(PaidGroup.CreateForm(reader, this));
        }
Ejemplo n.º 4
0
        public bool LoadFromDB(DBManager db)
        {
            if (this._paidGroupID == 0)
            {
                return(false);
            }

            OdbcDataReader reader = db.Query("SELECT * FROM paid_group WHERE paid_group_id=" + this._paidGroupID);

            if (!reader.Read())
            {
                return(false);
            }
            return(PaidGroup.CreateForm(reader, this));
        }
Ejemplo n.º 5
0
        public static PaidGroup[] LoadListFromDBCustom(DBManager db, string sqlAll)
        {
            OdbcDataReader         reader = db.Query(sqlAll);
            LinkedList <PaidGroup> list   = new LinkedList <PaidGroup>();

            while (reader.Read())
            {
                list.AddLast(PaidGroup.CreateForm(reader));
            }

            PaidGroup[] entities = new PaidGroup[list.Count];
            int         i        = 0;

            foreach (PaidGroup r in list)
            {
                entities[i++] = r;
            }
            return(entities);
        }