Ejemplo n.º 1
0
        public AddDamageSignMobileResponse saveDamageSignature(AddDamageSignMobileRequest signMobileRequest, string token)
        {
            AddDamageSignMobileResponse result = null;

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

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

            catch (Exception ex)
            {
                throw ex;
            }
            return(result);
        }
Ejemplo n.º 2
0
        private AddDamageSignMobileResponse saveDamageSignature(AddDamageSignMobileRequest signMobileRequest, string token)
        {
            AgreementController         agreementController = new AgreementController();
            AddDamageSignMobileResponse response            = null;

            try
            {
                response = agreementController.saveDamageSignature(signMobileRequest, token);
            }
            catch (Exception e)
            {
                throw e;
            }
            return(response);
        }
Ejemplo n.º 3
0
        public AddDamageSignMobileResponse saveDamageSignature(AddDamageSignMobileRequest signMobileRequest, string token)
        {
            AddDamageSignMobileResponse response = null;

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

            return(response);
        }
Ejemplo n.º 4
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 = "";
 }
 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 = "";
 }