Beispiel #1
0
 public LoadInformation(GetLoadInfoResponseModel getLoadInfoResponse)
 {
     InitializeComponent();
     NavigationPage.SetHasNavigationBar(this, false);
     this.BindingContext = getLoadInfoResponse;
     //this.BindingContext = starHaulingResponseModel;
 }
Beispiel #2
0
        private async void GetLoadInfo()
        {
            try
            {
                XFActIndicatorLoader.IsVisible = true;
                HttpResponseMessage response = null;
                HttpClient          client   = new HttpClient();
                client.DefaultRequestHeaders.Authorization =
                    new AuthenticationHeaderValue(
                        "Basic",
                        Convert.ToBase64String(
                            System.Text.ASCIIEncoding.ASCII.GetBytes(
                                string.Format("{0}:{1}", "jigadmin", "Gr8ApI#"))));

                client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
                response = client.GetAsync("https://api.soilflo.com/hauler/GetDelivery/" + Settings.QRCode).Result;

                if (response.IsSuccessStatusCode)
                {
                    var SucessResponse = await response.Content.ReadAsStringAsync();

                    getLoadInfoResponse = JsonConvert.DeserializeObject <GetLoadInfoResponseModel>(SucessResponse);
                    if (getLoadInfoResponse.status == "Success")
                    {
                        XFActIndicatorLoader.IsVisible = false;
                        Settings.DestLon      = getLoadInfoResponse.Lon;
                        Settings.DestLat      = getLoadInfoResponse.Lat;
                        XFDestinationLbl.Text = getLoadInfoResponse.DisposalSiteName + getLoadInfoResponse.City + getLoadInfoResponse.Street + getLoadInfoResponse.Province;
                        Settings.AddressName  = getLoadInfoResponse.DisposalSiteName + getLoadInfoResponse.City + getLoadInfoResponse.Street + getLoadInfoResponse.Province;
                    }
                }
                else
                {
                    XFActIndicatorLoader.IsVisible = false;
                    var ErrorResponse = await response.Content.ReadAsStringAsync();
                    await DisplayAlert("Status Failed", "The Ticket Delivery details are not found", "Ok");
                }
            }
            catch (Exception ex)
            {
                XFActIndicatorLoader.IsVisible = false;
                var msg = ex.Message;
                await DisplayAlert("Error", "Server Error", "Ok");
            }
        }
 public WaitingScreen(StarHaulingResponseModel startHaulingResponse)
 {
     InitializeComponent();
     _apiServices          = new RestApi();
     _baseUrl              = Domain.Url + Domain.SetCurrentPositionApiConstant;
     getStatusResponse     = new GetStatusResponseModel();
     getStatusRequest      = new GetStatusRequestModel();
     setPositionRequest    = new SetPositionRequestModel();
     setPositionResponse   = new SetPositionResponseModel();
     getLoadInfoResponse   = new GetLoadInfoResponseModel();
     Settings.LicensePlate = startHaulingResponse.LicensePlate;
     Settings.ProjectName  = startHaulingResponse.ProjectName;
     this.BindingContext   = startHaulingResponse;
     GetPermission();
     GetLoadInfo();
     GetStatusReady();
     SetPositionReady();
     //GetPermission();
 }
Beispiel #4
0
 public CurrentTrip()
 {
     InitializeComponent();
     _apiServices            = new RestApi();
     _baseUrl                = Domain.Url + Domain.SetCurrentPositionApiConstant;
     _baseUrl2               = Domain.Url + Domain.SetStatusApiConstant;
     setStatusRequest        = new SetStatusRequest();
     setStatusResponse       = new SetStatusResponse();
     getLoadInfoResponse     = new GetLoadInfoResponseModel();
     setPositionRequest      = new SetPositionRequestModel();
     setPositionResponse     = new SetPositionResponseModel();
     startHaulingResponse    = new StarHaulingResponseModel();
     getStatusResponse       = new GetStatusResponseModel();
     getStatusRequest        = new GetStatusRequestModel();
     XFLabelCurrentTrip.Text = "STATUS - HAULING";
     XFDestinationLbl.Text   = Settings.AddressName;
     //GetLoadInfo();
     SetPositionReady();
     GetStatusReady();
 }