async Task <bool> CargarFoto()
        {
            return(await Task.Factory.StartNew(() =>
            {
                OperationClient WS = null;

                try{
                    WS = Utils.InitializeServiceClient();
                    Request = WS.UploadODTFotoForMovil(ODTDet.Folio, Utils.compress(Convert.ToBase64String(bitmapDetalle, Base64FormattingOptions.InsertLineBreaks)));


                    if (Request.IsComplete && Convert.ToInt32(Request.RecordId) != 0)
                    {
                        idevidencia = Convert.ToInt32(Request.RecordId);
                        return true;
                    }
                    else
                    {
                        return false;
                    }
                }catch (Exception ex)
                {
                    return false;
                }
            }));
        }
Пример #2
0
        public static async Task <int> CargarFoto(string folio, byte[] Foto, Context ApplicationContext, string fecha)
        {
            int retorno = 0;

            return(await Task.Factory.StartNew(() =>
            {
                OperationClient WS = null;
                try{
                    WS = Utils.InitializeServiceClient();
                    OperationStatus Request = WS.UploadODTFotoForMovil(folio, Utils.compress(Convert.ToBase64String(Foto, Base64FormattingOptions.InsertLineBreaks)));
                    if (Request.IsComplete)
                    {
                        retorno = Convert.ToInt32(Request.RecordId);
                    }
                }catch (Exception ex)
                {
                    retorno = 0;
                }
                finally
                {
                    if (WS != null)
                    {
                        WS.Close();
                    }
                }
                return retorno;
            }));
        }