public void GetJourneyDetails(RootObjectJourneydetail Journey)
        {
            ObjCommon.JourneyListDetails = JsonConvert.SerializeObject(Journey);
            StrCommonObject = JsonConvert.SerializeObject(ObjCommon);
            var context = new DataAccessLayer.AgeasDriverDetails(ClsDBHelper.ClsDBHelper.DBConnectionString);
            ObjCommon.ClearLocationRecord();
            ObjCommon.JourneySave();
            List<JourneyDetails> Journelist = (from a in context.tblJourneyDetails select a).ToList();
            List<Journeydetail> databaseJlist = new List<Journeydetail>();
            Journeydetail _Journey;
            for (int i = 0; i < Journelist.Count; i++)
            {
                _Journey = new Journeydetail();
                _Journey.journey_id = Journelist[i].JourneyId.ToString();
                _Journey.distance = Convert.ToDouble(Journelist[i].Last_distance);
                _Journey.time = Journelist[i].TimeDuration.ToString();
                _Journey.date = Journelist[i].JDate.ToString();
                databaseJlist.Add(_Journey);
                _Journey = null;
            }

            Deployment.Current.Dispatcher.BeginInvoke(() =>
            {
                lstjourneyList.ItemsSource = null;
                lstjourneyList.ItemsSource = databaseJlist;
            });

            if (jlist != null)
            {
                string number = jlist.journey_id;
                ClsJourney objJourney = new ClsJourney();
                objJourney.GetJourneyDetails(ObjCommon.DeviceId, jlist.journey_id, this);
            }
        }
Exemplo n.º 2
0
        public void IsDeviceRegistered(RootObjectJourneydetail JDetails)
        {
            try
            {
                objclsCommon.JourneyListDetails = JsonConvert.SerializeObject(JDetails);
                objclsCommon.SaveSettings();
                objclsCommon.LoadSettings();
                strCommonObj = JsonConvert.SerializeObject(objclsCommon);

                if (!JDetails.complete && !objclsCommon.RegStatus)
                {
                    Deployment.Current.Dispatcher.BeginInvoke(() =>
                    {
                        objclsCommon.DeviceId = StrDeviceId;
                        objclsCommon.RegStatus = true;// JDetails.complete;
                        objclsCommon.SaveSettings();
                        NavigationService.Navigate(new Uri("/Pages/FrmRegistration.xaml?FromSplash=true&common=" + strCommonObj, UriKind.Relative));
                    });
                }

                else
                {
                    Deployment.Current.Dispatcher.BeginInvoke(() =>
                   {

                       System.Threading.Thread.Sleep(2000);
                       NavigationService.Navigate(new Uri("/Pages/frmRecord.xaml?common=" + strCommonObj, UriKind.Relative));
                   });
                }
            }
            catch (Exception ex)
            {
            }
        }
Exemplo n.º 3
0
 public void GetJourneyDetails(RootObjectJourneydetail Journey)
 {
     objclsCommon.JourneyListDetails = JsonConvert.SerializeObject(Journey);
     strCommonObj = JsonConvert.SerializeObject(objclsCommon);
     objclsCommon.ClearLocationRecord();
     objclsCommon.JourneySave();
     NormalProcess();
 }
Exemplo n.º 4
0
        public void GetJourneyDetails(RootObjectJourneydetail Journey)
        {
            ObjCommon.JourneyListDetails = JsonConvert.SerializeObject(Journey);
            StrCommonObject = JsonConvert.SerializeObject(ObjCommon);
            var context = new DataAccessLayer.AgeasDriverDetails(ClsDBHelper.ClsDBHelper.DBConnectionString);
            context = new DataAccessLayer.AgeasDriverDetails(ClsDBHelper.ClsDBHelper.DBConnectionString);
            objDBHelper = new ClsDBHelper.ClsDBHelper();
            IQueryable<DataAccessLayer.LocationTable> DeleteLocation = from c in context.tblLocation select c;
            objDBHelper.DeleteLocation(DeleteLocation, context);

            ObjCommon.JourneySave();
        }
        public void IsSubmitComplete(RootObjectJourneydetail JDetails)
        {
            try
            {
                cnvBackground.Visibility = Visibility.Collapsed;
                Deployment.Current.Dispatcher.BeginInvoke(() =>
                {
                    NavigationService.Navigate(new Uri("/Pages/frmRecord.xaml?common=" + StrCommonObject, UriKind.Relative));
                });
            }

            catch { }
        }
 public void GetJourneyDetails(RootObjectJourneydetail Journey)
 {
     ObjCommon.JourneyListDetails = JsonConvert.SerializeObject(Journey);
     StrCommonObject = JsonConvert.SerializeObject(ObjCommon);
     lstjourneyList.ItemsSource = ObjRootJouneyDtls.user_journey.journeydetails;
     if (jlist != null)
     {
         string number = jlist.journey_id;
         ClsJourney objJourney = new ClsJourney();
         objJourney.GetJourneyDetails(ObjCommon.DeviceId, jlist.journey_id, this);
         //NavigationService.Navigate(new Uri("/Pages/frmDetailMessage.xaml?ph_num=" + number +"&Contact_Header=" + mlist.ContactName, UriKind.Relative));
     }
 }
        public void IsSkip(RootObjectJourneydetail JDetails)
        {
            ObjCommon.JourneyListDetails = JsonConvert.SerializeObject(JDetails);
            string strCommonObj = JsonConvert.SerializeObject(ObjCommon);
            try
            {
                Deployment.Current.Dispatcher.BeginInvoke(() =>
                {
                    NavigationService.Navigate(new Uri("/Pages/frmRecord.xaml?common=" + strCommonObj, UriKind.Relative));
                });
            }

            catch { }
        }
Exemplo n.º 8
0
        public void IsDeviceRegistered(RootObjectJourneydetail JDetails)
        {
            try
            {

                objclsCommon.JourneyListDetails = JsonConvert.SerializeObject(JDetails);

                 strCommonObj = JsonConvert.SerializeObject(objclsCommon);

                IsolatedStorageSettings.ApplicationSettings["complete"] = JDetails.complete;

                IsolatedStorageSettings.ApplicationSettings.Save();

                if (!JDetails.complete)
                    {
                        Deployment.Current.Dispatcher.BeginInvoke(() =>
                        {

                            objclsCommon.DeviceId = StrDeviceId;
                            objclsCommon.SaveSettings();
                            NavigationService.Navigate(new Uri("/Pages/FrmRegistration.xaml?FromSplash=true&common=" + strCommonObj, UriKind.Relative));
                        });
                    }

                else
                {
                    //DoorOpen.Begin();
                    //DoorOpen.Completed += new EventHandler(DoorOpen_Completed);
                     Deployment.Current.Dispatcher.BeginInvoke(() =>
            {

                NavigationService.Navigate(new Uri("/Pages/frmRecord.xaml?common=" + strCommonObj, UriKind.Relative));
            });

                        }

            }
            catch(Exception ex)
            {
            }
        }
        protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
        {
            try
            {
                StrCommonObject = NavigationContext.QueryString["common"];
                ObjCommon = JsonConvert.DeserializeObject<ClsCommon>(StrCommonObject);

                base.OnNavigatedTo(e);
                ImgHeader.Source = new System.Windows.Media.Imaging.BitmapImage(ClsCommon.GetScaledImageUri("/Images/Progress/upperStrip"));
                ImgProgressSelect.Source = new System.Windows.Media.Imaging.BitmapImage(ClsCommon.GetScaledImageUri("/Images/General/progressSelected"));
                ImgRecordDeselect.Source = new System.Windows.Media.Imaging.BitmapImage(ClsCommon.GetScaledImageUri("/Images/General/record"));
                ImgHelpDeselect.Source = new System.Windows.Media.Imaging.BitmapImage(ClsCommon.GetScaledImageUri("/Images/General/help"));
                ImgQuoteDeselect.Source = new System.Windows.Media.Imaging.BitmapImage(ClsCommon.GetScaledImageUri("/Images/General/quote"));
                ImgProgress.Source = new System.Windows.Media.Imaging.BitmapImage(ClsCommon.GetScaledImageUri("/Images/Progress/mainBg_progress1"));
                ImgProgressButtom.Source = new System.Windows.Media.Imaging.BitmapImage(ClsCommon.GetScaledImageUri("/Images/Progress/mainBg_progress2"));
                txtprogressvalue.Text = "0.5";
                //ObjCommon.TotalJourney = 152;
                if (ObjCommon != null)
                {
                    ObjRootJouneyDtls = JsonConvert.DeserializeObject<RootObjectJourneydetail>(ObjCommon.JourneyListDetails);
                    if (ObjCommon.TotalJourney < 51)
                    {
                        ImageBrush _ImageBrush = new ImageBrush();
                        _ImageBrush.ImageSource = new System.Windows.Media.Imaging.BitmapImage(ClsCommon.GetScaledImageUri("/Images/Progress/displayUnselected"));
                        stackprogress.Background = _ImageBrush;
                        _ImageBrush = null;
                    }
                    else if (ObjCommon.TotalJourney < 100)
                    {
                        ImageBrush _ImageBrush = new ImageBrush();
                        _ImageBrush.ImageSource = new System.Windows.Media.Imaging.BitmapImage(ClsCommon.GetScaledImageUri("/Images/Progress/display(50)"));
                        stackprogress.Background = _ImageBrush;
                        _ImageBrush = null;
                    }
                    else if (ObjCommon.TotalJourney < 150)
                    {
                        ImageBrush _ImageBrush = new ImageBrush();
                        _ImageBrush.ImageSource = new System.Windows.Media.Imaging.BitmapImage(ClsCommon.GetScaledImageUri("/Images/Progress/display(100)"));
                        stackprogress.Background = _ImageBrush;
                        _ImageBrush = null;
                    }
                    //else if (ObjCommon.TotalJourney >= 150)
                    //{

                    //    ImageBrush _ImageBrush = new ImageBrush();
                    //    _ImageBrush.ImageSource = new System.Windows.Media.Imaging.BitmapImage(ClsCommon.GetScaledImageUri("/Images/Progress/display(150)"));
                    //    stackprogress.Background = _ImageBrush;
                    //    _ImageBrush = null;
                    //    StrCommonObject = JsonConvert.SerializeObject(ObjCommon);
                    //    NavigationService.Navigate(new Uri("/Pages/FrmScore.xaml?common=" + StrCommonObject, UriKind.Relative));
                    //}

                    else
                    {
                        ImageBrush _ImageBrush = new ImageBrush();
                        _ImageBrush.ImageSource = new System.Windows.Media.Imaging.BitmapImage(ClsCommon.GetScaledImageUri("/Images/Progress/displayUnselected"));
                        stackprogress.Background = _ImageBrush;
                        _ImageBrush = null;
                    }
                }

                TxtBudget.Text = "LATEST BUDGET EARNED!";
                TxtBudgetDetails.Text = "Well done,you handle those \n comer safely";
                TxtShare.Text = "Share with:";
                TxtJourneyCmplt.Text = "JOURNEYS COMPLETED";

                Imgfacebk.Source = new System.Windows.Media.Imaging.BitmapImage(ClsCommon.GetScaledImageUri("/Images/Progress/facebookIcon"));
                Imgtwitter.Source = new System.Windows.Media.Imaging.BitmapImage(ClsCommon.GetScaledImageUri("/Images/Progress/twitterIcon"));

                ImgTblHeader.Source = new System.Windows.Media.Imaging.BitmapImage(ClsCommon.GetScaledImageUri("/Images/Progress/tableHeader"));

                objDBHelper = new ClsDBHelper.ClsDBHelper();
                var context = new DataAccessLayer.AgeasDriverDetails(ClsDBHelper.ClsDBHelper.DBConnectionString);

                List<JourneyDetails> Journelist = (from a in context.tblJourneyDetails select a).ToList();

                List<Journeydetail> databaseJlist = new List<Journeydetail>();
                Journeydetail _Journey;
                for (int i = 0; i < Journelist.Count; i++)
                {
                    _Journey = new Journeydetail();
                    _Journey.journey_id = Journelist[i].JourneyId.ToString();
                    _Journey.distance = Convert.ToDouble(Journelist[i].Last_distance.ToString("0.00"));
                    _Journey.time = Journelist[i].TimeDuration.ToString();
                    _Journey.date = Journelist[i].JDate.ToString();
                    databaseJlist.Add(_Journey);
                    _Journey = null;
                }
                lstjourneyList.ItemsSource = databaseJlist;

                if (Journelist.Count > 0)
                {
                    TxtlatestdisValue.Text = Journelist[Journelist.Count - 1].Last_distance.ToString("0.00");

                }

            }
            catch (Exception ex)
            {
            }
        }