private async void btnGuardar_Click(object sender, EventArgs e) { loadState(true); try { ImpuestoComprobante impuestoComprobante = new ImpuestoComprobante(); string impuesto = ""; foreach (ImpuestoDocumento ID in listImpuestosDocumentos) { impuesto += ID.idImpuesto + ","; } if (impuesto.Length > 0) { impuesto = impuesto.Substring(0, impuesto.Length - 1); } impuestoComprobante.idSucursal = (int)cbxSucursal.SelectedValue; impuestoComprobante.idTipoDocumento = (int)cbxDocumento.SelectedValue; impuestoComprobante.impuestos = impuesto; Response response = await impuestoModel.guardarImpuestoDocumento(impuestoComprobante); MessageBox.Show("Mensaje: " + response.msj + " correctamente", "guardar", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } catch (Exception ex) { MessageBox.Show("Error: " + ex.Message, "Guardar", MessageBoxButtons.OK, MessageBoxIcon.Information); } finally { loadState(false); } }
//tipodocumentoimpuesto/guardar public async Task <Response> guardarImpuestoDocumento(ImpuestoComprobante param) { try { // localhost:8080/admeli/xcore2/xcore/services.php/tipodocumentoimpuesto/guardar return(await webService.POST <ImpuestoComprobante, Response>("tipodocumentoimpuesto", "guardar", param)); } catch (Exception ex) { throw ex; } }