Ejemplo n.º 1
0
        public GambleStoneDailyScheme GetLastGambleStoneDailyScheme()
        {
            GambleStoneDailyScheme lastScheme = null;

            MyDBHelper.Instance.ConnectionCommandSelect(mycmd =>
            {
                string sqlText           = "select * from gamblestonedailyscheme order by id desc limit 1";
                mycmd.CommandText        = sqlText;
                DataTable table          = new DataTable();
                MySqlDataAdapter adapter = new MySqlDataAdapter(mycmd);
                adapter.Fill(table);
                GambleStoneDailyScheme[] schemes = MetaDBAdapter <GambleStoneDailyScheme> .GetGambleStoneDailySchemeFromDataTable(table);
                if (schemes != null && schemes.Length == 1)
                {
                    lastScheme = schemes[0];
                }
                table.Clear();
                table.Dispose();
                adapter.Dispose();
            });

            return(lastScheme);
        }