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; } } } }