public ReloadSignatureImageURLMobileResponse getDamageSignature(ReloadSignatureImageURLMobileRequest imageURLMobileRequest, string token)
        {
            ReloadSignatureImageURLMobileResponse result = null;

            try
            {
                using (var client = new HttpClient())
                {
                    client.BaseAddress = new Uri(ConstantData.ApiURL.ToString() + "AgreementMobile/ReloadSignatureImageURLMobile");
                    client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
                    client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);

                    var myContent   = JsonConvert.SerializeObject(imageURLMobileRequest);
                    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 <ReloadSignatureImageURLMobileResponse>(responseStream);
                    }
                }
            }

            catch (Exception ex)
            {
                throw ex;
            }
            return(result);
        }
Beispiel #2
0
        private ReloadSignatureImageURLMobileResponse getDamageSignature(ReloadSignatureImageURLMobileRequest imageURLMobileRequest, string token)
        {
            ReloadSignatureImageURLMobileResponse response = null;
            AgreementController controller = new AgreementController();

            try
            {
                response = controller.getDamageSignature(imageURLMobileRequest, token);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(response);
        }
        public ReloadSignatureImageURLMobileResponse getDamageSignature(ReloadSignatureImageURLMobileRequest imageURLMobileRequest, string token)
        {
            ReloadSignatureImageURLMobileResponse response = null;

            try
            {
                response = agreementService.getDamageSignature(imageURLMobileRequest, token);
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(response);
        }
Beispiel #4
0
 public ViewMyRental(int agreementId)
 {
     InitializeComponent();
     this.agreementId = agreementId;
     token            = App.Current.Properties["currentToken"].ToString();
     AgreementByAgreementIdMobileRequest             = new GetAgreementByAgreementIdMobileRequest();
     AgreementByAgreementIdMobileRequest.agreementId = agreementId;
     AgreementByAgreementIdMobileResponse            = null;
     signMobileResponse                      = null;
     signMobileRequest                       = new AddAgreementSignMobileRequest();
     imageURLMobileRequest                   = new ReloadSignatureImageURLMobileRequest();
     imageURLMobileRequest.agreementId       = agreementId;
     imageURLMobileRequest.IsCheckIn         = false;
     imageURLMobileRequest.isDamageView      = false;
     imageURLMobileResponse                  = null;
     imageURLMobileRequest.SignatureImageUrl = "";
 }
Beispiel #5
0
 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 = "";
 }
Beispiel #6
0
 public AgreementScreen(int agreementId, int vehicleId)
 {
     InitializeComponent();
     On <Xamarin.Forms.PlatformConfiguration.iOS>().SetUseSafeArea(true);
     this.agreementId = agreementId;
     token            = App.Current.Properties["currentToken"].ToString();
     AgreementByAgreementIdMobileRequest             = new GetAgreementByAgreementIdMobileRequest();
     AgreementByAgreementIdMobileRequest.agreementId = agreementId;
     AgreementByAgreementIdMobileResponse            = null;
     signMobileResponse                      = null;
     signMobileRequest                       = new AddAgreementSignMobileRequest();
     imageURLMobileRequest                   = new ReloadSignatureImageURLMobileRequest();
     imageURLMobileRequest.agreementId       = agreementId;
     imageURLMobileRequest.IsCheckIn         = false;
     imageURLMobileRequest.isDamageView      = false;
     imageURLMobileResponse                  = null;
     imageURLMobileRequest.SignatureImageUrl = "";
     this.vehicleId          = vehicleId;
     vehicleController       = new VehicleController();
     getVehicleDetailsMobile = null;
 }
 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 = "";
 }