private void TestConnection() { try { AssignRecords(true); SetBALConnection.SetConnectionString(AppConnectionString.ConnectionString); compbal = new CompanyBAL(); comp = compbal.GetByID(1); AppSettings.CompanyProfile = comp; } catch (Exception ex) { throw ex; } }
private void AssignRecord(Boolean IsSave) { try { if (IsSave) { comp.COMPANY = mtxtCompany.Text; comp.SHORTNAME = mtxtShortName.Text; comp.ADDRESS1 = mtxtAddress1.Text; comp.ADDRESS2 = mtxtAddress2.Text; //comp.IsActive = mcbActive.Checked; comp.TELNOS = mtxtTelNos.Text; comp.MOBILENOS = mtxtMobileNos.Text; comp.FAXNOS = mtxtFaxNos.Text; comp.EMAIL = mtxtEmail.Text; } else { comp = compbal.GetByID(compID); if (comp != null) { mtxtCompany.Text = comp.COMPANY; mtxtShortName.Text = comp.SHORTNAME; mtxtAddress1.Text = comp.ADDRESS1; mtxtAddress2.Text = comp.ADDRESS2; //mcbActive.Checked=comp.IsActive; mtxtTelNos.Text = comp.TELNOS; mtxtMobileNos.Text = comp.MOBILENOS; mtxtFaxNos.Text = comp.FAXNOS; mtxtEmail.Text = comp.EMAIL; } else { throw new Exception("Record doesn't exist!"); } } RefreshGrid(); } catch (Exception ex) { throw ex; } }
private static void TestConnection() { Thread t = new Thread(new ThreadStart(Loading)); t.Start(); //open splash try { CompanyBAL compbal; compbal = new CompanyBAL(); AppSettings.CompanyProfile = compbal.GetByID(1); AppSettings.AppConnected = true; Preloader.Preload(); //Preload Report //Cache.Refresh(); t.Abort(); //close splash } catch (Exception ex) { t.Abort(); //close splash MessageHelpers.ShowError(ex.Message); AppSettings.AppConnected = false; } }