public GetPointsBalanceResponse GetPointsBalances(GetPointsBalancesRequest reqst)
        {
            DateTime kickoff = DateTime.Now;

            XmlConfigurator.Configure(new System.IO.FileInfo(ConfigurationManager.AppSettings["Log4NetConfigPath"]));

            GetPointsBalanceResponse reply = new GetPointsBalanceResponse();

            try
            {
                log.Info("GetPointsBalances Request. AcctNo: " + reqst.AcctNo + ".");

                reply.Success = true;
                GetPointsBalancesFromDB(ref reply, reqst.AcctNo);

                log.Info("Request fulfilled. (" + executionTime(new TimeSpan(DateTime.Now.Ticks - kickoff.Ticks)) + "ms)");

                reply.Success = true;
                return(reply);
            }
            catch (Exception excp)
            {
                log.Error("\nMessage:\n" + excp.Message + "\nStack Trace:\n" + excp.StackTrace);

                reply.Success = false;

                ProcessError err = new ProcessError();
                err.ErrorMessage = excp.Message;

                reply.Errors.Add(err);
                return(reply);
            }
        }
        private void GetPointsBalancesFromDB(ref GetPointsBalanceResponse reply, String acctNo)
        {
            reply.Success = false;

            using (SqlConnection sqlConnection = new SqlConnection("user id=" + config.Cmp_User + ";" +
                                                                   "password="******";" +
                                                                   "server=" + config.Cmp_Server + ";" +
                                                                   "Trusted_Connection=false;" +
                                                                   "database=" + config.Cmp_Database + "; " +
                                                                   "connection timeout=120"))
            {
                sqlConnection.Open();
                using (SqlCommand sqlCommand = new SqlCommand(GetPointsBalancesQueryString(acctNo), sqlConnection))
                {
                    sqlCommand.CommandTimeout = config.SqlTimeOut;
                    using (SqlDataReader dataReader = sqlCommand.ExecuteReader())
                    {
                        if (dataReader.Read())
                        {
                            string checkedOutCasino = DBHelper.dbHelper.getDbStringVal(dataReader, "CasinoCode");
                            if (checkedOutCasino == "")
                            {
                                reply.CasinPoints   = DBHelper.dbHelper.getDbIntVal(dataReader, "PointsBal");
                                reply.LeisurePoints = DBHelper.dbHelper.getDbIntVal(dataReader, "CompBal");
                            }
                            else
                            {
                                reply.CheckedOutCasino = checkedOutCasino;
                                //lets call down to the unit
                                log.Info("Calling remote property: " + checkedOutCasino + ".");
                                using (SlotsInfoServiceClient service = new SlotsInfoServiceClient(checkedOutCasino + "BasicHttpBinding_SlotsInfoService"))
                                {
                                    svc.GetPointsBalancesRequest request = new svc.GetPointsBalancesRequest();
                                    request.AcctNo = acctNo;

                                    svc.GetPointsBalanceResponse response = new svc.GetPointsBalanceResponse();
                                    response = service.GetPointsBalances(request);

                                    reply.Success       = response.Success;
                                    reply.CasinPoints   = response.CasinPoints;
                                    reply.LeisurePoints = response.LeisurePoints;

                                    foreach (svc.ProcessError detail in response.Errors)
                                    {
                                        reply.Errors.Add(new ProcessError()
                                        {
                                            ErrorMessage = detail.ErrorMessage
                                        });
                                    }
                                }
                            }
                        }

                        reply.Success = true;
                    }
                }
            }
        }