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

            try
            {
                configurationInfo ci = target.p_body.p_configuration.p_configurationInfo;
                if (collection != null)
                {
                    List <casino> Casinos = new List <casino>();
                    foreach (var dto in collection)
                    {
                        Casinos.Add(new casino()
                        {
                            casinoId     = dto.SiteId,
                            casinoName   = dto.SiteName,
                            casinoActive = dto.IsActive
                        });
                    }
                    ci.casino = Casinos.ToArray();
                    result    = true;
                }
            }
            catch (Exception ex)
            {
                Log.Exception(PROC, ex);
            }

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

            try
            {
                configurationInfo ci = target.p_body.p_configuration.p_configurationInfo;
                if (collection != null)
                {
                    List<casino> Casinos = new List<casino>();
                    foreach (var dto in collection)
                    {
                        Casinos.Add(new casino()
                        {
                            casinoId = dto.SiteId,
                            casinoName = dto.SiteName,
                            casinoActive = dto.IsActive
                        });
                    }
                    ci.casino = Casinos.ToArray();
                    result = true;
                }
            }
            catch (Exception ex)
            {
                Log.Exception(PROC, ex);
            }

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

            try
            {
                DLSiteCollectionDto collection = _di.GetSites(target.p_body.p_configuration.propertyId);
                result = this.Parse_configurationInfo_getSite(target, collection);
            }
            catch (Exception ex)
            {
                Log.Exception(PROC, ex);
            }

            return(result);
        }
Example #4
0
        public DLSiteCollectionDto GetSites(string siteCode)
        {
            ModuleProc          PROC   = new ModuleProc(this.DYN_MODULE_NAME, "GetSites");
            DLSiteCollectionDto result = new DLSiteCollectionDto();

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

                    DbParameter[] parameters = db.CreateParameters(1);
                    parameters[0] = db.CreateParameter("@SiteCode", DBNull.Value);
                    if (!siteCode.IsEmpty())
                    {
                        parameters[0].Value = siteCode;
                    }
                    DataSet   ds = db.ExecuteDataset("[dbo].[rsp_EBS_GetSiteDetails]", parameters);
                    DataTable dt = ds.GetDataTable(0);
                    if (dt != null)
                    {
                        foreach (DataRow dr in dt.Rows)
                        {
                            DLSiteDto dto = new DLSiteDto();
                            dto.SiteId   = dr.Field <string>("SiteId");
                            dto.SiteName = dr.Field <string>("SiteName");
                            dto.IsActive = dr.Field <bool>("IsActive");
                            result.Add(dto);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                Log.Exception(PROC, ex);
            }

            return(result);
        }
Example #5
0
        public DLSiteCollectionDto GetSites(string siteCode)
        {
            ModuleProc PROC = new ModuleProc(this.DYN_MODULE_NAME, "GetSites");
            DLSiteCollectionDto result = new DLSiteCollectionDto();

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

                    DbParameter[] parameters = db.CreateParameters(1);
                    parameters[0] = db.CreateParameter("@SiteCode", DBNull.Value);
                    if (!siteCode.IsEmpty()) parameters[0].Value = siteCode;
                    DataSet ds = db.ExecuteDataset("[dbo].[rsp_EBS_GetSiteDetails]", parameters);
                    DataTable dt = ds.GetDataTable(0);
                    if (dt != null)
                    {
                        foreach (DataRow dr in dt.Rows)
                        {
                            DLSiteDto dto = new DLSiteDto();
                            dto.SiteId = dr.Field<string>("SiteId");
                            dto.SiteName = dr.Field<string>("SiteName");
                            dto.IsActive = dr.Field<bool>("IsActive");
                            result.Add(dto);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                Log.Exception(PROC, ex);
            }

            return result;
        }