private void PhoneApplicationPage_Loaded_1(object sender, RoutedEventArgs e) { try { if (objclsCommon.DeviceId!=null) { byte[] myDeviceID = (byte[])Microsoft.Phone.Info.DeviceExtendedProperties.GetValue("DeviceUniqueId"); StrDeviceId = Convert.ToBase64String(myDeviceID); ; if (StrDeviceId.Length == 0) { StrDeviceId = "0"; } } if (!objclsCommon.RegStatus) { //StrDeviceId = "8d5953f4cf10e8e291cab2c5a4959f224e06de70"; StrDeviceId = "X KVicElWiaSlb6v1ZVf9Bzdgo0"; // StrDeviceId = "123456789"; if (!IsolatedStorageSettings.ApplicationSettings.Contains("complete")) { IsolatedStorageSettings.ApplicationSettings.Add("complete", "False"); IsolatedStorageSettings.ApplicationSettings.Save(); } objclsCommon.DeviceId = StrDeviceId; if (Microsoft.Phone.Net.NetworkInformation.NetworkInterface.NetworkInterfaceType != Microsoft.Phone.Net.NetworkInformation.NetworkInterfaceType.None) { ClsJourneyDetails objClsJourneyDetails = new ClsJourneyDetails(); objClsJourneyDetails.GetJourneylist(objclsCommon.DeviceId, this); objClsJourneyDetails = null; } else { MessageBox.Show("Internet connection not available. Please try again later!"); //objclsCommon.JourneyListDetails = null; strCommonObj = JsonConvert.SerializeObject(objclsCommon); if (IsolatedStorageSettings.ApplicationSettings["complete"] == "False") { Deployment.Current.Dispatcher.BeginInvoke(() => { objclsCommon.DeviceId = StrDeviceId; objclsCommon.SaveSettings(); NavigationService.Navigate(new Uri("/Pages/FrmRegistration.xaml?FromSplash=true&common=" + strCommonObj, UriKind.Relative)); }); } else { Deployment.Current.Dispatcher.BeginInvoke(() => { NavigationService.Navigate(new Uri("/Pages/frmRecord.xaml?common=" + strCommonObj, UriKind.Relative)); }); } } } } catch { } }
private void btnSkip_Click(object sender, RoutedEventArgs e) { try { ObjCommon.RegStatus = true; ObjCommon.SaveSettings(); if (Microsoft.Phone.Net.NetworkInformation.NetworkInterface.NetworkInterfaceType != Microsoft.Phone.Net.NetworkInformation.NetworkInterfaceType.None) { ClsJourneyDetails objClsJourneyDetails = new ClsJourneyDetails(); objClsJourneyDetails.GetJourneylist(ObjCommon.DeviceId.ToString(), this); objClsJourneyDetails = null; } else { Deployment.Current.Dispatcher.BeginInvoke(() => { MessageBox.Show("Internet connection not available. Please try again later!"); NavigationService.Navigate(new Uri("/Pages/frmRecord.xaml?common=" + StrCommonObject, UriKind.Relative)); }); } } catch { } }
private void NormalProcess() { if (!objclsCommon.RegStatus) { Deployment.Current.Dispatcher.BeginInvoke(() => { strCommonObj = JsonConvert.SerializeObject(objclsCommon); NavigationService.Navigate(new Uri("/Pages/FrmRegistration.xaml?FromSplash=true&common=" + strCommonObj, UriKind.Relative)); }); } else if (Microsoft.Phone.Net.NetworkInformation.NetworkInterface.NetworkInterfaceType != Microsoft.Phone.Net.NetworkInformation.NetworkInterfaceType.None) { ClsJourneyDetails objClsJourneyDetails = new ClsJourneyDetails(); objClsJourneyDetails.GetJourneylist(objclsCommon.DeviceId, this); objClsJourneyDetails = null; } else { MessageBox.Show("Internet connection not available. Please try again later!"); strCommonObj = JsonConvert.SerializeObject(objclsCommon); if (objclsCommon.RegStatus) { Deployment.Current.Dispatcher.BeginInvoke(() => { System.Threading.Thread.Sleep(2000); NavigationService.Navigate(new Uri("/Pages/frmRecord.xaml?common=" + strCommonObj, UriKind.Relative)); }); } } }