Exemplo n.º 1
0
        public static List <ObjectFour> ServerSelByGID(int iGameID)
        {
            Database  dbDCenter = DatabaseFactory.CreateDatabase(sConnRead);
            DbCommand dcServer  = dbDCenter.GetStoredProcCommand("Server_AllSelByGID");

            dbDCenter.AddInParameter(dcServer, "@gameid", DbType.String, iGameID);

            IDataReader       drServer      = dbDCenter.ExecuteReader(dcServer);
            List <ObjectFour> dServerObject = new List <ObjectFour>();

            while (drServer.Read())
            {
                ObjectFour otObject = new ObjectFour();
                otObject.first  = drServer["serverid"].ToString();
                otObject.second = drServer["abbre"].ToString();
                otObject.third  = drServer["servername"].ToString();
                otObject.Fourth = drServer["begintime"].ToString();
                dServerObject.Add(otObject);
            }
            drServer.Close();
            drServer.Dispose();
            return(dServerObject);
        }
Exemplo n.º 2
0
        public static List <ObjectFour> ServerStartAtTime(DateTime dtBegin, DateTime dtEnd)
        {
            Database  dbDCenter = DatabaseFactory.CreateDatabase(sConnRead);
            DbCommand dcServer  = dbDCenter.GetStoredProcCommand("Server_StartAtTime");

            dbDCenter.AddInParameter(dcServer, "@begintime", DbType.DateTime, dtBegin);
            dbDCenter.AddInParameter(dcServer, "@endtime", DbType.DateTime, dtEnd);

            IDataReader       drServer      = dbDCenter.ExecuteReader(dcServer);
            List <ObjectFour> dServerObject = new List <ObjectFour>();

            while (drServer.Read())
            {
                ObjectFour otObject = new ObjectFour();
                otObject.first  = drServer["serverid"].ToString();
                otObject.second = drServer["abbre"].ToString();
                otObject.third  = drServer["gamename"].ToString();
                otObject.Fourth = drServer["begintime"].ToString();
                dServerObject.Add(otObject);
            }
            drServer.Close();
            drServer.Dispose();
            return(dServerObject);
        }