public static List <App.ColOperacionService.ColMovimiento> ConvertirDetalleCola(BindingList <App.InvMovimientoService.InvMovimiento> listaBinding) { List <App.ColOperacionService.ColMovimiento> _listaDetalle = new List <App.ColOperacionService.ColMovimiento>(); foreach (App.InvMovimientoService.InvMovimiento item in listaBinding) { App.ColOperacionService.ColMovimiento mov = new App.ColOperacionService.ColMovimiento(); mov.cantidad = item.cantidad; mov.costo = item.costo; mov.costo_moneda = item.costo_moneda; mov.id = item.id; mov.id_empresa = item.id_empresa; mov.id_impuesto = item.id_impuesto; mov.id_operacion = item.id_operacion; mov.id_producto = item.id_producto; mov.id_tipo_operacion = item.id_tipo_operacion; mov.last_update = item.last_update; mov.monto = item.monto; mov.monto_impuesto = item.monto_impuesto; mov.monto_impuesto_moneda = item.monto_impuesto_moneda; mov.monto_moneda = item.monto_moneda; mov.order_id = item.order_id; mov.precio = item.precio; mov.precio_moneda = item.precio_moneda; mov.producto_codigo = item.producto_codigo; mov.producto_nombre = item.producto_nombre; mov.producto_unidad = item.producto_unidad; mov.valor_impuesto = item.valor_impuesto; Console.WriteLine("Convertir"); Console.WriteLine(mov.costo.ToString() + ", " + mov.precio.ToString() + ", " + mov.monto.ToString()); _listaDetalle.Add(mov); } return(_listaDetalle); }
private void btnSave_Click(object sender, EventArgs e) { //SAVE try { one.id_cliente = _oneCliente.id; one.id_cotizacion = Globals.cotizacion[0].id_cotizacion; one.id_usuario = Globals.logUser.id; Console.WriteLine("SaveTipoOperacion: " + one.id_tipo_operacion); List <App.ColOperacionService.ColMovimiento> _listaDetalle = new List <App.ColOperacionService.ColMovimiento>(); foreach (App.ColMovimientoService.ColMovimiento item in bList) { App.ColOperacionService.ColMovimiento mov = new App.ColOperacionService.ColMovimiento(); mov.cantidad = item.cantidad; mov.costo = item.costo; mov.costo_moneda = item.costo_moneda; mov.id = item.id; mov.id_empresa = item.id_empresa; mov.id_impuesto = item.id_impuesto; mov.id_operacion = item.id_operacion; mov.id_producto = item.id_producto; mov.id_tipo_operacion = item.id_tipo_operacion; mov.last_update = item.last_update; mov.monto = item.monto; mov.monto_impuesto = item.monto_impuesto; mov.monto_impuesto_moneda = item.monto_impuesto_moneda; mov.monto_moneda = item.monto_moneda; mov.order_id = item.order_id; mov.precio = item.precio; mov.precio_moneda = item.precio_moneda; mov.producto_codigo = item.producto_codigo; mov.producto_nombre = item.producto_nombre; mov.producto_unidad = item.producto_unidad; mov.valor_impuesto = item.valor_impuesto; Console.WriteLine("Convertir"); Console.WriteLine(mov.costo.ToString() + ", " + mov.precio.ToString() + ", " + mov.monto.ToString()); _listaDetalle.Add(mov); } string res = srv.SetOne(one, _listaDetalle); if (res.Length > 1) { MetroFramework.MetroMessageBox.Show(this.MdiParent, "Documento enviado con éxito", "Mensaje", MessageBoxButtons.OK, MessageBoxIcon.Information); this.Close(); } else { MetroFramework.MetroMessageBox.Show(this.MdiParent, "No se guardó la operación", "Advertencia", MessageBoxButtons.OK, MessageBoxIcon.Warning); } } catch (Exception) { MetroFramework.MetroMessageBox.Show(this.MdiParent, "Se produjeron errores intentando procesar la operación, por favor revise los valores e intente nuevamente", "Advertencia", MessageBoxButtons.OK, MessageBoxIcon.Warning); } }