public SMSEngine(string conString) { ConnectionString.con_string = conString; miscDAL = new DAL.MiscDAL(); try { m_SmsNos = miscDAL.GetSMSQueue(); StartSMSEngine(); } catch (Exception ex) { //MessageBox.Show(ex.Message); throw ex; } }
public SMSEngine() { miscDAL = new DAL.MiscDAL(); Modems = new List <Modem>(); ApplicationLogsList = new ObservableCollection <ApplicationLog>(); //Enable the cross acces to this collection elsewhere BindingOperations.EnableCollectionSynchronization(ApplicationLogsList, _syncLock); message = "Starting SMS Engine"; AddLog(EventLevel.Information.ToString(), DateTime.Now, EventSource.Initilization.ToString(), message); try { ConLocal = miscDAL.OpenLocalDatabaseConnection(); ConLocalSync = miscDAL.OpenLocalDatabaseConnection(); m_SmsNos = miscDAL.GetSMSQueue(ConLocal); StartDataTimer(); StartSMSEngine(); try { OpenOnlineConnectionAsync(); //ConOnline = miscDAL.OpenOnlineDatabaseConnection(); //m_IsOnlineConnectionOpen = true; } catch (Exception ex) { m_IsOnlineConnectionOpen = false; message = "Online Server Exception: " + ex.Message; AddLog(EventLevel.Information.ToString(), DateTime.Now, EventSource.Initilization.ToString(), message); //MessageBox.Show(ex.Message); } } catch (Exception ex) { message = "Exception: " + ex.Message; AddLog(EventLevel.Information.ToString(), DateTime.Now, EventSource.Initilization.ToString(), message); MessageBox.Show(ex.Message); } }