Ejemplo n.º 1
0
        private void dtgClientes_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            if (dtgClientes.Rows[e.RowIndex].Cells["Eliminar"].Selected)
            {
                Form         informacion = new frmInformacion("¿Estas Seguro de Eliminar el Producto?");
                DialogResult resultado   = informacion.ShowDialog();

                if (resultado == DialogResult.OK)
                {
                    int eliminar = Convert.ToInt32(dtgClientes.Rows[e.RowIndex].Cells[2].Value.ToString());
                    //objNCliente.eliminarCliente();
                    frmNotificacion.confirmacionForm("Eliminado");
                    mostrarTablaClientes();
                    //contarProductos();
                }
            }
            else if (dtgClientes.Rows[e.RowIndex].Cells["Editar"].Selected)
            {
                frmNuevoCliente frm = new frmNuevoCliente();
                frm.Update = true;
                frm.txtCodProducto.Text    = dtgClientes.Rows[e.RowIndex].Cells["codProducto"].Value.ToString();
                frm.txtIdProducto.Text     = dtgClientes.Rows[e.RowIndex].Cells["idProducto"].Value.ToString();
                frm.txtNombreProducto.Text = dtgClientes.Rows[e.RowIndex].Cells["producto"].Value.ToString();;
                frm.txtPrecioCompra.Text   = dtgClientes.Rows[e.RowIndex].Cells["precio_compra"].Value.ToString();
                frm.txtPrecioVenta.Text    = dtgClientes.Rows[e.RowIndex].Cells["precio_venta"].Value.ToString();
                frm.txtStock.Text          = dtgClientes.Rows[e.RowIndex].Cells["stock"].Value.ToString();
                frm.cmbCategoria.Text      = dtgClientes.Rows[e.RowIndex].Cells["idCategoria"].Value.ToString();
                frm.cmbMarca.Text          = dtgClientes.Rows[e.RowIndex].Cells["idMarca"].Value.ToString();

                frm.ShowDialog();
                mostrarTablaClientes();
                //contarProductos();
            }
        }
Ejemplo n.º 2
0
        //metodo para mostrar los totales de Productos,categorias y marcas
        //public void contarProductos()
        //{
        //    objNProductos.contabilizarProducto(objEProductos);
        //    lblProductos.Text = objEProductos.TotalProducto;
        //    lblCategorias.Text = objEProductos.TotalCategoria;
        //    lblMarcas.Text = objEProductos.TotalMarca;
        //    lblTotalProductos.Text = objEProductos.SumaProducto;
        //}
        #endregion

        private void btnNuevoCliente_Click(object sender, EventArgs e)
        {
            frmNuevoCliente frm = new frmNuevoCliente();

            frm.ShowDialog();
            frm.Update = false;
            mostrarTablaClientes();
            //contarProductos();
        }