예제 #1
0
        public async override void ViewWillAppear(bool animated)
        {
            base.ViewWillAppear(animated);

            try {
                Service.Service servicio     = new Service.Service();
                Service.Service servAumentos = new Service.Service();
                listAumentos = await servAumentos.getAumentos();

                Console.WriteLine("IdProducto" + idProduct + "  adasd" + idProducto);
                lstDetailProductStock = await servicio.DetailStock(idProducto);

                aumentosTable.Source = new aumentosSource(listAumentos, CostoFijo, precioVenta);
                aumentosTable.ReloadData();

                Console.WriteLine("Stock detalle " + lstDetailProductStock.Count);
                if (lstDetailProductStock.Count > 0)
                {
                    stockButton.Enabled         = true;
                    stockButton.BackgroundColor = UIColor.FromRGB(255, 38, 0);
                }
            }
            catch {
                Console.WriteLine("Fallo solicitar stockDetail");
                var stockErrorAlert = UIAlertController.Create("Error de Red", "Necesita conectarse para solicitar estos datos", UIAlertControllerStyle.Alert);


                stockErrorAlert.AddAction(UIAlertAction.Create("Ok", UIAlertActionStyle.Default, null));
            }
        }