public DataTable GetEPIDetails(int InstallationNo)
 {
     return(analysisDataAccessHandler.GetEPIDetails(InstallationNo));
 }
Exemple #2
0
        public Dictionary <string, string> RetrievePlayerDetailsFromEPI(int InstallationNo)
        {
            Dictionary <string, string> _PlayerInfo            = null;
            AnalysisDataAccess          analysisBusinessObject = new AnalysisDataAccess();
            DataTable dt = analysisBusinessObject.GetEPIDetails(InstallationNo);

            _PlayerInfo = new Dictionary <string, string>();

            PlayerInfo _POSDetail = null;

            foreach (DataRow dr in dt.Rows)
            {
                _POSDetail = new PlayerInfo();
                if (dr["IsEPIAvailable"].ToString() == "1")
                {
                    _POSDetail.IsEPIAvailable = true;
                    _POSDetail.AccountNumber  = dr["EPIDetails"].ToString();
                    Dictionary <string, string> PlayerInfo = GetPlayerInfo(_POSDetail.AccountNumber);
                    if (PlayerInfo != null)
                    {
                        //string PlayerName;
                        string   FirstName, LastName = string.Empty;
                        string   PlayerStatus;
                        TimeSpan CardTimeIn = new TimeSpan(0, 0, 0);
                        if (PlayerInfo.TryGetValue("FirstName", out FirstName))
                        {
                            _POSDetail.DisplayName = FirstName;
                        }

                        if (PlayerInfo.TryGetValue("LastName", out LastName))
                        {
                            _POSDetail.DisplayName = FirstName + " " + LastName;
                        }

                        if (PlayerInfo.TryGetValue("ClubState", out PlayerStatus))
                        {
                            _POSDetail.ClubState = PlayerStatus;
                        }

                        if (PlayerInfo.TryGetValue("ClubStatus", out PlayerStatus))
                        {
                            _POSDetail.ClubStatus = PlayerStatus;
                        }

                        DateTime CardedTime;
                        if (DateTime.TryParse(dr["CardinTime"].ToString(), out CardedTime))
                        {
                            CardTimeIn = DateTime.Now.Subtract(CardedTime);
                        }

                        _POSDetail.PlayerTimeOfPlay += (CardTimeIn.Hours / 60).ToString() + " : " + CardTimeIn.Minutes.ToString() + " : " + CardTimeIn.Seconds.ToString();
                    }
                }
                else
                {
                    _POSDetail.IsEPIAvailable = false;
                }

                foreach (PropertyInfo info in _POSDetail.GetType().GetProperties())
                {
                    _PlayerInfo.Add(info.Name, info.GetValue(_POSDetail, null) == null ? "" : info.GetValue(_POSDetail, null).ToString());
                }
            }
            return(_PlayerInfo);
        }