public void RefreshApp()
 {
     lock (_Lock)
     {
         _SiteDetails = null;
     }
 }
Esempio n. 2
0
 public static SiteDetails GetInstance()
 {
     lock (_Lock)
     {
         if (_SiteDetails == null || DateTime.Now.Subtract(dtUpdated).TotalMinutes > Settings.RefreshSiteDetailsInMinutes)
         {
             _SiteDetails = new SiteDetails();
             _DataAdapter = new DataAdapter();
             Hashtable _hsSiteDetails = _DataAdapter.GetSiteDetails();
             _SiteDetails.Area        = _hsSiteDetails["Area"].ToString();
             _SiteDetails.Company     = _hsSiteDetails["Company"].ToString();
             _SiteDetails.District    = _hsSiteDetails["District"].ToString();
             _SiteDetails.Region      = _hsSiteDetails["Region"].ToString();
             _SiteDetails.Sub_Company = _hsSiteDetails["Sub_Company"].ToString();
             Relauncher.GetInstance().RegisterForUpdate(_SiteDetails);
             dtUpdated = DateTime.Now;
         }
         return(_SiteDetails);
     }
 }
 public static SiteDetails GetInstance()
 {
     lock (_Lock)
     {
         if (_SiteDetails == null || DateTime.Now.Subtract(dtUpdated).TotalMinutes > Settings.RefreshSiteDetailsInMinutes)
         {
             _SiteDetails = new SiteDetails();
             _DataAdapter = new DataAdapter();
              Hashtable _hsSiteDetails = _DataAdapter.GetSiteDetails();
             _SiteDetails.Area = _hsSiteDetails["Area"].ToString();
             _SiteDetails.Company = _hsSiteDetails["Company"].ToString();
             _SiteDetails.District = _hsSiteDetails["District"].ToString();
             _SiteDetails.Region = _hsSiteDetails["Region"].ToString();
             _SiteDetails.Sub_Company = _hsSiteDetails["Sub_Company"].ToString();
             Relauncher.GetInstance().RegisterForUpdate(_SiteDetails);
             dtUpdated = DateTime.Now;
         }
         return _SiteDetails;
     }
 }