internal bool Parse_configurationInfo_getGame(s2sMessage target, DLGameCollectionDto collection)
        {
            ModuleProc PROC = new ModuleProc(this.DYN_MODULE_NAME, "Parse_configurationInfo_getGame");
            bool result = default(bool);

            try
            {
                configurationInfo ci = target.p_body.p_configuration.p_configurationInfo;
                if (collection != null)
                {
                    List<game> Games = new List<game>();
                    foreach (var dto in collection)
                    {
                        Games.Add(new game()
                        {
                            gameId = dto.GameID.ToStringSafe(),
                            gameName = dto.GameName,
                            gameActive = dto.IsActive,
                        });
                    }
                    ci.game = Games.ToArray();
                    result = true;
                }
            }
            catch (Exception ex)
            {
                Log.Exception(PROC, ex);
            }

            return result;
        }
        internal bool Parse_configurationInfo_getGame(s2sMessage target, DLGameCollectionDto collection)
        {
            ModuleProc PROC   = new ModuleProc(this.DYN_MODULE_NAME, "Parse_configurationInfo_getGame");
            bool       result = default(bool);

            try
            {
                configurationInfo ci = target.p_body.p_configuration.p_configurationInfo;
                if (collection != null)
                {
                    List <game> Games = new List <game>();
                    foreach (var dto in collection)
                    {
                        Games.Add(new game()
                        {
                            gameId     = dto.GameID.ToStringSafe(),
                            gameName   = dto.GameName,
                            gameActive = dto.IsActive,
                        });
                    }
                    ci.game = Games.ToArray();
                    result  = true;
                }
            }
            catch (Exception ex)
            {
                Log.Exception(PROC, ex);
            }

            return(result);
        }
        internal bool Parse_configurationInfo_getGame(s2sMessage target, object source)
        {
            ModuleProc PROC             = new ModuleProc(this.DYN_MODULE_NAME, "Parse_configurationInfo_getGame");
            bool       result           = default(bool);
            getConfigurationGetGame s2s = source as getConfigurationGetGame;

            try
            {
                DLGameCollectionDto collection = _di.GetGames(target.p_body.p_configuration.propertyId, s2s.gameId.s2sStringId());
                result = this.Parse_configurationInfo_getGame(target, collection);
            }
            catch (Exception ex)
            {
                Log.Exception(PROC, ex);
            }

            return(result);
        }
Example #4
0
        public DLGameCollectionDto GetGames(string siteCode, object gameId)
        {
            ModuleProc          PROC   = new ModuleProc(this.DYN_MODULE_NAME, "GetGames");
            DLGameCollectionDto result = new DLGameCollectionDto();

            try
            {
                using (Database db = DbFactory.OpenDB(_connectionString))
                {
                    db.Open();

                    DbParameter[] parameters = db.CreateParameters(2);
                    parameters[0] = db.CreateParameter("@SiteCode", DbType.AnsiString, 50, siteCode);
                    parameters[1] = db.CreateParameter("@GamePrefix", gameId);
                    // if (string.IsNullOrWhiteSpace(gameId)) parameters[0].Value = gameId.Trim()[0];
                    DataSet   ds = db.ExecuteDataset("[dbo].[rsp_EBS_GetGameDetails]", parameters);
                    DataTable dt = ds.GetDataTable(0);
                    if (dt != null)
                    {
                        foreach (DataRow dr in dt.Rows)
                        {
                            DLGameDto dto = new DLGameDto();
                            dto.GameID   = dr.Field <string>("GameID").ToStringSafe();
                            dto.GameName = dr.Field <string>("GameName");
                            dto.IsActive = dr.Field <bool>("IsActive");
                            result.Add(dto);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                Log.Exception(PROC, ex);
            }

            return(result);
        }
Example #5
0
        public DLGameCollectionDto GetGames(string siteCode, object gameId)
        {
            ModuleProc PROC = new ModuleProc(this.DYN_MODULE_NAME, "GetGames");
            DLGameCollectionDto result = new DLGameCollectionDto();

            try
            {
                using (Database db = DbFactory.OpenDB(_connectionString))
                {
                    db.Open();

                    DbParameter[] parameters = db.CreateParameters(2);
                    parameters[0] = db.CreateParameter("@SiteCode", DbType.AnsiString, 50, siteCode);
                    parameters[1] = db.CreateParameter("@GamePrefix", gameId);
                   // if (string.IsNullOrWhiteSpace(gameId)) parameters[0].Value = gameId.Trim()[0];
                    DataSet ds = db.ExecuteDataset("[dbo].[rsp_EBS_GetGameDetails]", parameters);
                    DataTable dt = ds.GetDataTable(0);
                    if (dt != null)
                    {
                        foreach (DataRow dr in dt.Rows)
                        {
                            DLGameDto dto = new DLGameDto();
                            dto.GameID = dr.Field<string>("GameID").ToStringSafe();
                            dto.GameName = dr.Field<string>("GameName");
                            dto.IsActive = dr.Field<bool>("IsActive");
                            result.Add(dto);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                Log.Exception(PROC, ex);
            }

            return result;
        }