public GetChecklistMobileResponse getDamageCheckListMobile(GetChecklistMobileRequest checklistMobileRequest, string token) { GetChecklistMobileResponse result = null; try { using (var client = new HttpClient()) { client.BaseAddress = new Uri(ConstantData.ApiURL.ToString() + "CheckListMobile/GetClientChecklistMobile"); client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); var myContent = JsonConvert.SerializeObject(checklistMobileRequest); var buffer = Encoding.UTF8.GetBytes(myContent); var byteContent = new ByteArrayContent(buffer); byteContent.Headers.ContentType = new MediaTypeHeaderValue("application/json"); var response = client.PostAsync(client.BaseAddress, byteContent).Result; if (response.IsSuccessStatusCode) { var responseStream = response.Content.ReadAsStringAsync().Result; result = JsonConvert.DeserializeObject <GetChecklistMobileResponse>(responseStream); } } } catch (Exception ex) { throw ex; } return(result); }
public GetChecklistMobileResponse getDamageCheckListMobile(GetChecklistMobileRequest checklistMobileRequest, string token) { GetChecklistMobileResponse response = null; try { response = vehicleService.getDamageCheckListMobile(checklistMobileRequest, token); } catch (Exception ex) { throw ex; } return(response); }
private GetChecklistMobileResponse getDamageCheckListMobile(GetChecklistMobileRequest checklistMobileRequest, string token) { GetChecklistMobileResponse response = null; VehicleController vehicle = new VehicleController(); try { response = vehicle.getDamageCheckListMobile(checklistMobileRequest, token); } catch (Exception ex) { throw ex; } return(response); }
public DamageCheckListCheckIn(int agreementId, string AgreementNumber, int VehicleId) { InitializeComponent(); this.agreementId = agreementId; this.agreementNumber = AgreementNumber; this.vehicleId = VehicleId; checklistMobileRequest = new GetChecklistMobileRequest(); checklistMobileRequest.AgreementId = agreementId; checklistMobileRequest.clientId = Constants.ClientId; checklistMobileResponse = null; token = App.Current.Properties["currentToken"].ToString(); SignMobileRequest = new AddDamageSignMobileRequest(); signMobileResponse = null; imageURLMobileRequest = new ReloadSignatureImageURLMobileRequest(); imageURLMobileRequest.agreementId = agreementId; imageURLMobileRequest.IsCheckIn = true; imageURLMobileRequest.isDamageView = true; imageURLMobileResponse = null; imageURLMobileRequest.SignatureImageUrl = ""; }
public DamageCheckListCheckOut(int agreementId, string agreementNo, int status, int VehicleId) { InitializeComponent(); On <Xamarin.Forms.PlatformConfiguration.iOS>().SetUseSafeArea(true); this.agreementId = agreementId; AgreementNumber = agreementNo; this.VehicleId = VehicleId; this.status = status; checklistMobileRequest = new GetChecklistMobileRequest(); checklistMobileRequest.AgreementId = agreementId; checklistMobileRequest.clientId = Constants.ClientId; checklistMobileResponse = null; token = App.Current.Properties["currentToken"].ToString(); signMobileResponse = null; SignMobileRequest = new AddDamageSignMobileRequest(); imageURLMobileRequest = new ReloadSignatureImageURLMobileRequest(); imageURLMobileRequest.agreementId = agreementId; imageURLMobileRequest.IsCheckIn = false; imageURLMobileRequest.isDamageView = true; imageURLMobileResponse = null; imageURLMobileRequest.SignatureImageUrl = ""; }