예제 #1
0
        private async void btnGuardar_Click_1(object sender, EventArgs e)
        {
            loadState(true);
            try
            {
                BindingSource bindingSource = dataGridView.DataSource as BindingSource;
                productos = bindingSource.DataSource as List <ProductoData>;
                ProductoStockGuardar productoStockGuardar = new ProductoStockGuardar();
                productoStockGuardar.datos = productos;
                Response response = await stockModel.guardarproductosp(productoStockGuardar);

                if (response.id > 0)
                {
                    MessageBox.Show("Mensaje: " + response.msj, "Guardar", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error: " + ex.Message, "Guardar", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            finally
            {
                loadState(false);
                cargarRegistrosBuscar();
            }
        }
예제 #2
0
 public async Task <Response> guardarproductosp(ProductoStockGuardar param)
 {
     try
     {
         // localhost:8080/admeli/xcore2/xcore/services.php/productosp/guardar
         return(await webService.POST <ProductoStockGuardar, Response>("productosp", "guardar", param));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }