示例#1
0
        public VistaRegistrarInspeccion(OPDTO op, AutenticarDTO login)
        {
            InitializeComponent();

            dataGridViewOP.AllowUserToAddRows       = false;
            dataGridViewOP.SelectionMode            = DataGridViewSelectionMode.FullRowSelect;
            dataGridViewOP.ReadOnly                 = true;
            dataGridViewDefectos.AllowUserToAddRows = false;
            dataGridViewDefectos.SelectionMode      = DataGridViewSelectionMode.FullRowSelect;
            dataGridViewDefectos.ReadOnly           = true;

            this.FormBorderStyle = FormBorderStyle.FixedDialog;
            //this.WindowState = FormWindowState.Maximized;
            this.ControlBox = false;

            //cBoxPie.DataSource = Enum.GetValues(typeof(Pie));
            cBoxPie.Items.Add("Derecho");
            cBoxPie.Items.Add("Izquierdo");
            cBoxPie.SelectedIndex = 0;

            cBoxTipoDefecto.DisplayMember = "Descripcion";
            cBoxTipoDefecto.ValueMember   = "Codigo";

            _presentador = new PresentadorRegistrarInspeccion(this, op, login, loginBindingSource, oPBindingSource, defectoBindingSource, tipoDefectoBindingSource);
        }
示例#2
0
 public PresentadorListaOpSupLinea(VistaListaOP vista, AutenticarDTO login, BindingSource empleadoBindingSource, BindingSource oPBindingSource)
 {
     this._vista           = vista;
     this._login           = login;
     this._bindingEmpleado = empleadoBindingSource;
     this._bindingOPs      = oPBindingSource;
 }
        public void Login(string user, string pass)
        {
            //throw new NotImplementedException();
            AutenticarDTO login = Adaptador.Autenticar(user, pass);

            switch (login.Estado)
            {
            case 0:
                MessageBox.Show("Login exitoso.", "Aviso");
                new VistaPrincipal(login).Show();
                _vista.Actualizar();
                break;

            case 2:
                MessageBox.Show("Usuario en sesion existente.", "Aviso");
                _vista.Actualizar();
                break;

            case 1:
                MessageBox.Show("Credenciales erroneas.", "Aviso");
                _vista.Actualizar();
                break;

            default:
                MessageBox.Show("Como llegue aqui?", "ERROR");
                break;
            }
        }
        public PresentadorListaOPSupCalidad(VistaListaOPSupCalidad vista, AutenticarDTO login, BindingSource bindingLogin, BindingSource bindingOP)
        {
            this._vista = vista;
            this._login = login;

            this._bindingLogin = bindingLogin;
            this._bindingOP    = bindingOP;
        }
 public VistaVisualizarInformacion(OPDTO op, AutenticarDTO login)
 {
     InitializeComponent();
     _presentador = new PresentadorVisualizarInformacion(this, op, oPBindingSource);
     dataGridView1.AllowUserToAddRows = false;
     dataGridView1.SelectionMode      = DataGridViewSelectionMode.FullRowSelect;
     dataGridView1.ReadOnly           = true;
     //this.labelTop1.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.bindingTop1, "", true));
 }
示例#6
0
 public VistaListaOP(AutenticarDTO login)
 {
     InitializeComponent();
     dataGridView1.AllowUserToAddRows = false;
     dataGridView1.SelectionMode      = DataGridViewSelectionMode.FullRowSelect;
     dataGridView1.ReadOnly           = true;
     _presentador     = new PresentadorListaOpSupLinea(this, login, empleadoBindingSource, oPBindingSource);
     this.WindowState = FormWindowState.Maximized;
     this.ControlBox  = false;
 }
        public PresentadorIniciarOP(VistaIniciarOP vista, AutenticarDTO login, BindingSource loginBindingSource, BindingSource modeloBindingSource, BindingSource colorBindingSource, BindingSource lineaTrabajoBindingSource) //: this(vista, supervisor)
        {
            this._login = login;
            this._vista = vista;

            this._bindingLogin  = loginBindingSource;
            this._bindingModelo = modeloBindingSource;
            this._bindingColor  = colorBindingSource;
            this._bindingLinea  = lineaTrabajoBindingSource;
        }
示例#8
0
 public VistaPrincipal(AutenticarDTO login)
 {
     this._presentador = new PresentadorPrincipal(this, login);
     InitializeComponent();
     administradorToolStripMenuItem.Enabled       = false;
     supervisorDeCalidadToolStripMenuItem.Enabled = false;
     sToolStripMenuItem.Enabled            = false;
     datosEnLineaToolStripMenuItem.Enabled = false;
     this.MaximizeBox     = false;
     this.FormBorderStyle = FormBorderStyle.FixedDialog;
 }
        public PresentadorRegistrarInspeccion(VistaRegistrarInspeccion vista, OPDTO op, AutenticarDTO login, BindingSource loginBindingSource, BindingSource oPBindingSource, BindingSource defectoBindingSource, BindingSource tipoDefectoBindingSource)
        {
            this._vista    = vista;
            this._login    = login;
            this._op       = op;
            this._defectos = new List <DefectoDTO>()
            {
            };

            this._bindingLogin       = loginBindingSource;
            this._bindingOP          = oPBindingSource;
            this._bindingDefectos    = defectoBindingSource;
            this._bindingTipoDefecto = tipoDefectoBindingSource;
        }
示例#10
0
        public async Task <IActionResult> Autenticar([FromBody] AutenticarDTO model)
        {
            var usuario = await _userService.Autenticar(model.Username, model.Password);

            var token = _userService.ObtenerToken(usuario.Id);

            return(Ok(new
            {
                Id = usuario.Id,
                Username = usuario.Username,
                FirstName = usuario.Nombre,
                LastName = usuario.Apellido,
                Token = token
            }));
        }
示例#11
0
        public VistaIniciarOP(AutenticarDTO login)
        {
            InitializeComponent();
            _presentador             = new PresentadorIniciarOP(this, login, loginBindingSource, modeloBindingSource, colorBindingSource, lineaTrabajoBindingSource);
            cBoxModelo.DataSource    = modeloBindingSource;
            cBoxModelo.DisplayMember = "Denominacion";
            cBoxModelo.ValueMember   = "SKU";
            cBoxColor.DataSource     = colorBindingSource;
            cBoxColor.DisplayMember  = "Descripcion";
            cBoxColor.ValueMember    = "Codigo";
            cBoxLinea.DataSource     = lineaTrabajoBindingSource;
            cBoxLinea.DisplayMember  = "Descripcion";
            cBoxLinea.ValueMember    = "Numero";

            this.FormBorderStyle = FormBorderStyle.FixedDialog;
            //this.WindowState = FormWindowState.Maximized;
            this.ControlBox = false;
        }
        public async Task <AutenticarDTO> AuthenticarCliente(string UserName, string Password)
        {
            ClienteEntity cliente = await iClientesRepository.AuthenticarCliente(UserName, Password);

            AutenticarDTO autenticarDTO = new AutenticarDTO();

            if (cliente != null)
            {
                ClientesAssembler assembler = new ClientesAssembler();
                autenticarDTO.cliente = assembler.AssembleDTO(cliente);
                autenticarDTO.code    = 1;
                autenticarDTO.token   = Seguridad.CrearJwt(cliente);
            }
            else
            {
                autenticarDTO.code = 0;
            }

            return(autenticarDTO);
        }
示例#13
0
        public async Task <Usuario> AutenticarAsync(AutenticarDTO request)
        {
            try
            {
                StringBuilder query = new StringBuilder();
                query.AppendLine("SELECT ID_USUARIO Id, NOME Login, SENHA, INATIVO, SP_LOJ Loja, SP_DAT DataInclusao, SP_DAT_ALT DataAlteracao");
                query.AppendLine("  FROM USUARIOS");
                query.AppendLine(" WHERE NOME = :nome");
                query.AppendLine("   AND SENHA = :senha");

                var result = await SqlMapper.QueryFirstOrDefaultAsync <Usuario>(this.UnitOfWork.Connection,
                                                                                query.ToString(), new { nome = request.Login, senha = request.Senha }, this.UnitOfWork.Transaction);

                return(result);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
示例#14
0
        public AutenticarDTO Autenticar(string user, string pass)
        {
            var aux = GestorAutenticar.Autenticar(user, pass);

            if (aux.Item1 == null)
            {
                return(new AutenticarDTO()
                {
                    Estado = aux.Item2
                });
            }
            else
            {
                var login = new AutenticarDTO()
                {
                    Estado   = aux.Item2,
                    Sesion   = aux.Item1.Codigo,
                    Usuario  = aux.Item1.User.Codigo,
                    Empleado = aux.Item1.User.Empleado.Codigo,
                    Nombre   = aux.Item1.User.Empleado.Nombre
                };
                switch (aux.Item1.User.Empleado.Cargo)
                {
                case Cargo.SUP_LINEA:
                    login.Cargo = Cargo.SUP_LINEA.ToString();
                    break;

                case Cargo.SUP_CALIDAD:
                    login.Cargo = Cargo.SUP_CALIDAD.ToString();
                    break;

                case Cargo.ADMIN:
                    login.Cargo = Cargo.ADMIN.ToString();
                    break;

                default:
                    break;
                }
                return(login);
            }
        }
示例#15
0
 public PresentadorPrincipal(VistaPrincipal vista, AutenticarDTO login)
 {
     this._vista = vista;
     this._login = login;
 }