private void btnNuevo_Click(object sender, RoutedEventArgs e)
 {
     accionEmpleado = accion.nuevo;
     limpiarCampos();
     ActivarCampos(true);
     txtDni.Focus();
 }
Пример #2
0
        private void btnEditarCliente_Click(object sender, RoutedEventArgs e)
        {
            if (manejadorDeClientesVip.Listar.Count != 0)
            {
                ClienteVip cliente = lstvClientes.SelectedItem as ClienteVip;

                if (cliente != null)
                {
                    HabilitarBotonesParaClientes(true);
                    LimpiarCamposDeCliente(true);
                    accionDeCliente = accion.editar;
                    tbxClaveDeElectorCliente.Text   = cliente.ClaveDeElector;
                    tbxNombreDeCliente.Text         = cliente.Nombre;
                    tbxDomicilioDeCliente.Text      = cliente.Domicilio;
                    tbxMensaualidadesDeCliente.Text = cliente.NumeroDeMensualidaes.ToString();
                    ImgFotoCliente.Source           = ByteToImagen(cliente.Foto);
                }
                else
                {
                    MensajeNoSeleccionadoNada("cliente", "editar", "Error al editar cliente");
                }
            }
            else
            {
                MensajeNoContienes("cliente", "editar", "Error al editar cliente");
            }
        }
Пример #3
0
 private void btnAgregarProductos_Click(object sender, RoutedEventArgs e)
 {
     LimpiarCajasProductos();
     HabilitarCajasProductos(true);
     PonerBotonesDeEdicionProductos(true);
     AccionDeProcuctos = accion.nuevo;
 }
Пример #4
0
        private void ProductosBtnEditar_Click(object sender, RoutedEventArgs e)
        {
            if (manejadorProductos.Lista.Count == 0)
            {
                MessageBox.Show("No cuenta con ningun Registro para editar", "Registro", MessageBoxButton.OK, MessageBoxImage.Exclamation);
            }
            if (dtgProductos.SelectedItem != null)
            {
                try
                {
                    RegistroMuebles productos = dtgProductos.SelectedItem as RegistroMuebles;
                    LimpiarProductos(true);
                    CmbCategoriaRegistro.Text   = productos.categoriaRegistro;
                    txbNombreRegistro.Text      = productos.Nombre;
                    txbDescripcionRegistro.Text = productos.Modelo;
                    txbP_CompraRegistro.Text    = productos.Precio_Compra.ToString();
                    txbp_VentaRegistro.Text     = productos.precio_Venta.ToString();
                    txbCanRegistro.Text         = productos.Can.ToString();
                    imgFoto.Source = ByteToImage(productos.Fotografia);

                    acc = accion.Editar;
                    BotonesProductos(true);
                }
                catch (Exception)
                {
                    MessageBox.Show("No se puedo realizar la operacion", "Registro", MessageBoxButton.OK, MessageBoxImage.Error);
                }
            }
            else
            {
                MessageBox.Show("No ha seleccionado ningun Registro para modificar", "Registro", MessageBoxButton.OK, MessageBoxImage.Error);
            }
        }
Пример #5
0
        private void btnEditarEmpleado_Click(object sender, RoutedEventArgs e)
        {
            if (manejadorDeEmpleado.Listar.Count != 0)
            {
                Trabajador empleado = lstvEmpleados.SelectedItem as Trabajador;
                if (empleado != null)
                {
                    LimpiarCamposDeEmpleado(true);
                    HabilitarBotonesParaEmpleados(true);
                    accionDeEmpleado = accion.editar;

                    tbxCargoDeEmpleado.Text          = empleado.Cargo;
                    tbxClaveDeElectorDeEmpleado.Text = empleado.ClaveDeElector;
                    tbxNombreDeEmpleado.Text         = empleado.Nombre;
                    tbxDomicilioDeEmpleado.Text      = empleado.Domicilio;
                    ImgFotoEmpleado.Source           = ByteToImagen(empleado.Foto);
                }
                else
                {
                    MensajeNoSeleccionadoNada("empleado", "editar", "Error en selección");
                }
            }
            else
            {
                MensajeNoContienes("empleado", "editar", "Falta de datos");
            }
        }
Пример #6
0
        private void btnEditar_Click(object sender, RoutedEventArgs e)
        {
            LimpiarCampos();
            Sucursal sucursal = lstvSucursales.SelectedItem as Sucursal;

            if (manejadorDeSucursal.Listar.Count > 0)
            {
                if (sucursal != null)
                {
                    tbxDireccion.Text      = sucursal.Direccion;
                    tbxNombreSucursal.Text = sucursal.Nombre;

                    tbxSueldoEncargado.Text     = sucursal.Encargado.Sueldo.ToString();
                    tbxNombreEncargado.Text     = sucursal.Encargado.Nombre;
                    tbxTelefonoDeEncargado.Text = sucursal.Encargado.Telefono;
                    tbxContrasenaEncargado.Text = sucursal.Encargado.Contrasena;

                    BotonesHabilitados(true);
                    PanelDeDatos.IsEnabled   = true;
                    accionDeSucursal         = accion.editar;
                    lstvSucursales.IsEnabled = false;
                }
                else
                {
                    MessageBox.Show("No has seleccionado nada", "Error", MessageBoxButton.OK, MessageBoxImage.Error, MessageBoxResult.None, MessageBoxOptions.ServiceNotification);
                }
            }
            else
            {
                MessageBox.Show("No tienes nada que editar", "Error", MessageBoxButton.OK, MessageBoxImage.Error, MessageBoxResult.None, MessageBoxOptions.ServiceNotification);
            }
        }
Пример #7
0
        private void EmpleadoBtnEditar_Click(object sender, RoutedEventArgs e)
        {
            Empleado empleado = dtgEmpleado.SelectedItem as Empleado;

            if (empleado != null)
            {
                LimpiarEmpleado(true);
                txbNombreEmpleado.Text    = empleado.Nombre;
                txbA_PaternoEmpleado.Text = empleado.Ape_paterno;
                txbA_MaternoEmpleado.Text = empleado.Ape_Materno;
                txbDireccionEmpleado.Text = empleado.domicilio;
                txbTelefonoEmpleado.Text  = empleado.telefono;
                txbRfcEmpleado.Text       = empleado.Rfc;
                txbEdadEmpleado.Text      = empleado.edad.ToString();
                txbPuestoEmpleado.Text    = empleado.puesto;
                imgFotoos.Source          = ByteToImage(empleado.Fotografia);

                acc = accion.Editar;
                BotonesEmpleado(true);
            }
            else
            {
                MessageBox.Show("No ha seleccionado ningun empleado para modificar", "Empleado", MessageBoxButton.OK, MessageBoxImage.Error);
            }
        }
Пример #8
0
 private void btnNuevoEmpleado_Click(object sender, RoutedEventArgs e)
 {
     HabilitarBotonesParaEmpleados(true);
     LimpiarCamposDeEmpleado(true);
     tbxCargoDeEmpleado.IsEnabled = true;
     accionDeEmpleado             = accion.nuevo;
 }
Пример #9
0
 private void btnAgregarCliente_Click(object sender, RoutedEventArgs e)
 {
     LimpiarCajasCliente();
     HabilitarCajasCliente(true);
     PonerBotonesDeEdicionCliente(true);
     accionDeClientes = accion.nuevo;
 }
Пример #10
0
        private void btnEditarCliente_Click(object sender, RoutedEventArgs e)
        {
            if (manejadorCliente.Listar.Count() == 0)
            {
                MessageBox.Show("No tienes ningun clieente\npara editar", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
            }
            else
            {
                Cliente cliente = dtgClientes.SelectedItem as Cliente;
                if (cliente != null)
                {
                    LimpiarCajasCliente();
                    HabilitarCajasCliente(true);
                    PonerBotonesDeEdicionCliente(true);

                    tbxblkIDClientes.Text    = cliente.Id;
                    tbxCorreoCliente.Text    = cliente.Correo;
                    tbxDireccionCliente.Text = cliente.direccion;
                    tbxNombreCliente.Text    = cliente.nombre;
                    tbxRFcCliente.Text       = cliente.RFC;
                    tbxTelefonoCliente.Text  = cliente.telefono;

                    accionDeClientes = accion.editar;
                }
            }
        }
Пример #11
0
 private void btnAgregarEmpleado_Click(object sender, RoutedEventArgs e)
 {
     LimpiarCajasEmpleados();
     HabilitarCajasEmpleados(true);
     PonerBotonesDeEdicionEmpleado(true);
     accionDeEmpleados = accion.nuevo;
 }
Пример #12
0
        private void btnEditarEmpleado_Click(object sender, RoutedEventArgs e)
        {
            if (manejadorEmpleados.Listar.Count() == 0)
            {
                MessageBox.Show("No tienes ningun empleado\npara editar", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
            }
            else
            {
                Empleado emple = dtgEmpleados.SelectedItem as Empleado;
                if (emple != null)
                {
                    LimpiarCajasEmpleados();
                    HabilitarCajasEmpleados(true);
                    PonerBotonesDeEdicionEmpleado(true);

                    tbxblkIDEmpleado.Text     = emple.Id;
                    tbxDireccionEmpleado.Text = emple.direccion;
                    tbxNombreEmpleado.Text    = emple.nombre;
                    tbxPuestoEmpleado.Text    = emple.puesto;
                    tbxTelefonoEmpleado.Text  = emple.telefono;

                    accionDeEmpleados = accion.editar;
                }
            }
        }
Пример #13
0
        public VentanaCambiarDeContrasena()
        {
            InitializeComponent();

            manejadorDeContrasena = new ManejadorDeContrasena(new RepositorioGenerico <Contrasena>());

            cmbxUsuaario.ItemsSource = manejadorDeContrasena.Listar;

            if (manejadorDeContrasena.Listar.Count == 0)
            {
                accionDeContras = accion.nuevo;
                txtDeContrasena.Clear();
                txtDeContrasena.Clear();
                txbxUsuaario.Visibility = Visibility.Visible;
                cmbxUsuaario.Visibility = Visibility.Collapsed;
            }
            else
            {
                accionDeContras = accion.editar;
                txtDeContrasena.Clear();
                txtDeContrasena.Clear();
                txbxUsuaario.Visibility = Visibility.Collapsed;
                cmbxUsuaario.Visibility = Visibility.Visible;
            }
        }
Пример #14
0
        private void btnEditarProducto_Click(object sender, RoutedEventArgs e)
        {
            if (manejadorDeProducto.Listar.Count != 0)
            {
                Producto producto = lstProducto.SelectedItem as Producto;
                if (producto != null)
                {
                    LimpiarCamposDeProducto(true);
                    HabilitarBotonesParaProductos(true);
                    accionDeProducto = accion.editar;

                    tbxCantidadDeProducto.Text           = producto.Cantidad.ToString();
                    tbxCodigoProducto.Text               = producto.Codigo;
                    tbxNombreDelProveedorDeProducto.Text = producto.NombreProveedor;
                    tbxNombreDeProducto.Text             = producto.Nombre;
                    tbxPresioDeVentaDeProducto.Text      = producto.PresioVenta.ToString();
                }
                else
                {
                    MensajeNoSeleccionadoNada("producto", "editar", "Error en selección");
                }
            }
            else
            {
                MensajeNoContienes("producto", "editar", "Falta de datos");
            }
        }
Пример #15
0
 public Peliculas()
 {
     InitializeComponent();
     autoCompleteText("NACIONALIDADES", txtNacionalidad);
     autoCompleteText("peliculas", txtTitulo);
     miAccion = accion.editado;
 }
Пример #16
0
        private void btnEditarCliente_Click(object sender, RoutedEventArgs e)
        {
            if (mAnejadorDeCliente.Listar.Count != 0)
            {
                Cliente cliente = lstvClientes.SelectedItem as Cliente;

                if (cliente != null)
                {
                    HabilitarBotonesParaClientes(true);
                    LimpiarCamposDeCliente(true);
                    accionDeCliente         = accion.editar;
                    tbxEmailDeCliente.Text  = cliente.Email;
                    tbxNombreDeCliente.Text = cliente.Nombre;
                    tbxRFCDeCliente.Text    = cliente.RFC;
                    tbxTelefonoCliente.Text = cliente.Telefono;
                }
                else
                {
                    MensajeNoSeleccionadoNada("cliente", "editar", "Error al editar cliente");
                }
            }
            else
            {
                MensajeNoContienes("cliente", "editar", "Error al editar cliente");
            }
        }
Пример #17
0
        private void btnEditarProductos_Click(object sender, RoutedEventArgs e)
        {
            if (manejadorProductos.Listar.Count() == 0)
            {
                MessageBox.Show("No tienes ningun Producto\npara editar", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
            }
            else
            {
                Productos productos = dtgProductos.SelectedItem as Productos;
                if (productos != null)
                {
                    LimpiarCajasProductos();
                    HabilitarCajasProductos(true);
                    PonerBotonesDeEdicionProductos(true);

                    tbxblkIDProductos.Text        = productos.Id;
                    tbxCantidadProductos.Text     = productos.cantidad.ToString();
                    tbxCategoriaProductos.Text    = productos.categoria;
                    tbxNombreProductos.Text       = productos.nombreDelProducto;
                    tbxDescripcionProductos.Text  = productos.descripcion;
                    tbxPresioCompraProductos.Text = productos.PrecioCompra.ToString();
                    tbxPresioVentaProductos.Text  = productos.PrecioVenta.ToString();
                    tbxPresentacionProductos.Text = productos.presentacion;

                    AccionDeProcuctos = accion.editar;
                }
            }
        }
Пример #18
0
 private void btnNuevo_Click(object sender, RoutedEventArgs e)
 {
     LimpiarCampos();
     PanelDeDatos.IsEnabled = true;
     BotonesHabilitados(true);
     accionDeSucursal         = accion.nuevo;
     lstvSucursales.IsEnabled = false;
 }
Пример #19
0
 private void btnNuevoCliente_Click(object sender, EventArgs e)
 {
     txtMenu.Text = "Nuevo Cliente";
     miAccion     = accion.nuevo;
     habilitarCampos(true);
     limpiar();
     txtNombreCliente.Focus();
 }
Пример #20
0
        private void btnGrabar_Click(object sender, EventArgs e)
        {
            if (validarCampos())
            {
                Pelicula p = new Pelicula();
                p.pTitulo       = txtTitulo.Text;
                p.pId_genero    = (int)cboGenero.SelectedValue;
                p.pNacionalidad = txtNacionalidad.Text;
                cnn.leerTabla("NACIONALIDADES");

                while (cnn.pDr.Read())
                {
                    if (p.pNacionalidad == cnn.pDr.GetString(1))
                    {
                        p.pId_nacionalidad = cnn.pDr.GetInt32(0);
                    }
                }
                cnn.pDr.Close();
                cnn.desconectar();
                p.pId_idioma        = (int)cboIdiomas.SelectedValue;
                p.pId_clasificacion = (int)cboClasificacion.SelectedValue;
                if (miAccion == accion.nuevo)
                {
                    p.nuevo(p);
                    habilitarCampos(false);
                }
                else
                {
                    if (lstPeliculas.SelectedIndex >= 0)
                    {
                        int k = lstPeliculas.SelectedIndex;
                        lP[k].pTitulo       = txtTitulo.Text;
                        lP[k].pId_genero    = (int)cboGenero.SelectedValue;
                        lP[k].pNacionalidad = txtNacionalidad.Text;
                        cnn.leerTabla("NACIONALIDADES");

                        while (cnn.pDr.Read())
                        {
                            if (lP[k].pNacionalidad == cnn.pDr.GetString(1))
                            {
                                lP[k].pId_nacionalidad = cnn.pDr.GetInt32(0);
                            }
                        }
                        cnn.pDr.Close();
                        cnn.desconectar();
                        lP[k].pId_idioma        = (int)cboClasificacion.SelectedValue;
                        lP[k].pId_clasificacion = (int)cboClasificacion.SelectedValue;
                        lP[k].editar(lP[k]);
                        habilitarCampos(false);
                    }
                }
                lP.Clear();
                cargarLista(lstPeliculas, "PELICULAS");
                txtMenu.Text = "";
                miAccion     = accion.editado;
            }
        }
Пример #21
0
        private void btnNuevo_Click_1(object sender, EventArgs e)
        {
            txtMenu.Text = "Nueva Pelicula";

            habilitarCampos(true);
            limpiar();
            txtTitulo.Focus();
            miAccion = accion.nuevo;
        }
Пример #22
0
 private void btnNuevaEntrega_Click(object sender, RoutedEventArgs e)
 {
     //gridDetalle.IsEnabled = true;
     ActualizarCombosDetalle();
     entrega         = new Entrega();
     entrega.Muebles = new List <RegistroMuebles>();
     ActualizarListaDeMueblesEnVale();
     accionVale = accion.Nuevo;
 }
Пример #23
0
        private void OpEliminar_Click(object sender, EventArgs e)
        {
            activar();
            proceso = accion.eliminar;

            var BORRAR = BaseDAL.Eliminar <elliot__1>(x => x.idPersona == poc);

            llenar_Grid();
        }
Пример #24
0
        private void btnNuevoCheck_Click(object sender, RoutedEventArgs e)
        {
            GridDetalle.IsEnabled = true;
            ActualizarComboDetalle();

            check = new Check();
            check.MaterialesPrestados = new List <Materiales>();
            ActualizarListaDeMaterialesEnCheck();

            accionCheck = accion.Nuevo;
        }
Пример #25
0
 private void btnNuevaVenta_Click(object sender, RoutedEventArgs e)
 {
     LimparCajas();
     HabilitarCajasYCombos(true);
     HabiltarBotones(true);
     ActualizarCombos();
     tiked = new Tiked();
     tiked.ProductosComprados = new List <Productos>();
     ActulizarTablaDeProductosAhComprar();
     suma       = 0;
     accionvale = accion.nuevo;
 }
Пример #26
0
        private void btnCategoriaEditar_Click(object sender, RoutedEventArgs e)
        {
            Categoria cat = dtgCategoria.SelectedItem as Categoria;

            if (cat != null)
            {
                txbCategoriaId.Text = cat.Id;
                txbCategoriaTipoDeCategoria.Text = cat.TipoCategoria;
                accionCategoria = accion.Editar;
                PonerBotonesCategoriaEnEdicion(true);
            }
        }
        private void btnEmpleadosEditar_Click(object sender, RoutedEventArgs e)
        {
            Empleado emp = dtgEmpleaods.SelectedItem as Empleado;

            if (emp != null)
            {
                txbEmpleadosId.Text     = emp.Id;
                txbEmpleadosNombre.Text = emp.Nombre;
                accionEmpleados         = accion.Editar;
                PonerBotonesEmpleadosEnEdicion(true);
            }
        }
Пример #28
0
        private void btnCategoriaEditar_Click(object sender, RoutedEventArgs e)
        {
            Categoria emp = dtgCategoria.SelectedItem as Categoria;

            if (emp != null)
            {
                txbCategoriaId.Text        = emp.Id;
                txbCategoriaCategoria.Text = emp.categoria;

                accionn = accion.Editar;
                PonerBotonesCategoriaEnEdicion(true);
            }
        }
Пример #29
0
        private void btnEditarDeporte_Click(object sender, RoutedEventArgs e)
        {
            Deporte emp = dtgTablaDeporte.SelectedItem as Deporte;

            if (emp != null)
            {
                txbIdDeporte.Text = emp.Id.ToString();
                txbDeporte.Text   = emp.deporte;

                accionn = accion.Editar;
                PonerBotonesDeportesEnEdicion(true);
            }
        }
 private void btnEditarDeporte_Click(object sender, RoutedEventArgs e)
 {
     if (dtgDeporte.SelectedItem != null)
     {
         operacion = accion.editar;
         LimpiarEditarTablasDeporte(true);
         Deporte a = dtgDeporte.SelectedItem as Deporte;
         txtDeportesDeportes.Text = a.Tipo_Deporte;
     }
     else
     {
         MessageBox.Show("No ha seleccionado ningun campo de la tabla", "Deportes", MessageBoxButton.OK, MessageBoxImage.Error);
     }
 }