private static string GetServerName() { // var key = BMCRegistryHelper.GetRegLocalMachine().OpenSubKey(@"Cashmaster\Exchange", true); //if (key != null) return key.GetValue("Default_Server_Ip").ToString(); //throw new InvalidDataException("Registry key not Set. Default_Server_IP not configured"); return(BMCRegistryHelper.GetRegKeyValue(@"Cashmaster\Exchange", "Default_Server_Ip")); }
public static void Main() { LogManager.WriteLog("Entering Cash Desk Operator EXE", LogManager.enumLogLevel.Debug); BMCRegistryHelper.ActiveInstallationType = BMCCategorizedInstallationTypes.Exchange; LogManager.WriteLog("BMCRegistryHelper.InstallationTypes is :" + BMCRegistryHelper.ActiveInstallationType, LogManager.enumLogLevel.Debug); string strDefaultServerIP = string.Empty; strDefaultServerIP = BMCRegistryHelper.GetRegKeyValue("Cashmaster\\Exchange", "Default_Server_IP"); clientObj = new ClientObject(); client = new Client("tcp://" + strDefaultServerIP + ConfigManager.Read("ServerIPCUrl"), "RemotingClient", typeof(IServerObject)); client.SendToServer(clientObj, null); int itmpInterval = Int32.Parse(ConfigManager.Read("IPCInterval")) * 3; Int32.TryParse(ConfigManager.Read("RemoteServerConnectionCheck"), out iSiteLicensingCheck); if (iSiteLicensingCheck <= 0) { iSiteLicensingCheck = 600; } if (itmpInterval > 15) { iInteraval = itmpInterval; } #if !FLOORVIEW_REFRESH_NEW siteLicensingClientObj = new ClientObject(); siteLicensingClient = new Client("tcp://" + strDefaultServerIP + ConfigManager.Read("SiteLicensingServerIPCUrl"), "SiteLicensingClient", typeof(ISiteLicenseServerObject)); siteLicensingClient.SendToServer(siteLicensingClientObj, null); #endif BMC.PlayerGateway.GatewaySettings.ConnectionString = DatabaseHelper.GetConnectionString(); AppStartUp(); }
private void CheckForSlotLANIP() { string strSlotIP = string.Empty; try { strSlotIP = BMCRegistryHelper.GetRegKeyValue(ConfigManager.Read("RegistryPath") + "\\BMCDHCP", "ServerIP"); if (string.IsNullOrEmpty(strSlotIP)) { SetListviewItemStyle("SlotLANIP", 1); return; } string[] strarrBindIP = GetAllLocalIP(); if (strarrBindIP.Length > 0) { foreach (string strIP in strarrBindIP) { if (strIP.ToUpper().CompareTo(strSlotIP.ToUpper()) == 0) { lvGoLive.Items["SlotLANIP"].SubItems.Add(strIP); SetListviewItemStyle("SlotLANIP", 0); return; } } SetListviewItemStyle("SlotLANIP", 1); } } catch (Exception ex) { ExceptionManager.Publish(ex); SetListviewItemStyle("SlotLANIP", 1); } }
private int CheckAuthorizationCodeFromServer(string iAuthCode, int iSiteCode, string TransactionType) { string sReturnValue = ""; string sVerifyURL = string.Empty; int iResult = -1; try { if (oWebService == null) { ConfigManager.SetConfigurationMode(ConfigManager.ConfigurationMode.AppConfig); sVerifyURL = BMCRegistryHelper.GetRegKeyValue(ConfigManager.Read("RegistryPath"), "BGSWebService"); if (sVerifyURL.Length > 0) { oWebService = new Proxy(sVerifyURL, true); } } sReturnValue = oWebService.CheckTransactionKey(iSiteCode.ToString(), iAuthCode.ToString(), TransactionType); if (!string.IsNullOrEmpty(sReturnValue)) { iResult = Convert.ToInt32(sReturnValue.Substring(0, 1)); } } catch (Exception ex) { ExceptionManager.Publish(ex); iResult = -1; } return(iResult); }
private void CheckforBindIP() { string strBindIP = string.Empty; try { strBindIP = BMCRegistryHelper.GetRegKeyValue(ConfigManager.Read("RegistryPath") + "\\Exchange", "BindIPAddress"); string[] strarrBindIP = GetAllLocalIP(); if (string.IsNullOrEmpty(strBindIP)) { SetListviewItemStyle("BindIP", 1); } if (strarrBindIP.Length > 0) { foreach (string strIP in strarrBindIP) { if (strIP == strBindIP) { lvGoLive.Items["BindIP"].SubItems.Add(strIP); SetListviewItemStyle("BindIP", 0); break; } else { SetListviewItemStyle("BindIP", 1); } } } } catch (Exception ex) { ExceptionManager.Publish(ex); SetListviewItemStyle("BindIP", 1); } }
public void ReadRegistrySettings(string Registrypath) { string ReadDate = string.Empty; try { String readHour = BMCRegistryHelper.GetRegKeyValue(Registrypath, "HourlyReadHour"); ReadDate = BMCRegistryHelper.GetRegKeyValue(Registrypath, "LastAutoRead"); HourlyDailyEntity.HourlyReadHour = Convert.ToInt32(readHour); DateTime dtRead; if (!string.IsNullOrWhiteSpace(ReadDate)) { dtRead = Convert.ToDateTime(ReadDate, CultureInfo.CurrentCulture); dtRead.Date.ToString(CultureInfo.CurrentCulture.DateTimeFormat.ShortDatePattern); HourlyDailyEntity.LastAutoRead = dtRead.Date; } else { dtRead = Convert.ToDateTime(DateTime.Now.AddDays(-1).ToString(), CultureInfo.CurrentCulture); dtRead.Date.ToString(CultureInfo.CurrentCulture.DateTimeFormat.ShortDatePattern); HourlyDailyEntity.LastAutoRead = dtRead; } } catch (Exception ex) { LogManager.WriteLog("Please check the regional setting date format and LastAutoRead!! Date format from Registry: " + ReadDate.ToString() + " Regional setting date format: " + CultureInfo.CurrentCulture.DateTimeFormat.ShortDatePattern.ToString(), LogManager.enumLogLevel.Error); //HourlyDailyEventLog.WriteToEventLog(HourlyDailyEntity.EventLogName, "ReadRegistrySettings: ", "Message: " + ex.Message + "Source: " + ex.Source, EventLogEntryType.Error); ExceptionManager.Publish(ex); } }
/// <summary> /// Write a Com Config file /// #Sample# /// <?xml version="1.0" encoding="utf-8"?> /// <configuration> /// <client> /// <AppSetting> /// <ConfigLocation type="CSTRING">C:\Program Files\Bally Technologies\Exchange Client\CommClient.config</ConfigLocation> /// <BindIPAddress type="CSTRING">10.2.108.10</BindIPAddress> /// <Default_Server_Ip type="CSTRING">10.2.108.10</Default_Server_Ip> /// </AppSetting> /// <common> /// <ServerIPPort type="DWORD">6810</ServerIPPort> /// <BlockingCallTimeOut type="DWORD">10000</BlockingCallTimeOut> /// </common> /// <Log> /// <ClientLog type="DWORD">1</ClientLog> /// <ExchangeDir type="CSTRING">C:\CashmasterExchange</ExchangeDir> /// </Log> /// </client> /// </configuration> /// </summary> /// <param name="FileName"></param> /// <param name="sFullPath"></param> /// <param name="DefaultServerIP"></param> /// <param name="BindServerIP"></param> public static bool SaveClientConfig(string RootDirectory, string CommConfigFileName, string DefaultServerIP, string BindServerIP, List <string> ReplicateLocations) { string PROC = "SaveConfig"; bool bStatus = true; string _sCashmasterExchange = ""; string CommConfigFileLocation = RootDirectory + Path.DirectorySeparatorChar + CommConfigFileName; bool _bCashmasterConfig = Convert.ToBoolean(ConfigurationManager.AppSettings["CreateCashmasterFolderInsideLogs"].ToString() ?? "false"); if (_bCashmasterConfig) { _sCashmasterExchange = BMCRegistryHelper.GetRegKeyValue(string.Empty, "DefaultLogDir", "C:\\Logs") + Path.DirectorySeparatorChar + "CashmasterExchange"; } else { _sCashmasterExchange = (ConfigurationManager.AppSettings["CashmasterExchangeLogDrive"] ?? "c:") + Path.DirectorySeparatorChar + "CashmasterExchange"; } try { //Frames xml elements with default values XElement xConfig = new XElement("configuration", new XElement("client", new XElement("AppSetting", new XElement("ConfigLocation", new XAttribute("type", "CSTRING"), CommConfigFileLocation), new XElement("BindIPAddress", new XAttribute("type", "CSTRING"), BindServerIP), new XElement("Default_Server_Ip", new XAttribute("type", "CSTRING"), DefaultServerIP) ), new XElement("common", new XElement("ServerIPPort", new XAttribute("type", "DWORD"), 6810), new XElement("BlockingCallTimeOut", new XAttribute("type", "DWORD"), 10000) ), new XElement("Log", new XElement("ClientLog", new XAttribute("type", "DWORD"), 1), new XElement("ExchangeDir", new XAttribute("type", "CSTRING"), _sCashmasterExchange), new XElement("SocketLog", new XAttribute("type", "DWORD"), 1) ) ) ); //Writes to a new file if (!WriteConfig(xConfig, CommConfigFileLocation, CommConfigFileName, RootDirectory, ReplicateLocations)) { bStatus = false; } //xConfig.Save(CommConfigFileLocation); //if (ReplicateLocations != null) //{ // CopyConfigFiles(CommConfigFileName, CommConfigFileLocation, RootDirectory, ReplicateLocations); //} } catch (Exception ex) { bStatus = false; LogManager.WriteLog(PROC + ": " + ex.Message.ToString() + ex.Source.ToString(), LogManager.enumLogLevel.Error); ExceptionManager.Publish(ex); } return(bStatus); }
public bool CheckForPrefixSuffixSetting() { string bHasSuffix = ""; string bHasPrefix = ""; bool bResult = false; /*RegistryKey regKeyConnectionString = null; * try * { * * regKeyConnectionString = Registry.LocalMachine.OpenSubKey("Software\\Honeyframe\\Cashmaster\\Exchange"); * if (regKeyConnectionString != null) * { * bHasSuffix = regKeyConnectionString.GetValue("HasSuffix").ToString(); * * regKeyConnectionString = Registry.LocalMachine.OpenSubKey("Software\\Honeyframe\\Cashmaster\\Exchange"); * if (regKeyConnectionString != null) * { * bHasPrefix = regKeyConnectionString.GetValue("HasPrefix").ToString(); * * regKeyConnectionString.Close(); * * if (bHasPrefix == "1" && bHasSuffix == "1") * { * bResult = true; * } * else * { * bResult = false; * } * } * bResult = false; * } * return bResult; * } * catch (Exception ex) * { * ExceptionManager.Publish(ex); * return false; * }*/ try { bHasSuffix = BMCRegistryHelper.GetRegKeyValue("Cashmaster\\Exchange", "HasSuffix"); bHasPrefix = BMCRegistryHelper.GetRegKeyValue("Cashmaster\\Exchange", "HasPrefix"); return((bHasPrefix == "1") && (bHasSuffix == "1")); } catch (Exception ex) { ExceptionManager.Publish(ex); return(false); } }
private string GetReadDate() { try { //string value = ""; return(BMCRegistryHelper.GetRegKeyValue("Cashmaster", "LastAutoRead")); //if (ReadFromRegistry("Cashmaster", "LastAutoRead", ref value)) // return value; } catch (Exception ex) { ExceptionManager.Publish(ex); } return(null); }
public static IDictionary <string, string> GetGloryServerDetails() { try { string[] Separator = new string[1] { ";" }; Dictionary <string, string> dicGloryCDDetailsInt = new Dictionary <string, string>(); if (dicGloryCDDetails != null && dicGloryCDDetails.Count > 0) { return(dicGloryCDDetails); } string[] strVal = { "ServerName", "PortNo", "UserName", "DeviceName", "SSL" }; foreach (string sKey in strVal) { dicGloryCDDetailsInt.Add(sKey, string.Empty); } string strGloryConnectionString = BMCRegistryHelper.GetRegKeyValue("Cashmaster", "CDServerInfo"); strGloryConnectionString = BMC.Common.Security.CryptEncode.Decrypt(strGloryConnectionString); string[] sValue = strGloryConnectionString.Split(Separator, StringSplitOptions.RemoveEmptyEntries); if (sValue.Count <string>() == 5) { dicGloryCDDetailsInt["ServerName"] = sValue[0]; dicGloryCDDetailsInt["PortNo"] = sValue[1]; dicGloryCDDetailsInt["UserName"] = sValue[2]; dicGloryCDDetailsInt["DeviceName"] = sValue[3]; dicGloryCDDetailsInt["SSL"] = sValue[4]; dicGloryCDDetails = dicGloryCDDetailsInt; } else { return(null); } } catch (Exception ex) { ExceptionManager.Publish(ex); return(null); } return(dicGloryCDDetails); }
private string GetEnterpriseURL() { //string RegistryPath = ConfigManager.Read("RegistryPath"); string URL = string.Empty; //RegistryKey regKeyConnectionString; try { URL = BMCRegistryHelper.GetRegKeyValue(ConfigManager.Read("RegistryPath"), "BGSWebService"); if (string.IsNullOrEmpty(URL)) { LogManager.WriteLog("Enterprise URL not Found.", BMC.Common.LogManagement.LogManager.enumLogLevel.Error); } } catch (Exception ex) { ExceptionManager.Publish(ex); } return(URL); }
public void CheckEntepriseConnectivity() { string strWebServiceURL = string.Empty; try { strWebServiceURL = BMCRegistryHelper.GetRegKeyValue(ConfigManager.Read("RegistryPath"), "BGSWebService"); if (!string.IsNullOrEmpty(strWebServiceURL)) { EnterpriseWebService.EnterpriseWebService objBGSWebProxy = new EnterpriseWebService.EnterpriseWebService(strWebServiceURL); if (objBGSWebProxy.HelloWebService(10) == 10) { SetListviewItemStyle("EnterpriseConnectivity", 0); } else { SetListviewItemStyle("EnterpriseConnectivity", 1); } } else { SetListviewItemStyle("EnterpriseConnectivity", 1); if (lvGoLive.Items["EnterpriseConnectivity"].SubItems.Count > 2) { lvGoLive.Items["EnterpriseConnectivity"].SubItems[2].Text = "BGSWebServiceURL Registry Key is Empty"; } else { lvGoLive.Items["EnterpriseConnectivity"].SubItems.Add("BGSWebServiceURL Registry Key is Empty"); } } } catch (Exception ex) { ExceptionManager.Publish(ex); SetListviewItemStyle("EnterpriseConnectivity", 1); } }
public static string PCConnectionString() { string sKey = string.Empty; //bool bUseHex = true; //RegistryKey RegKey1; string SQLConnect = ""; ConfigManager.SetConfigurationMode(ConfigManager.ConfigurationMode.AppConfig); try { //Registry path for exchange. //RegKey1 = Registry.LocalMachine.OpenSubKey(ConfigManager.Read("RegistryPath")); //BMC.Transport.ExchangeConfig.ExchangeConfigRegistryEntities.RegistryKeyValue = ConfigManager.Read("RegistryPath"); SQLConnect = BMCRegistryHelper.GetRegKeyValue(ConfigManager.Read("RegistryPath"), "PCConnect"); //RegKey1.GetValue("PCConnect").ToString(); //When the connection string is already there before changes (without encryption), then DO NOT decrypt if (!SQLConnect.ToUpper().Contains("SERVER")) { //BGSGeneral.cConstants objBGSConstants = new BGSGeneral.cConstants(); //BGSEncryptDecrypt.clsBlowFish objDecrypt = new BGSEncryptDecrypt.clsBlowFish(); //sKey = objBGSConstants.ENCRYPTIONKEY; //SQLConnect = objDecrypt.DecryptString(ref SQLConnect, ref sKey, ref bUseHex); SQLConnect = BMC.Common.Security.CryptEncode.Decrypt(SQLConnect); LogManager.WriteLog("DB Registry Value " + SQLConnect.Length.ToString(), LogManager.enumLogLevel.Debug); } // RegKey1.Close(); } catch (Exception ex) { LogManager.WriteLog("ExchangeConnectionString" + ex.Message.ToString() + ex.Source.ToString(), LogManager.enumLogLevel.Error); ExceptionManager.Publish(ex); } return(SQLConnect); }
//public static string SetCurrentExchangeConnectionString() //{ // try // { // bool bUseHex = true; // RegistryKey regKeyConnectionString = Registry.LocalMachine.OpenSubKey("Software\\Honeyframe\\Cashmaster"); // string strConnectionString = regKeyConnectionString.GetValue("SQLConnect").ToString(); // regKeyConnectionString.Close(); // if (!strConnectionString.ToUpper().Contains("SERVER")) // { // BGSGeneral.cConstants objBGSConstants = new BGSGeneral.cConstants(); // BGSEncryptDecrypt.clsBlowFish objDecrypt = new BGSEncryptDecrypt.clsBlowFish(); // string strKey = objBGSConstants.ENCRYPTIONKEY; // strConnectionString = objDecrypt.DecryptString(ref strConnectionString, ref strKey, ref bUseHex); // } // if (strConnectionString.ToUpper().Contains("SERVER")) // exchangeConnectionString = strConnectionString; // else // throw new Exception("Error Decrypting Registry"); // } // catch (Exception ex) // { // if (ex.Message == "Connectionstring Not Found.") // throw ex; // else // ExceptionManager.Publish(ex); // } // return exchangeConnectionString; //} //public static string SetCurrentTicketConnectionString() //{ // try // { // RegistryKey regKeyConnectionString = Registry.LocalMachine.OpenSubKey("Software\\Honeyframe\\Cashmaster"); // string strConnectionString = regKeyConnectionString.GetValue("TicketingSQLConnect").ToString(); // regKeyConnectionString.Close(); // if (!strConnectionString.ToUpper().Contains("SERVER")) // { // strConnectionString = BMC.Common.Security.CryptEncode.Decrypt(strConnectionString); // } // if (strConnectionString.ToUpper().Contains("SERVER")) // ticketingConnectionString = strConnectionString; // else // throw new Exception("Error Decrypting Registry"); // } // catch (Exception ex) // { // if (ex.Message == "Connectionstring Not Found.") // throw ex; // else // ExceptionManager.Publish(ex); // } // return ticketingConnectionString; //} // private static string GetExchangeConnectionString() { try { if (!string.IsNullOrEmpty(exchangeConnectionString)) { return(exchangeConnectionString); } string strConnectionString = BMCRegistryHelper.GetRegKeyValue("Cashmaster", "SQLConnect"); if (!strConnectionString.ToUpper().Contains("SERVER")) { strConnectionString = BMC.Common.Security.CryptEncode.Decrypt(strConnectionString); } if (strConnectionString.ToUpper().Contains("SERVER")) { exchangeConnectionString = strConnectionString; } else { throw new Exception("Error Decrypting Registry"); } } catch (Exception ex) { exchangeConnectionString = null; if (ex.Message == "Connectionstring Not Found.") { throw ex; } else { ExceptionManager.Publish(ex); } } return(exchangeConnectionString); }//
public static string GetGloryServerPassword() { try { string strLocalGloryPassword = ""; if (!String.IsNullOrEmpty(strGloryPassword)) { return(strGloryPassword); } strLocalGloryPassword = BMCRegistryHelper.GetRegKeyValue("Cashmaster", "CDServerPwd"); strLocalGloryPassword = BMC.Common.Security.CryptEncode.Decrypt(strLocalGloryPassword); strGloryPassword = strLocalGloryPassword; } catch (Exception ex) { BMC.Common.LogManagement.LogManager.WriteLog("Unable to find Glory Server Password from Registry", BMC.Common.LogManagement.LogManager.enumLogLevel.Info); ExceptionManager.Publish(ex); return(null); } return(strGloryPassword); }
public void GetInitialSettings() { DataSet objDsSetting; var objCdo = oCommonUtilities.CreateInstance(); DataRow settingsRow; try { objDsSetting = objCdo.GetInitialSettings(); if (objDsSetting != null && objDsSetting.Tables.Count > 0 && objDsSetting.Tables[0].Rows.Count > 0) { settingsRow = objDsSetting.Tables[0].Rows[0]; Settings.Gaming_Day_Start_Hour = (settingsRow["GAMING_DAY_START_HOUR"].ToString() != string.Empty) ? int.Parse(settingsRow["GAMING_DAY_START_HOUR"].ToString()) : 0; Settings.Ticket_Expire = (settingsRow["TICKET_EXPIRE"].ToString() != string.Empty) ? int.Parse(settingsRow["TICKET_EXPIRE"].ToString()) : 0; Settings.Region = settingsRow["REGION"].ToString(); Settings.Connection = settingsRow["Connection"].ToString(); Settings.HeadCashierSig = settingsRow["TICKETVALIDATE_REQUIRES_HEADCASHIER_SIG"].ToString(); Settings.ManagerSig = settingsRow["TICKETVALIDATE_REQUIRES_MANAGER_SIG"].ToString(); Settings.AllowOffLineRedeem = (settingsRow["Allow_Offline_Redeem"].ToString() != string.Empty) ? bool.Parse(settingsRow["Allow_Offline_Redeem"].ToString()) : false; Settings.SGVI_Enabled = (settingsRow["SGVI_ENABLED"].ToString() != string.Empty) ? bool.Parse(settingsRow["SGVI_ENABLED"].ToString()) : false; Settings.VoidTransaction = (settingsRow["VoidTransactions"].ToString() != string.Empty) ? bool.Parse(settingsRow["VoidTransactions"].ToString()) : false; Settings.OnScreenKeyboard = (settingsRow["USE_ON_SCREEN_KEYBOARD"].ToString() != string.Empty) ? bool.Parse(settingsRow["USE_ON_SCREEN_KEYBOARD"].ToString()) : false; Settings.EnableTicketRedeemRecipt = (settingsRow["EnableRedeemPrintCDO"].ToString() != string.Empty) ? bool.Parse(settingsRow["EnableRedeemPrintCDO"].ToString()) : false; //Settings.ReceiptPrinter = bool.Parse(SettingsRow["ReceiptPrinter"].ToString()); Settings.EnableVoucher = (settingsRow["TicketValidate_EnableVoucher"].ToString() != string.Empty) ? bool.Parse(settingsRow["TicketValidate_EnableVoucher"].ToString()) : false; Settings.HandpayManual = (settingsRow["HandpayManualEntry"].ToString() != string.Empty) ? bool.Parse(settingsRow["HandpayManualEntry"].ToString()) : false; Settings.Not_Issue_Ticket = (settingsRow["CD_NOT_ISSUE_VOUCHER"].ToString() != string.Empty) ? bool.Parse(settingsRow["CD_NOT_ISSUE_VOUCHER"].ToString()) : false; Settings.TicketDeclaration = settingsRow["TicketDeclarationMethod"].ToString(); Settings.TITO_Not_In_Use = (settingsRow["CD_TITO_NOT_IN_USE"].ToString() != string.Empty) ? bool.Parse(settingsRow["CD_TITO_NOT_IN_USE"].ToString()) : false; Settings.TV_FillScreen = (settingsRow["TicketValidation_FillScreen"].ToString() != string.Empty) ? bool.Parse(settingsRow["TicketValidation_FillScreen"].ToString()) : false; Settings.EnableLaundering = (settingsRow["EnableLaundering"].ToString() != string.Empty) ? bool.Parse(settingsRow["EnableLaundering"].ToString()) : false; Settings.CD_Not_Use_Hoppers = (settingsRow["CD_NOT_USE_HOPPERS"].ToString() != string.Empty) ? bool.Parse(settingsRow["CD_NOT_USE_HOPPERS"].ToString()) : false; Settings.EnableHandpayReceipt = (settingsRow["TicketValidate_EnableHandpayReceipt"].ToString() != string.Empty) ? bool.Parse(settingsRow["TicketValidate_EnableHandpayReceipt"].ToString()) : false; Settings.EnableIssueReceipt = (settingsRow["TicketValidate_EnableIssueReceipt"].ToString() != string.Empty) ? bool.Parse(settingsRow["TicketValidate_EnableIssueReceipt"].ToString()) : false; Settings.EnableProgReceipt = (settingsRow["TicketValidate_EnableProgressivePayoutReceipt"].ToString() != string.Empty) ? bool.Parse(settingsRow["TicketValidate_EnableProgressivePayoutReceipt"].ToString()) : false; Settings.EnableRefillReceipt = (settingsRow["TicketValidate_EnableRefillReceipt"].ToString() != string.Empty) ? bool.Parse(settingsRow["TicketValidate_EnableRefillReceipt"].ToString()) : false; Settings.EnableRefundReceipt = (settingsRow["TicketValidate_EnableRefundReceipt"].ToString() != string.Empty) ? bool.Parse(settingsRow["TicketValidate_EnableRefundReceipt"].ToString()) : false; Settings.EnableShortPayReceipt = (settingsRow["TicketValidate_EnableShortpayReceipt"].ToString() != string.Empty) ? bool.Parse(settingsRow["TicketValidate_EnableShortpayReceipt"].ToString()) : false; Settings.RedeemConfirm = (settingsRow["Confirm_Redeem_Message"].ToString() != string.Empty) ? bool.Parse(settingsRow["Confirm_Redeem_Message"].ToString()) : true; Settings.RegulatoryEnabled = (settingsRow["RegulatoryEnabled"].ToString() != string.Empty ? bool.Parse(settingsRow["RegulatoryEnabled"].ToString()) : false); Settings.RegulatoryType = settingsRow["RegulatoryType"].ToString(); Settings.SiteCode = settingsRow["TICKET_LOCATION_CODE"].ToString(); Settings.HandpayPayoutCustomer_Min = Convert.ToDouble(settingsRow["HandpayPayoutCustomer_Min"].ToString()); Settings.HandpayPayoutCustomer_Max = Convert.ToDouble(settingsRow["HandpayPayoutCustomer_Max"].ToString()); Settings.HandpayPayoutCustomer_BankAccNo = Convert.ToDouble(settingsRow["HandpayPayoutCustomer_BankAccNo"].ToString()); Settings.printTicket = (settingsRow["Ithaca950"].ToString() != string.Empty) ? bool.Parse(settingsRow["Ithaca950"].ToString()) : false; Settings.PrinterPort = (settingsRow["PrinterPort"] != null) ? settingsRow["PrinterPort"].ToString() : string.Empty; Settings.WebURL = Convert.ToString(BMCRegistryHelper.GetRegKeyValue(ConfigManager.Read(Constants.CONSTANT_REGISTRYPATH), "BGSWebService")); Settings.IssueTicketMaxValue = (!settingsRow.IsNull("IssueTicketMaxValue")) ? settingsRow["IssueTicketMaxValue"].ToString() : string.Empty; Settings.PrintTicket_EncryptDigits = (!settingsRow.IsNull("Issue_Ticket_Encrypt_BarCode")) ? bool.Parse(settingsRow["Issue_Ticket_Encrypt_BarCode"].ToString()) : false; Settings.Client = (settingsRow["Client"] != null) ? settingsRow["Client"].ToString() : string.Empty; Settings.MaxHandPayAuthRequired = (settingsRow["MaxHandPayAuthRequired"].ToString() != string.Empty ? bool.Parse(settingsRow["MaxHandPayAuthRequired"].ToString()) : false); Settings.ManualEntryTicketValidation = (settingsRow["ManualEntryTicketValidation"].ToString() != string.Empty ? bool.Parse(settingsRow["ManualEntryTicketValidation"].ToString()) : false); Settings.RedeemTicketCustomer_Min = Convert.ToInt32(settingsRow["RedeemTicketCustomer_Min"].ToString()); Settings.RedeemTicketCustomer_Max = Convert.ToInt32(settingsRow["RedeemTicketCustomer_Max"].ToString()); Settings.RedeemTicketCustomer_BankAcctNo = Convert.ToInt32(settingsRow["RedeemTicketCustomer_BankAcctNo"].ToString()); Settings.RedeemExpiredTicket = (settingsRow["RedeemExpiredTicket"].ToString() != string.Empty ? bool.Parse(settingsRow["RedeemExpiredTicket"].ToString()) : false); Settings.IsAFTEnabledForSite = (settingsRow["IsAFTEnabledForSite"].ToString() != string.Empty) ? bool.Parse(settingsRow["IsAFTEnabledForSite"].ToString()) : false; Settings.IsAFTIncludedInCalculation = (settingsRow["IsAFTIncludedInCalculation"].ToString() != string.Empty) ? bool.Parse(settingsRow["IsAFTIncludedInCalculation"].ToString()) : false; Settings.Auto_Declare_Monies = (settingsRow["Auto_Declare_Monies"].ToString() != string.Empty) ? bool.Parse(settingsRow["Auto_Declare_Monies"].ToString()) : false; Settings.Disable_Machine_On_Drop = (settingsRow["DISABLE_MACHINE_ON_DROP"].ToString() != string.Empty) ? bool.Parse(settingsRow["DISABLE_MACHINE_ON_DROP"].ToString()) : false; Settings.NoWaitForDisableMachine = (settingsRow["NoWaitForDisableMachine"].ToString() != string.Empty) ? bool.Parse(settingsRow["NoWaitForDisableMachine"].ToString()) : false; Settings.AUTOLOGOFF_TIMEOUT = (settingsRow["AUTOLOGOFF_TIMEOUT"].ToString() != string.Empty) ? Int32.Parse(settingsRow["AUTOLOGOFF_TIMEOUT"].ToString()) : 0; Settings.SHOWHANDPAYCODE = (settingsRow.Table.Columns.Contains("SHOWHANDPAYCODE")) ? Convert.ToString(settingsRow["SHOWHANDPAYCODE"]).ToUpper() : "TRUE"; Settings.IsEmployeeCardTrackingEnabled = (!settingsRow.IsNull("IsEmployeeCardTrackingEnabled")) ? bool.Parse(settingsRow["IsEmployeeCardTrackingEnabled"].ToString()) : false; } } catch (Exception ex) { LogManager.WriteLog("GetInitialSettings::Error in loading Intial settings from setting table", LogManager.enumLogLevel.Error); ExceptionManager.Publish(ex); } ExtensionMethods.CurrentSiteCulture = ConfigManager.Read("GetDefaultCultureForRegion"); }
public double EnableDisableVLTBasedonVerfication() { DataTable AAMSTable; bool IsVerified; LogManager.WriteLog("EnableDisableVLTBasedonVerfication - Started.", LogManager.enumLogLevel.Info); if (!Convert.ToBoolean(ConfigManager.Read("EnableDisableVLTBasedonVerfication"))) { return(60 * 1000); } double dTimerDelay = 60 * 1000; double dBlockTimeOut = 10; AAMSTable = DBBuilder.GetAAMSDetails(3); try { if (AAMSTable.Rows.Count > 0) { ConfigManager.Read("CommsRegistryPath"); // var key = BMCRegistryHelper.GetRegLocalMachine().OpenSubKey(ConfigManager.Read("CommsRegistryPath")); //if (key != null) // dBlockTimeOut = Convert.ToDouble(key.GetValue("BlockingCallTimeOut")); dBlockTimeOut = Convert.ToDouble(BMCRegistryHelper.GetRegKeyValue(ConfigManager.Read("CommsRegistryPath"), "BlockingCallTimeOut")); int nMaxThreads = 0; nMaxThreads = Convert.ToInt32(ConfigManager.Read("MaxThreadPoolSize")); LogManager.WriteLog("[EnableDisableVLTBasedonVerfication]- MaxThreads: " + nMaxThreads.ToString(), LogManager.enumLogLevel.Info); LogManager.WriteLog("[EnableDisableVLTBasedonVerfication]- BlockingCallTimeOutValue: " + dBlockTimeOut.ToString(), LogManager.enumLogLevel.Info); dTimerDelay = ((AAMSTable.Rows.Count / nMaxThreads) * dBlockTimeOut) + 10000; LogManager.WriteLog("[EnableDisableVLTBasedonVerfication]: RowCount: " + AAMSTable.Rows.Count.ToString(), LogManager.enumLogLevel.Info); foreach (DataRow row in AAMSTable.Rows) { try { MachineEnableDisable _autoEnableDisable; string EntityCommand = string.Empty; int iCurrentStatus = 0; int iInstallationNo = 0; string strSerialno = string.Empty; string strComment = string.Empty; bool enterpriseStatus = false; int Installation_Float_Status; iCurrentStatus = row["BAD_Entity_Current_Status"] != DBNull.Value ? Convert.ToInt32(row["BAD_Entity_Current_Status"].ToString()) : 0; strSerialno = row["BAD_Asset_Serial_No"] == DBNull.Value ? string.Empty : row["BAD_Asset_Serial_No"].ToString(); enterpriseStatus = row["BMC_Enterprise_Status"] != DBNull.Value ? Convert.ToBoolean(row["BMC_Enterprise_Status"].ToString()) : true; Installation_Float_Status = row["Installation_Float_Status"] != DBNull.Value ? Convert.ToInt32(row["Installation_Float_Status"]) : 0; iInstallationNo = row["BAD_Reference_ID"] != DBNull.Value ? Convert.ToInt32(row["BAD_Reference_ID"].ToString()) : 0; LogManager.WriteLog("-- Enable Disable Status for AssetSerialNumber - " + strSerialno + ", " + "- Enterprise Status :" + enterpriseStatus.ToString() + "Inside EnableDisableVLTBasedonVerfication - ", LogManager.enumLogLevel.Info); _autoEnableDisable = new MachineEnableDisable() { Installation_No = iInstallationNo, Enable = false, badId = Convert.ToInt32(row["BAD_ID"]), datapakCurrentState = 0, entityType = 3, updateDate = Convert.ToDateTime(row["BAD_Updated_Date"]) }; if (Installation_Float_Status == 1 && DBBuilder.GetSettingFromDB("DISABLE_MACHINE_ON_DROP", "FALSE").ToUpper() == "TRUE") { LogManager.WriteLog("Disabling the machine - " + strSerialno, LogManager.enumLogLevel.Info); _autoEnableDisable.Enable = false; _autoEnableDisable.datapakCurrentState = 0; ThreadPool.QueueUserWorkItem(new WaitCallback(EnableDisableMachine), _autoEnableDisable); strComment = "Machine Floated and Setting DISABLE_MACHINE_ON_DROP {True} hence disabling."; LogManager.WriteLog(strComment, LogManager.enumLogLevel.Info); DBBuilder.UpdateCommentsForAAMS(row["BAD_ID"].ToString(), strComment, 3, 0); } else { if (enterpriseStatus) { _autoEnableDisable.Enable = true; _autoEnableDisable.datapakCurrentState = 1; ThreadPool.QueueUserWorkItem(new WaitCallback(EnableDisableMachine), _autoEnableDisable); LogManager.WriteLog("Enabling the machine - " + strSerialno, LogManager.enumLogLevel.Info); } else { _autoEnableDisable.Enable = false; _autoEnableDisable.datapakCurrentState = 0; ThreadPool.QueueUserWorkItem(new WaitCallback(EnableDisableMachine), _autoEnableDisable); strComment = "Disabling the machine - " + strSerialno; LogManager.WriteLog(strComment, LogManager.enumLogLevel.Info); DBBuilder.UpdateCommentsForAAMS(row["BAD_ID"].ToString(), strComment, 2, 0); } } LogManager.WriteLog("EnableDisableVLTBasedonVerfication - Completed.", LogManager.enumLogLevel.Info); } catch (Exception ex) { ExceptionManager.Publish(ex); } } } else { LogManager.WriteLog("No Machine to be enabled or disabled.", LogManager.enumLogLevel.Info); } return(dTimerDelay); } catch (Exception Ex) { ExceptionManager.Publish(Ex); return(60 * 1000); } }
private static string GetServerName() { return(BMCRegistryHelper.GetRegKeyValue(@"Cashmaster\Exchange", "Default_Server_Ip")); }
public static bool SaveServerConfig(string RootDirectory, string CommConfigFileName, string DefaultServerIP, string BindServerIP, string dhcpServerIP, int EnableDhcp, string multicastip, string interfaceip, int EncryptEnable, int RSAEnable, int DisMachineWhenRemove, List <string> ReplicateLocations) { string PROC = "SaveConfig"; bool bStatus = true; string _sCashmasterExchange = ""; string CommConfigFileLocation = RootDirectory + Path.DirectorySeparatorChar + CommConfigFileName; bool _bCashmasterConfig = Convert.ToBoolean(ConfigurationManager.AppSettings["CreateCashmasterFolderInsideLogs"].ToString() ?? "false"); if (_bCashmasterConfig) { _sCashmasterExchange = BMCRegistryHelper.GetRegKeyValue(string.Empty, "DefaultLogDir", "C:\\Logs") + Path.DirectorySeparatorChar + "CashmasterExchange"; } else { _sCashmasterExchange = (ConfigurationManager.AppSettings["CashmasterExchangeLogDrive"] ?? "c:") + Path.DirectorySeparatorChar + "CashmasterExchange"; } try { //Frames xml elements with default values XElement xConfig = new XElement("configuration", new XElement("client", new XElement("AppSetting", new XElement("ConfigLocation", new XAttribute("type", "CSTRING"), CommConfigFileLocation), new XElement("BindIPAddress", new XAttribute("type", "CSTRING"), BindServerIP), new XElement("Default_Server_Ip", new XAttribute("type", "CSTRING"), DefaultServerIP) ), new XElement("common", new XElement("ServerIPPort", new XAttribute("type", "DWORD"), 6810), new XElement("BlockingCallTimeOut", new XAttribute("type", "DWORD"), 10000) ), new XElement("Log", new XElement("ClientLog", new XAttribute("type", "DWORD"), 1), new XElement("ExchangeDir", new XAttribute("type", "CSTRING"), _sCashmasterExchange), new XElement("SocketLog", new XAttribute("type", "DWORD"), 1) )), new XElement("server", new XElement("AppSetting", new XElement("dhcp", new XElement("ServerIP", new XAttribute("type", "CSTRING"), dhcpServerIP), new XElement("NetMask", new XAttribute("type", "CSTRING"), "255.255.0.0"), new XElement("GatewayIP", new XAttribute("type", "CSTRING"), "10.0.0.1"), new XElement("DNSIP", new XAttribute("type", "CSTRING"), "10.0.0.1"), new XElement("LeaseTime", new XAttribute("type", "DWORD"), 6850) ), new XElement("exchange", new XElement("EnableDhcp", new XAttribute("type", "DWORD"), EnableDhcp), new XElement("multicastip", new XAttribute("type", "CSTRING"), multicastip), new XElement("interface", new XAttribute("type", "CSTRING"), interfaceip), new XElement("DisMachineWhenRemove", new XAttribute("type", "DWORD"), DisMachineWhenRemove), new XElement("EncryptEnable", new XAttribute("type", "DWORD"), EncryptEnable), new XElement("RSAEnable", new XAttribute("type", "DWORD"), RSAEnable) ) ) )); //Writes to a new file if (!WriteConfig(xConfig, CommConfigFileLocation, CommConfigFileName, RootDirectory, ReplicateLocations)) { bStatus = false; } } catch (Exception ex) { bStatus = false; LogManager.WriteLog(PROC + ": " + ex.Message.ToString() + ex.Source.ToString(), LogManager.enumLogLevel.Error); ExceptionManager.Publish(ex); } return(bStatus); }