Exemple #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);
            }
        }
        private void btnNuevo_Click(object sender, EventArgs e)
        {
            FormProducto frm = new FormProducto();

            frm.nuevo = true;
            frm.ShowDialog();
            this.Lista();
        }
        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);
            }
        }
Exemple #4
0
        private void btnNuevo_Click(object sender, EventArgs e)
        {
            FormProducto frm = new FormProducto();

            frm.nuevo = true;


            frm.inicioIngresoR();
            frm.dtNombre.Focus();
            frm.dtNombre.CurrentCell = frm.dtNombre.Rows[0].Cells[0];
            frm.dtNombre.EndEdit();
            frm.ShowDialog();


            System.Threading.Thread.Sleep(10);
            this.Lista();
        }
        private void btnNuevo_Click(object sender, EventArgs e)
        {
            try
            {
                FormProducto frm = new FormProducto();
                frm.nuevo = true;

                frm.editar = false;
                frm.inicioIngresoR();
                frm.dtNombre.Focus();
                frm.dtNombre.CurrentCell = frm.dtNombre.Rows[0].Cells[0];
                frm.dtNombre.EndEdit();
                frm.ShowDialog();


                this.Lista();
            }
            catch (Exception ex) {
                Datos.Excepciones.Gestionar(ex);

                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
        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.txtNombre.Text    = t.Nombre;
                frm.txtCategoria.Text = t.Categoria;
                // frm.cmbColor.SelectedText = t.Color;
                //frm.cmbDimension.SelectedText = t.Dimension;
                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 = "Editar";
                frm.ShowDialog();
                this.Lista();
            }
            catch (Exception ex)
            {
                Datos.Excepciones.Gestionar(ex);
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }