Exemplo n.º 1
0
        public static ArrayList GetCollection(int flag_value)
        {
            MySqlConnection myConn = DBProxy.GetMySqlConnection();

            DBProxy.OpenConnectionForObject(ref myConn);
            MySqlCommand    myCmd = new MySqlCommand("SELECT * from `tablename` WHERE flag_column = " + flag_value, myConn);
            MySqlDataReader myRdr = null;
            ArrayList       aCltn = new ArrayList();

            if (DBProxy.ExecuteSQLReader(ref myCmd, ref myRdr, "GETTER") == false)
            {
                if (myRdr != null && myRdr.IsClosed == false)
                {
                    myRdr.Close();
                }

                DBProxy.CloseConnectionForObject(ref myConn);

                return(aCltn);
            }

            while (myRdr.Read())
            {
                Classname me = new Classname(
                    /* getters */
                    );

                aCltn.Add(me);
            }

            myRdr.Close();
            DBProxy.CloseConnectionForObject(ref myConn);

            return(aCltn);
        }
Exemplo n.º 2
0
        public static ArrayList GetCollection(int flag_value)
        {
            MySqlConnection myConn = DBProxy.GetMySqlConnection();

            DBProxy.OpenConnectionForObject(ref myConn);
            MySqlCommand    myCmd = new MySqlCommand("SELECT * from `tsystransxRecon` WHERE flag_column = " + flag_value, myConn);
            MySqlDataReader myRdr = null;
            ArrayList       aCltn = new ArrayList();

            if (DBProxy.ExecuteSQLReader(ref myCmd, ref myRdr, "GETTER") == false)
            {
                if (myRdr != null && myRdr.IsClosed == false)
                {
                    myRdr.Close();
                }

                DBProxy.CloseConnectionForObject(ref myConn);

                return(aCltn);
            }

            while (myRdr.Read())
            {
                TsystransxRecon me = new TsystransxRecon(
                    (myRdr.IsDBNull(0) == true ? 0 : myRdr.GetInt32(0))
                    , (myRdr.IsDBNull(1) == true ? 0 : myRdr.GetInt32(1))
                    , (myRdr.IsDBNull(2) == true ? Utility.GetNullDate() : myRdr.GetDateTime(2))
                    , (myRdr.IsDBNull(3) == true ? Utility.GetNullDate() : myRdr.GetDateTime(3))
                    );

                aCltn.Add(me);
            }

            myRdr.Close();
            DBProxy.CloseConnectionForObject(ref myConn);

            return(aCltn);
        }
Exemplo n.º 3
0
        public static ArrayList GetCollection(int flag_value)
        {
            MySqlConnection myConn = DBProxy.GetMySqlConnection();

            DBProxy.OpenConnectionForObject(ref myConn);
            MySqlCommand    myCmd = new MySqlCommand("SELECT * from `eb` WHERE flag_column = " + flag_value, myConn);
            MySqlDataReader myRdr = null;
            ArrayList       aCltn = new ArrayList();

            if (DBProxy.ExecuteSQLReader(ref myCmd, ref myRdr, "GETTER") == false)
            {
                if (myRdr != null && myRdr.IsClosed == false)
                {
                    myRdr.Close();
                }

                DBProxy.CloseConnectionForObject(ref myConn);

                return(aCltn);
            }

            while (myRdr.Read())
            {
                SWEB me = new SWEB(
                    (myRdr.IsDBNull(0) == true ? 0 : myRdr.GetInt32(0))
                    , (myRdr.IsDBNull(1) == true ? "" : myRdr.GetString(1))
                    , (myRdr.IsDBNull(2) == true ? "" : myRdr.GetString(2))
                    , (myRdr.IsDBNull(3) == true ? "" : myRdr.GetString(3))
                    , (myRdr.IsDBNull(4) == true ? "" : myRdr.GetString(4))
                    , (myRdr.IsDBNull(5) == true ? "" : myRdr.GetString(5))
                    , (myRdr.IsDBNull(6) == true ? "" : myRdr.GetString(6))
                    , (myRdr.IsDBNull(7) == true ? "" : myRdr.GetString(7))
                    , (myRdr.IsDBNull(8) == true ? "" : myRdr.GetString(8))
                    , (myRdr.IsDBNull(9) == true ? "" : myRdr.GetString(9))
                    , (myRdr.IsDBNull(10) == true ? "" : myRdr.GetString(10))
                    , (myRdr.IsDBNull(11) == true ? "" : myRdr.GetString(11))
                    , (myRdr.IsDBNull(12) == true ? "" : myRdr.GetString(12))
                    , (myRdr.IsDBNull(13) == true ? "" : myRdr.GetString(13))
                    , (myRdr.IsDBNull(14) == true ? "" : myRdr.GetString(14))
                    , (myRdr.IsDBNull(15) == true ? "" : myRdr.GetString(15))
                    , (myRdr.IsDBNull(16) == true ? "" : myRdr.GetString(16))
                    , (myRdr.IsDBNull(17) == true ? "" : myRdr.GetString(17))
                    , (myRdr.IsDBNull(18) == true ? "" : myRdr.GetString(18))
                    , (myRdr.IsDBNull(19) == true ? "" : myRdr.GetString(19))
                    , (myRdr.IsDBNull(20) == true ? "" : myRdr.GetString(20))
                    , (myRdr.IsDBNull(21) == true ? "" : myRdr.GetString(21))
                    , (myRdr.IsDBNull(22) == true ? "" : myRdr.GetString(22))
                    , (myRdr.IsDBNull(23) == true ? "" : myRdr.GetString(23))
                    , (myRdr.IsDBNull(24) == true ? "" : myRdr.GetString(24))
                    , (myRdr.IsDBNull(25) == true ? "" : myRdr.GetString(25))
                    , (myRdr.IsDBNull(26) == true ? "" : myRdr.GetString(26))
                    , (myRdr.IsDBNull(27) == true ? "" : myRdr.GetString(27))
                    , (myRdr.IsDBNull(28) == true ? "" : myRdr.GetString(28))
                    , (myRdr.IsDBNull(29) == true ? "" : myRdr.GetString(29))
                    , (myRdr.IsDBNull(30) == true ? "" : myRdr.GetString(30))
                    , (myRdr.IsDBNull(31) == true ? "" : myRdr.GetString(31))
                    , (myRdr.IsDBNull(32) == true ? "" : myRdr.GetString(32))
                    , (myRdr.IsDBNull(33) == true ? "" : myRdr.GetString(33))
                    , (myRdr.IsDBNull(34) == true ? "" : myRdr.GetString(34))
                    , (myRdr.IsDBNull(35) == true ? "" : myRdr.GetString(35))
                    , (myRdr.IsDBNull(36) == true ? "" : myRdr.GetString(36))
                    , (myRdr.IsDBNull(37) == true ? "" : myRdr.GetString(37))
                    , (myRdr.IsDBNull(38) == true ? "" : myRdr.GetString(38))
                    , (myRdr.IsDBNull(39) == true ? "" : myRdr.GetString(39))
                    , (myRdr.IsDBNull(40) == true ? "" : myRdr.GetString(40))
                    , (myRdr.IsDBNull(41) == true ? "" : myRdr.GetString(41))
                    , (myRdr.IsDBNull(42) == true ? "" : myRdr.GetString(42))
                    , (myRdr.IsDBNull(43) == true ? "" : myRdr.GetString(43))
                    , (myRdr.IsDBNull(44) == true ? "" : myRdr.GetString(44))
                    , (myRdr.IsDBNull(45) == true ? "" : myRdr.GetString(45))
                    , (myRdr.IsDBNull(46) == true ? "" : myRdr.GetString(46))
                    , (myRdr.IsDBNull(47) == true ? "" : myRdr.GetString(47))
                    , (myRdr.IsDBNull(48) == true ? "" : myRdr.GetString(48))
                    , (myRdr.IsDBNull(49) == true ? "" : myRdr.GetString(49))
                    , (myRdr.IsDBNull(50) == true ? "" : myRdr.GetString(50))
                    , (myRdr.IsDBNull(51) == true ? "" : myRdr.GetString(51))
                    , (myRdr.IsDBNull(52) == true ? "" : myRdr.GetString(52))
                    , (myRdr.IsDBNull(53) == true ? 0 : myRdr.GetInt32(53))
                    , (myRdr.IsDBNull(54) == true ? 0 : myRdr.GetInt32(54))
                    , (myRdr.IsDBNull(55) == true ? "" : myRdr.GetString(55))
                    , (myRdr.IsDBNull(56) == true ? "" : myRdr.GetString(56))
                    );

                aCltn.Add(me);
            }

            myRdr.Close();
            DBProxy.CloseConnectionForObject(ref myConn);

            return(aCltn);
        }