public LevantarReporte(string c)
 {
     reporte = new Model.Reportes();
     device  = new InventDB();
     InitializeComponent();
     nombreID.Text = c;
 }
예제 #2
0
 public Confirmar(Carrito x)
 {
     InitializeComponent();
     rp            = x;
     p             = Guid.NewGuid().ToString("D");
     pdf           = new GeneratePDF();
     CurrentDevice = new InventDB();
 }
        private async void fillDevice(List <InventDB> tabla)
        {
            try
            {
                device        = tabla[0];
                lbNombre.Text = device.nombre;
                lbMarca.Text  = device.marca;
                lbSerie.Text  = device.serie;
                lbModelo.Text = device.modelo;
                lbAccDe.Text  = device.pertenece;
                isFull        = true;
            }
            catch
            {
                await DisplayAlert("No Product", "producto no encontrado", "OK");

                isFull = false;
            }
        }
예제 #4
0
        private async void AgregarP(object sender, EventArgs e)
        {
            InventDB invent = new InventDB
            {
                ID            = PathFoto,
                codigo        = codigoEntry.Text,
                nombre        = nameEntry.Text,
                marca         = marca.Text,
                modelo        = modelo.Text,
                costo         = costo.Text,
                compra        = compra.Text,
                serie         = serie.Text,
                origen        = origen.Text,
                descompostura = dec.Text,
                pertenece     = pert.Text,
                lugar         = "Almacen",
                cantidad      = cant.Text,
                observaciones = observ.Text,
                proveedor     = proveedor.Text,
                foto          = PathFoto + ".jpg",
                Fecha         = DateTime.Now.ToString("dd/MM/yyyy")
            };

            try
            {
                await App.MobileService.GetTable <InventDB>().InsertAsync(invent);

                if (!(f == null))
                {
                    UploadFile(f.GetStream());
                }

                await DisplayAlert("Agregado", "Producto agregado correctamente", "Aceptar");

                await Navigation.PopAsync();
            }
            catch (MobileServiceInvalidOperationException ms)
            {
                var response = await ms.Response.Content.ReadAsStringAsync();
                await DisplayAlert("error", response, "Aceptar");
            }
        }
예제 #5
0
        private async Task UpdateLocations(List <Movimientos> movimientos, string lugar)
        {
            foreach (Movimientos movimiento in movimientos)
            {
                try
                {
                    var tablainventario = await App.MobileService.GetTable <InventDB>().Where(u => u.codigo == movimiento.codigo).ToListAsync();

                    if (tablainventario.Count != 0)
                    {
                        CurrentDevice       = tablainventario[0];
                        CurrentDevice.lugar = lugar;

                        //update
                        await App.MobileService.GetTable <InventDB>().UpdateAsync(CurrentDevice);
                    }
                }
                catch
                {
                }
            }
        }
 public DetallesProducto(InventDB db)
 {
     InitializeComponent();
     this.n = db;
 }
 public EditarProducto(DetallesProducto nu)
 {
     InitializeComponent();
     pr  = nu.n;
     pro = nu;
 }