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); } }
/// <summary> /// Crear un nuevo objeto Operaciones. /// </summary> /// <param name="opeCod">Valor inicial de la propiedad OpeCod.</param> /// <param name="tcmCod">Valor inicial de la propiedad tcmCod.</param> public static Operaciones CreateOperaciones(global::System.Int64 opeCod, global::System.Int32 tcmCod) { Operaciones operaciones = new Operaciones(); operaciones.OpeCod = opeCod; operaciones.tcmCod = tcmCod; return operaciones; }
private void CargarCamposOperacion(int _OpeCod) { clsOperaciones lstOperaciones = new clsOperaciones(); Operaciones Operacion = new Operaciones(); try { Operacion = lstOperaciones.GetOperacion(_OpeCod); //DATOS DE LA NUEVA OPERACION lbltcmCod.Value = Operacion.tcmCod.ToString(); lblTipCambio.Value = Operacion.TipoCambios.tcmCambio.ToString(); txtTipCambio.Text = lblTipCambio.Value; g_nTipoCambio = (Double)Operacion.TipoCambios.tcmCambio; lblNroPedido.Text = Operacion.OpeCod.ToString(); txtFecha.Text = ((DateTime)Operacion.OpeFecEmision).ToString("yyyy-MM-dd"); ddlZonas.SelectedValue = Operacion.ZonCod.ToString().Trim(); if (Operacion.PerCod != null) { ddlVendedores.SelectedValue = Operacion.PerCod.ToString(); ddlListaVendedores.SelectedValue = Operacion.PerCod.ToString(); } if (Operacion.TraCod != null) ddlTransportistas.SelectedValue = Operacion.TraCod.ToString(); ddlClientes.SelectedValue = Operacion.CliCod.ToString(); ddlMoneda.SelectedValue = Operacion.OpeMoneda.ToString().Trim(); ddlTipoVenta.SelectedValue = Operacion.OpeTipPago.ToString().Trim(); txtValorVenta.Text = SetFormatNum((double)Operacion.OpeSubTotal); txtDescuento.Text = SetFormatNum((double)Operacion.OpeDscto); txtFlete.Text = SetFormatNum((double)Operacion.OpeFlete); txtSubTotal.Text = SetFormatNum((double)(Operacion.OpeTotal - Operacion.OpeImpuesto)); txtIgv.Text = SetFormatNum((double)Operacion.OpeImpuesto); txtTotal.Text = SetFormatNum((double)Operacion.OpeTotal); lblOpeEstado.Value = Operacion.OpeEstado.ToString(); txtDesEspec.Text = SetFormatNum(0.0); } catch (Exception ex) { MessageBox("Error Interno: " + ex.Message); } }
/// <summary> /// Método desusado para agregar un nuevo objeto al EntitySet Operaciones. Considere la posibilidad de usar el método .Add de la propiedad ObjectSet<T> asociada. /// </summary> public void AddToOperaciones(Operaciones operaciones) { base.AddObject("Operaciones", operaciones); }