コード例 #1
0
        private void btnEditar_Click(object sender, EventArgs e)
        {
            try
            {
                FormProducto frm = new FormProducto();
                var          t   = this.addProducto.getDatos(int.Parse(this.dtLista.CurrentRow.Cells[0].Value.ToString()));



                frm.editar = true;

                frm.txtCodigo.Text = "0000" + t.Codigo.ToString();

                frm.fillProducto((int)t.Codigo);



                frm.btnNuevo.Text = "Editar";
                frm.dtNombre.Focus();
                frm.ShowDialog();

                System.Threading.Thread.Sleep(10);
                this.Lista();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
コード例 #2
0
        private void btnVer_Click(object sender, EventArgs e)
        {
            try
            {
                FormProducto frm = new FormProducto();


                var t = this.addProducto.getDatos(int.Parse(this.dtLista.CurrentRow.Cells[0].Value.ToString()));



                frm.ver    = true;
                frm.editar = true;

                frm.txtCodigo.Text = "0000" + t.Codigo.ToString();
                frm.tciVer.Visible = true;
                frm.fillVista((int)t.Codigo);
                frm.fillProducto((int)t.Codigo);


                // frm.txtCodigo.Text = "0000" + t.Codigo.ToString();
                // frm.txtNombre.Text = t.Nombre;
                // frm.txtCategoria.Text = t.Categoria;
                // //frm.cmbColor.SelectedText = t.Color;
                //// frm.cmbTamanio.SelectedText = t.Tamanio;
                // frm.txtUnidad.Text = t.Unidad;

                // frm.txtStock.Text = "" + t.Stock;
                // frm.txtStockMin.Text = "" + t.StockMin;
                // frm.txtVenta.Text = "" + t.Venta;
                // frm.txtCompra.Text = "" + t.Compra;
                // frm.txtDescripcion.Text = t.Descripcion;
                // frm.chkIva.CheckState = t.IVA == 'S' ? CheckState.Checked : CheckState.Unchecked;
                // frm.chkPrecioVenta.CheckState = CheckState.Unchecked;
                // frm.txtMarca.Text = t.Marca;


                frm.btnNuevo.Text    = "Habilitar Edicion";
                frm.btnNuevo.Visible = true;


                frm.pnlTab1.Enabled = false;
                frm.pnlTab2.Enabled = false;
                frm.pnlTab3.Enabled = false;
                //frm.chkPrecioVenta.Visible = false;
                //frm.label14.Visible = false;



                frm.ShowDialog();
                //this.LoadData();
            }
            catch (Exception ex)
            {
                Datos.Excepciones.Gestionar(ex);
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }