protected void btnEditar_Click(object sender, EventArgs e) { oThread = new Thread(delegate() { Esperar(1000); }); oThread.Start(); clsOperaciones lstOperaciones = new clsOperaciones(); clsDetOperacion lstDetOperacion = new clsDetOperacion(); Operaciones Operacion = new Operaciones(); DocumenOperacion DocumenOpe = new DocumenOperacion(); DataTable dtDetOperacion; int nOpeCod = 0; int nDopCod = 0; string cDopDescri = ""; try { HabilitarCampos(true); CargarCombos(); CargarClientes(); CargarTransportistas(); CargarVendedores(); txtDireccion.Enabled = false; txtDocCli.Enabled = false; txtTelefono.Enabled = false; nOpeCod = int.Parse(dgvListOperVentas.Rows[dgvListOperVentas.SelectedIndex].Cells[2].Text); SetPanelDocumento(nOpeCod); nDopCod = int.Parse(dgvDocumentos.Rows[0].Cells[1].Text); cDopDescri = dgvDocumentos.Rows[0].Cells[2].Text; CargarCamposOperacion(nOpeCod); CargarCamposDocumento(nDopCod, cDopDescri); ddlClientes_SelectedIndexChanged(sender, e); dtDetOperacion = lstDetOperacion.GetListDetOperacion(nOpeCod); g_dtDetOperacion = dtDetOperacion; RellenarGrilla(ref dgvDetalleVenta, dtDetOperacion, nNroDetPed); lblProceso.Value = lblOpeEstado.Value == "C" ? "CLOSE" : "EDIT"; SetBotones(lblProceso.Value); GuardarDtCabeceraDocumento(); oThread.Join(); } catch (Exception ex) { oThread.Abort(); MessageBox("Error Interno: " + ex.Message); } }
protected void btnGuardarPrecio_Click(object sender, EventArgs e) { DataTable dtDetalleCompra; string cMensaje = ""; long ndopCod = 0; int ntcmCod = 0; clsDetOperacion colDetOper = new clsDetOperacion(); clsOperaciones colOper = new clsOperaciones(); try { if (ValidarDatos("ART", ref cMensaje)) { //AGREGAMOS ARTICULO A LISTA DE ARTICULOS dtDetalleCompra = g_dtDetOperacion; if (dtDetalleCompra.Rows.Count > 0) { for (int i = 0; i < dtDetalleCompra.Rows.Count; i++) { if (dtDetalleCompra.Rows[i]["ArtCod"].ToString() == txtArtCod.Text) { dtDetalleCompra.Rows[i]["dtpPrecioVen"] = txtArtPreUnitario.Text; dtDetalleCompra.Rows[i]["dtpDscto"] = txtArtDescuento.Text; dtDetalleCompra.Rows[i]["dtpSubTotal"] = txtImpTotal.Text; break; } } } CalcularPago(dtDetalleCompra); g_dtDetOperacion = dtDetalleCompra; RellenarGrilla(ref dgvDetalleVenta, dtDetalleCompra, this.nNroDetPed); colDetOper.UpdatePrecio(this.nOpeCod, int.Parse(txtArtCod.Text), decimal.Parse(txtArtPreUnitario.Text)); colOper.Guardar(this, gcOpeTipo, ref ndopCod, ref ntcmCod); //GUARDAR OPERACION lbldopCod.Value = ndopCod.ToString(); lbltcmCod.Value = ntcmCod.ToString(); } else { ModalPopupAgregar.Show(); MessageBox(cMensaje); } } catch (Exception ex) { MessageBox(ex.Message); } }