Ejemplo n.º 1
0
        public async Task <string> GuardarImagenFirmaEntrega(EntregaDetalleFirma adjunto)
        {
            DataService.AppDataService ds = new DataService.AppDataService(ParametrosSistema.TokenUsuarioActual);
            await ds.RealizarPeticionApi <string>("Entrega/GuardarFirmaEntrega", DataService.TipoPeticionApi.Post, adjunto);

            return("Exitoso");
        }
Ejemplo n.º 2
0
        private async void Button_Clicked(object sender, EventArgs e)
        {
            IsBusy = true;
            BtnGuardar.IsEnabled = false;

            Stream sigimage = await Padview.GetImageStreamAsync(SignaturePad.Forms.SignatureImageFormat.Png);

            if (sigimage == null)
            {
                return;
            }

            BinaryReader br = new BinaryReader(sigimage);

            br.BaseStream.Position = 0;
            Byte[]      All         = br.ReadBytes((int)sigimage.Length);
            byte[]      image       = (byte[])All;
            ImageSource imageSource = null;

            imageSource = ImageSource.FromStream(() => new MemoryStream(image));



            string _base64String = Convert.ToBase64String(image);

            EntregaDetalleFirma adjunto = new EntregaDetalleFirma();

            adjunto.NombreArchivo = numeroEntrega;
            adjunto.Extension     = "png";
            adjunto.Base64String  = "data:image/png;base64," + _base64String;
            adjunto.PdfCombinado  = false;
            adjunto.Observaciones = txtObservaciones.Text;

            EntregaBLL entregaBBL = new EntregaBLL();
            string     respuesta  = await entregaBBL.GuardarImagenFirmaEntrega(adjunto);

            IsBusy = false;
            BtnGuardar.IsEnabled = true;

            DisplayAlert("Message", "Firma guardada correctamente", "OK");
            await Navigation.PushAsync(new Logistica.CrearEventoView(_idevento, _nombreEvento));
        }