示例#1
0
        public ActionResult Update(PersonaDto persona, HttpPostedFileBase img)
        {
            var obtenerUsuario = _usuarioServicio.ObtenerPorId(SessionActiva.UsuarioId);

            if (img != null)
            {
                using (var reader = new BinaryReader(img.InputStream))
                {
                    obtenerUsuario.Foto = reader.ReadBytes(img.ContentLength);
                    SessionActiva.Foto  = obtenerUsuario.Foto;
                    _usuarioServicio.Modificar(obtenerUsuario);
                }
            }

            _personaServicio.Modificar(persona);
            return(RedirectToAction("Perfil", "Persona"));
        }
示例#2
0
        public override void Inicializador(long?entidadId)
        {
            if (entidadId.HasValue)
            {
                return;
            }

            nudSeña.Minimum       = 0;
            nudSeña.Maximum       = 9999999;
            nudSeña.DecimalPlaces = 2;

            var estadoReserva = new List <EstadoReserva>()
            {
                EstadoReserva.Confirmada,
                EstadoReserva.Cancelada,
                EstadoReserva.NoConfirmada
            }.ToList();

            cmbEstado.DataSource = estadoReserva;

            CargarComboBox(cmbMesa,
                           _mesaServicio.Obtener(string.Empty),
                           "Descripcion",
                           "Id");

            CargarComboBox(cmbCliente,
                           _clienteServicio.Obtener(string.Empty),
                           "Descripcion",
                           "Id");

            CargarComboBox(cmbMotivo,
                           _motivoReserva.Obtener(string.Empty),
                           "Descripcion",
                           "Id");

            cmbUsuario.SelectedItem = _usuarioServicio.ObtenerPorId(entidadId.Value);

            nudSeña.Focus();
        }
        void Inicializador()
        {
            if (NombreUsuarioLogueado == "Admin")
            {
                MessageBox.Show("Para abrir el Kiosko debe loguearse con un Usuario Registrado",
                                "Atencion",
                                MessageBoxButtons.OK,
                                MessageBoxIcon.Information);

                this.Close();
            }

            txtCodigo.KeyPress += Validacion.NoSimbolos;
            txtCodigo.KeyPress += Validacion.NoLetras;

            txtClienteDni.KeyPress += Validacion.NoSimbolos;
            txtClienteDni.KeyPress += Validacion.NoLetras;

            labels.KeyPress += Validacion.NoNumeros;
            labels.KeyPress += Validacion.NoSimbolos;

            nudPrecioUnitario.Enabled       = false;
            nudPrecioUnitario.Minimum       = 0;
            nudPrecioUnitario.DecimalPlaces = 2;
            nudPrecioUnitario.Maximum       = 999999;

            nudUnidades.Minimum       = 1;
            nudUnidades.Maximum       = 999999;
            nudUnidades.DecimalPlaces = 0;

            txtUsusarioLogueado.Enabled = false;
            txtEmpleadoLegajo.Enabled   = false;
            txtEmpleadoNombre.Enabled   = false;
            txtUsusarioLogueado.Text    = _usuarioServicio.ObtenerPorId(Convert.ToInt64(UsuarioLogueadoId)).NombreUsuario;
            txtEmpleadoLegajo.Text      = Convert.ToString(_empleadoServicio
                                                           .ObtenerPorId(_usuarioServicio.ObtenerPorId(Convert.ToInt64(UsuarioLogueadoId)).PersonaId).Legajo);
            txtEmpleadoNombre.Text = _empleadoServicio.ObtenerPorLegajo(txtEmpleadoLegajo.Text).ApyNom;

            txtClienteDni.Enabled      = false;
            txtClienteNombre.Enabled   = false;
            txtClienteApellido.Enabled = false;
            txtDescripcion.Enabled     = false;

            dtpFecha.Enabled = false;
            dtpFecha.Value   = DateTime.Today;

            nudSubTotal.Enabled       = false;
            nudSubTotal.Minimum       = 0m;
            nudSubTotal.Maximum       = 9999999m;
            nudSubTotal.DecimalPlaces = 2;
            nudDescuento.Minimum      = 0m;
            nudDescuento.Maximum      = 100m;
            nudTotal.Enabled          = false;
            nudTotal.Minimum          = 0m;
            nudTotal.Maximum          = 9999999m;
            nudTotal.DecimalPlaces    = 2;

            var tipoComprobante = new List <TipoComprobante>
            {
                TipoComprobante.B,
                TipoComprobante.A,
                TipoComprobante.C,
                TipoComprobante.X
            }.ToList();

            cmbTipoComprobante.DataSource = tipoComprobante;

            var tipoFormaPago = new List <TipoFormaPago>
            {
                TipoFormaPago.Efectivo,
                TipoFormaPago.CuentaCorriente,
                TipoFormaPago.Cheque,
                TipoFormaPago.Tarjeta
            }.ToList();

            cmbFormaPago.DataSource = tipoFormaPago;

            btnCobrar.Enabled = false;

            var clienteId = _clienteServicio.ObtenerPorDni("99999999").Id;

            txtClienteDni.Text      = _clienteServicio.ObtenerPorId(clienteId).Dni;
            txtClienteNombre.Text   = _clienteServicio.ObtenerPorId(clienteId).Nombre;
            txtClienteApellido.Text = _clienteServicio.ObtenerPorId(clienteId).Apellido;
        }
示例#4
0
        public override bool EjecutarComandoModificar()
        {
            try
            {
                var mensaje = string.Empty;

                var empleado = _empleadoServicio.obtenerPorId(_empleadoId);

                var cuenta = _usuarioServicio.ObtenerPorId(_empleadoServicio.obtenerPorId(_empleadoId).UsuarioId);

                if (cuenta.Usuario.Contains("CadeteBloqueado"))
                {
                    mensaje = string.Format("Los datos se grabaron correctamente. \n" +
                                            "\n" +
                                            "*EL EMPLEADO QUE MODIFICO NO TENIA UNA CUENTA ASIGNADA. \n" +
                                            "\n" +
                                            "Se creo con exito la cuenta: \n" +
                                            "\n" +
                                            "Usuario: {0} \n" +
                                            "Password: {1} \n", txtNombre.Text + txtCuil.Text, txtDni.Text
                                            );
                }
                else
                {
                    mensaje = string.Format("Los datos se grabaron correctamente. \n" +
                                            "\n" +
                                            "*SE DETECTO LA CUENTA: {0} Y FUE ACTIVADA."
                                            , cuenta.Usuario
                                            );
                }


                _empleadoServicio.Modificar(new EmpleadoDto()
                {
                    Id            = entidadId.Value,
                    Nombre        = txtNombre.Text,
                    Apellido      = txtApellido.Text,
                    Celular       = txtCelular.Text,
                    Cuil          = txtCuil.Text,
                    Direccion     = txtDireccion.Text,
                    Dni           = txtDni.Text,
                    Telefono      = txtTelefono.Text,
                    Legajo        = (int)nudLegajo.Value,
                    TipoOcupacion = (TipoEmpleado)cmbTipoOcupacion.SelectedItem
                });

                if (empleado.TipoOcupacion != TipoEmpleado.Cadete && (TipoEmpleado)cmbTipoOcupacion.SelectedItem == TipoEmpleado.Cadete)
                {
                    Mensaje.Mostrar(string.Format("Los datos se grabaron correctamente. \n" +
                                                  "\n" +
                                                  "La cuenta: {0}. permanecera inactiva mientras el empleado sea un cadete.", cuenta.Usuario), Mensaje.Tipo.Informacion);
                }

                else
                {
                    if (empleado.TipoOcupacion == TipoEmpleado.Cadete && (TipoEmpleado)cmbTipoOcupacion.SelectedItem != TipoEmpleado.Cadete)
                    {
                        Mensaje.Mostrar(mensaje, Mensaje.Tipo.Informacion);
                    }

                    else
                    {
                        Mensaje.Mostrar("Los datos se grabaron correctamente.", Mensaje.Tipo.Informacion);
                    }
                }

                return(true);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, Mensaje.Tipo.Stop);

                return(false);
            }
        }