Exemple #1
0
        public VerAsiento(Boolean opcion, int idasiento, Form vista)
        {
            try
            {
                menuAnterior = vista;

                InitializeComponent();
                if (opcion)
                {
                    opcionesGuardar            = 2;
                    asiento                    = Asiento.TraerAsientosporId(idasiento);
                    this.textBoxNumero.Text    = asiento.Numero_asiento.ToString();
                    this.textBoxNumero.Enabled = false;
                    this.textBoxDescr.Text     = asiento.Descripcion_asiento.ToString();
                    string   fecha = asiento.Fecha_asiento;
                    DateTime oDate = DateTime.Parse(fecha);
                    this.dateTimePickerFecha.Value = oDate;
                    groupBoxAsiento.Text           = "Editar Asiento";
                    this.Text = "Editar Asiento";
                    this.dateTimePickerFecha.Enabled = false;
                    LlenarDataGrip(asiento.Asiento_movimiento);
                }
                else
                {
                    opcionesGuardar            = 3;
                    asiento                    = Asiento.TraerAsientosporId(idasiento);
                    this.textBoxNumero.Text    = asiento.Numero_asiento.ToString();
                    this.textBoxNumero.Enabled = false;
                    this.textBoxDescr.Text     = asiento.Descripcion_asiento.ToString();
                    this.textBoxDescr.Enabled  = false;
                    string   fecha = asiento.Fecha_asiento;
                    DateTime oDate = DateTime.Parse(fecha);
                    this.dateTimePickerFecha.Value   = oDate;
                    this.dateTimePickerFecha.Enabled = false;
                    this.ColEditar.Visible           = false;
                    this.ColEliminar.Visible         = false;
                    dataGridMovimientos.Enabled      = false;
                    botonNuevo.Visible   = false;
                    groupBoxAsiento.Text = "Eliminar Asiento";
                    this.Text            = "Eliminar Asiento";
                    LlenarDataGrip(asiento.Asiento_movimiento);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }