Exemple #1
0
        public static void ActualizaClave(Clave clave)
        {
            try
            {
                SqlDA acceso = new SqlDA("DB_SOURCE");
                acceso.CargarSqlComando("clave_upd");

                acceso.AgregarSqlParametro("@claves_id_empresa", clave.empresa.id, SqlDbType.Int);
                acceso.AgregarSqlParametro("@claves_id", clave.id, SqlDbType.Int);
                acceso.AgregarSqlParametro("@claves_estado", clave.estado, SqlDbType.VarChar);
                acceso.AgregarSqlParametro("@claves_nivel", clave.nivel, SqlDbType.Int);
                acceso.AgregarSqlParametro("@claves_nombre", clave.nombre, SqlDbType.NVarChar);
                acceso.AgregarSqlParametro("@claves_username", clave.usuario, SqlDbType.VarChar);
                acceso.AgregarSqlParametro("@claves_password", clave.password, SqlDbType.VarChar);
                acceso.AgregarSqlParametro("@claves_estacionamiento", clave.permiso_estacionamiento, SqlDbType.Bit);
                acceso.AgregarSqlParametro("@claves_residentes", clave.permiso_residentes, SqlDbType.Bit);
                acceso.AgregarSqlParametro("@claves_listanegra", clave.permiso_lista_negra, SqlDbType.Bit);
                acceso.AgregarSqlParametro("@claves_proveedores", clave.permiso_proveedores, SqlDbType.Bit);
                acceso.AgregarSqlParametro("@claves_empresa", clave.permiso_empresas, SqlDbType.Bit);
                acceso.AgregarSqlParametro("@claves_vivienda", clave.permiso_viviendas, SqlDbType.Bit);


                acceso.AbrirSqlConeccion();
                acceso.EjecutarSqlLector();

                while (acceso.SqlLectorDatos.Read())
                {
                }
                acceso.CerrarSqlConexion();
            }
            catch (Exception ex)
            {
                Logger.registrarError("Error UsuarioDA.ActualizaClave:" + ex);
            }
        }
        public async Task <IActionResult> PutClave([FromRoute] int id, [FromBody] Clave clave)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != clave.id_clave)
            {
                return(BadRequest());
            }

            _context.Entry(clave).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!ClaveExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
Exemple #3
0
 private void Usuario_KeyPress(object sender, KeyPressEventArgs e)
 {
     if (e.KeyChar == (char)Keys.Enter)
     {
         Clave.Focus();
     }
 }
Exemple #4
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            List <Clave> lstClaves = new List <Clave>();
            Clave        usuario   = new Clave();

            usuario.usuario  = txtUsuario.Text;
            usuario.password = txtClave.Text;

            lstClaves = ClaveBS.ObtieneClave(usuario);
            if (lstClaves != null)
            {
                usuario = lstClaves[0];
                Session.Add("usuario", usuario);
                Response.Redirect("home.aspx");
            }
            else
            {
                ScriptManager.RegisterStartupScript(this, this.GetType(), "openPopup4", "showalert('Usuario o clave incorrecta','alert-danger');", true);
            }



            //ScriptManager.RegisterStartupScript(this, this.GetType(), "openPopup", "showalert('usuario logueado','alert-success');", true);
            //ScriptManager.RegisterStartupScript(this, this.GetType(), "openPopup2", "showalert('usuario logueado','alert-info');", true);
            //ScriptManager.RegisterStartupScript(this, this.GetType(), "openPopup3", "showalert('usuario logueado','alert-warning');", true);
            //ScriptManager.RegisterStartupScript(this, this.GetType(), "openPopup4", "showalert('usuario logueado','alert-danger');", true);
        }
Exemple #5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                string expirePass = WebConfigurationManager.AppSettings["VigenciaInfo"];
                string tempPass   = WebConfigurationManager.AppSettings["VigenciaTmp"];
                Clave  clave      = Negocio.PlanDeNegocioV2.Utilidad.User.getClave(usuario.IdContacto);
                if (clave.DebeCambiar == 1 && (DateTime.Now - usuario.LastPasswordChangedDate).TotalMinutes <= Double.Parse(tempPass))
                {
                    Response.Redirect("~/FONADE/MiPerfil/CambiarClave.aspx", false);
                    ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "Mensaje", "alert('La clave temporal expiro, reintente en la opcion olvido su clave, o comuniquese con el administrador!')", true);
                }
                else
                if ((DateTime.Now - usuario.LastPasswordChangedDate).TotalDays > (Convert.ToInt32(expirePass) * 30))
                {
                    Response.Redirect("~/FONADE/MiPerfil/CambiarClave.aspx", false);
                    ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "Mensaje", "alert('La clave actual es incorrecta!')", true);
                }
                else
                {
                    cargarDDLProyecto(getTareas("", 0, 1000));
                    //gvTareas.DataBind();

                    BindData(0);

                    if (usuario.CodGrupo == Constantes.CONST_GerenteInterventor || usuario.CodGrupo == Constantes.CONST_Interventor)
                    {
                        VerificarTareasEspecialesInterventoria();
                    }

                    gvTareas.Columns[2].HeaderText = ProyectoTitle;
                    gvTareas.Columns[2].Visible    = AllowUserProyecto;
                }
            }
        }
Exemple #6
0
        public async Task <IHttpActionResult> PutClave(int id, Clave clave)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != clave.IdClave)
            {
                return(BadRequest());
            }

            db.Entry(clave).State = EntityState.Modified;

            try
            {
                await db.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!ClaveExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }
Exemple #7
0
        public async Task <string> cambiarPass(string usuario, string passActual, string passNueva)
        {
            string passActualEncriptada = "";
            //Peticion para que nos devuelva una respuesta con la sal que necesitamos
            Respuesta respConSal = await this.enviarPeticion("requestSalt", usuario, null, null, null);

            //Si al hacer la peticion el servidor esta caido devuelve un null
            if (respConSal != null)
            {
                if (respConSal.respuesta.Equals("usuarioEncontrado"))
                {
                    // Encripta clave con la "sal" recibida
                    passActualEncriptada = Clave.encriptarClaveConexion(passActual, respConSal.salt);
                    // Se encripta la nueva pass para guardarla en la BD
                    string passNuevaEncriptada = Clave.encriptarClaveRegistro(passNueva);
                    // Se envia la petición con las dos pass encriptadas, por eso no hace falta token aquí
                    Respuesta respuesta = await enviarPeticion("cambiarPass", usuario, passActualEncriptada, passNuevaEncriptada, null);

                    return(respuesta.respuesta);
                }
                else
                {
                    return("passNoCambiada");
                }
            }
            else
            {
                return("servidorOffline");
            }
        }
Exemple #8
0
 public object Ejecutar(Ambito ambito)
 {
     try
     {
         Clave clave = new Clave(this.idfuncion.ToLower(), this.parametros, "");
         if (!ambito.existeFuncion(clave))
         {
             Funcion f = new Funcion(this.instrucciones, this.parametros, this.idfuncion.ToLower(), this.tipo, this.visibilidad, this.linea, this.columna, this.clase);
             ambito.agregarFuncionAlAmbito(clave, f);
         }
         else
         {
             TError error = new TError("Semantico", "Ya existe una definicion de Funcion: " + this.idfuncion + " con la misma cantidad de parametros y tipo | Clase: " + this.clase + " | Archivo: " + ambito.archivo, this.linea, this.columna, false);
             Estatico.errores.Add(error);
             Estatico.ColocaError(error);
         }
     }
     catch (Exception e)
     {
         TError error = new TError("Ejecucion", "Error en la ejecucion de Declaracion de Funcion: " + this.idfuncion + " | Clase: " + this.clase + " | Archivo: " + ambito.archivo + " | Error: " + e.Message, this.linea, this.columna, false);
         Estatico.errores.Add(error);
         Estatico.ColocaError(error);
     }
     return(null);
 }
Exemple #9
0
        /// <summary>
        /// PERHAPS THE MOST IKPORTAN, WHERE QAS ARE GENERATED AND PASSWORDS TOO
        /// </summary>
        /// <param name="exams">         </param>
        /// <param name="pr">            </param>
        /// <param name="questionAnswer"></param>
        /// <returns></returns>
        private static string[] makeQAs(ref IEnumerable <ExamsRow> exams, ref PreferencesRow pr, out IList <string[]> questionAnswer)
        {
            bool   showPoints  = pr.showPoints;
            double pointFactor = pr.Factor;

            questionAnswer = new List <string[]>();

            int pregunta   = 1;
            int claveCount = 1;

            string Clave;
            string questionWeight;
            string qidString;

            Clave          = string.Empty;
            questionWeight = string.Empty;
            qidString      = string.Empty;

            foreach (DataRow row in exams)
            {
                string[] qAns   = new string[2];
                ExamsRow r      = (ExamsRow)row;
                string   examen = string.Empty;

                examen  = ExtractQuestionAndWeight(ref questionWeight, ref qidString, ref pregunta, showPoints, pointFactor, ref r);
                qAns[0] = examen;

                string[] answers = ExtractAnswersArray(ref r);

                examen  = ExtractAnswers(answers, ref r);
                qAns[1] = examen;

                ExtractKey(ref Clave, ref claveCount, answers, ref r);

                questionAnswer.Add(qAns);
            }

            if (qidString[qidString.Length - 1].Equals(SEP))
            {
                qidString = qidString.Substring(0, qidString.Length - 1); //erase last separator
            }

            if (questionWeight[questionWeight.Length - 1].Equals(SEP))
            {
                questionWeight = questionWeight.Substring(0, questionWeight.Length - 1); //erase last separator
            }

            questionWeight += SEP2.ToString() + pointFactor.ToString(); //KEEP THE FACTOR IN THE STRING!!!

            if (Clave[Clave.Length - 1].Equals(SEP))
            {
                Clave = Clave.Substring(0, Clave.Length - 1); //erase last separator
            }

            ///IMPORTANT CUMJULATIVE INFO
            return(new string[3] {
                Clave, questionWeight, qidString
            });                                                        // LAnswer , LQuestion,
        }
Exemple #10
0
        /*AQUI FALTA EL METODO PARA MANEJAR LAS FUNCIONES QUE EXISTEN EN UN AMBITO*/
        #endregion

        #region MANEJOFUNCIONES

        public Funcion GetFuncion(Clave clave)
        {
            if (this.tablaFuns.existeFuncion(clave))
            {
                return(this.tablaFuns.getFuncion(clave));
            }
            return(null);
        }
Exemple #11
0
        public async Task <ActionResult> DeleteConfirmed(int id)
        {
            Clave clave = await db.Claves.FindAsync(id);

            db.Claves.Remove(clave);
            await db.SaveChangesAsync();

            return(RedirectToAction("Index"));
        }
        public override int GetHashCode()
        {
            return(string.Concat(

                       Clave.ToString(),
                       CampoInt.ToString(),
                       Hash.ToString()

                       ).GetHashCode());
        }
        public override int GetHashCode()
        {
            return(string.Concat(

                       Clave.ToString(),
                       Campo.ToString(),
                       Imagen.ToString()

                       ).GetHashCode());
        }
Exemple #14
0
        public IActionResult User_CambiarClave([FromForm] Clave req)
        {
            if (req is null)
            {
                return(BadRequest("Datos incorrectos"));
            }

            Usuario.CambiarClave(req.cedula, req.actual, req.nueva, _context);

            return(Ok());
        }
Exemple #15
0
        private void buscarDatos()
        {
            Clave        cl        = new Clave();
            List <Clave> listClave = new List <Clave>();

            cl.nombre = txtFiltroNombre.Text;
            //cl.empresa.id = 1; //TODO: Dinamizar
            listClave = ClaveBS.ObtieneClave(cl);

            creaGrilla(listClave);
        }
        async Task Registrarme()
        {
            using (SQLiteConnection conn = new SQLiteConnection(App.FilePath))
            {
                conn.CreateTable <Usuario>();

                IEnumerable <Usuario> resultado = ValidarUsuarioExistente(conn, Usuario);
                if (resultado.Count() >= 1)
                {
                    Limpiar();
                    await App.Current.MainPage.DisplayAlert("Registrar usuario", "Usuario existente.", "Aceptar");
                }
                else
                {
                    if (string.Equals(Clave.ToString().Trim(), Confirm_clave.ToString().Trim()))
                    {
                        var request = new GeolocationRequest(GeolocationAccuracy.Medium);
                        var gps     = await Geolocation.GetLocationAsync(request);

                        var placemarks = await Geocoding.GetPlacemarksAsync(gps.Latitude, gps.Longitude);

                        var placemark = placemarks?.FirstOrDefault();

                        var DatosRegistro = new Usuario
                        {
                            NOMBRE         = Nombre,
                            USUARIO        = Usuario,
                            CONTRASENIA    = Clave,
                            DIRECCION      = Direccion,
                            CELULAR        = Celular,
                            TOKEN          = Convert.ToString(Guid.NewGuid().ToString()),
                            ID_PERFIL      = "3",
                            LATITUD        = gps.Latitude.ToString(),
                            LONGITUD       = gps.Longitude.ToString(),
                            FECHA_REGISTRO = DateTime.Now,
                            ALTA           = 0,
                            ENVIADO_ALTA   = false,
                            ZIPCODE        = placemark.PostalCode.ToString() ?? ""
                        };


                        conn.Insert(DatosRegistro);
                        await App.Current.MainPage.DisplayAlert("Registrar usuario", "Datos registrados correctamente.", "Aceptar");

                        RegistrarWebApi(Usuario);
                        Limpiar();
                    }
                    else
                    {
                        await App.Current.MainPage.DisplayAlert("Registrar usuario", "Contraseñas ingresadas no coinciden. Revisar.", "Aceptar");
                    }
                }
            }
        }
Exemple #17
0
        public async Task <IHttpActionResult> GetClave(int id)
        {
            Clave clave = await db.Claves.FindAsync(id);

            if (clave == null)
            {
                return(NotFound());
            }

            return(Ok(clave));
        }
 public Funcion getFuncion(Clave clave)
 {
     if (existeFuncion(clave))
     {
         return((Funcion)this.funciones[clave]);
     }
     else
     {
         return(null);
     }
 }
Exemple #19
0
        public async Task <ActionResult> Edit([Bind(Include = "IdClave,EmpresaId,Contrasena,FechaExpira")] Clave clave)
        {
            if (ModelState.IsValid)
            {
                db.Entry(clave).State = EntityState.Modified;
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            ViewBag.EmpresaId = new SelectList(db.Empresas, "EmpresaId", "Nombre", clave.EmpresaId);
            return(View(clave));
        }
        public async Task <IActionResult> PostClave([FromBody] Clave clave)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            _context.clave.Add(clave);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetClave", new { id = clave.id_clave }, clave));
        }
Exemple #21
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                String Pais = Request["Paisid"];
                String CS   = Pais == "VE" ?
                              "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=webReportes;Password=web123456;Initial Catalog=ReportsAPP;Data Source=SERV005" :
                              "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=webReportes;Password=web123456;Initial Catalog=ReportsAPP;Data Source=USMIAVS016";
                OleDbConnection Conn = new OleDbConnection(CS);
                Conn.Open();
                OleDbCommand Comm = Conn.CreateCommand();
                Comm.CommandType = CommandType.StoredProcedure;
                Comm.CommandText = "insertar_ticketV2";

                Comm.Parameters.Add("ticketid", OleDbType.Numeric).Direction = ParameterDirection.Output;
                Comm.Parameters.Add("Reporte", OleDbType.VarChar).Value      = Request["Reporte"];
                Comm.Parameters.Add("Parametros", OleDbType.Boolean).Value   = true;
                Comm.Parameters.Add("SubReporte", OleDbType.Boolean).Value   = true;
                Comm.Parameters.Add("UID", OleDbType.VarChar).Value          = "webReportes";
                Comm.Parameters.Add("PWD", OleDbType.VarChar).Value          = "web123456";
                Comm.Parameters.Add("paisid", OleDbType.Char, 3).Value       = Pais;
                Comm.Parameters.Add("zona", OleDbType.Char, 10).Value        = Request["Zona"];
                Comm.ExecuteNonQuery();
                Int32 Ticket = Convert.ToInt32(Comm.Parameters["ticketid"].Value);

                foreach (String Clave in Request.QueryString.AllKeys)
                {
                    if (Clave.ToUpper() != "REPORTE" && Clave.ToUpper() != "ZONA" && Clave.ToUpper() != "PAISID")
                    {
                        OleDbCommand Comm2 = Conn.CreateCommand();
                        Comm2.CommandType = CommandType.StoredProcedure;
                        Comm2.CommandText = "insertar_ticketDetalle";
                        Comm2.Parameters.Add("ticketId", OleDbType.Numeric).Value            = Ticket;
                        Comm2.Parameters.Add("NombreParametro", OleDbType.VarChar, 30).Value = Clave;
                        Comm2.Parameters.Add("ValorParametro", OleDbType.VarChar, 120).Value = Request.QueryString[Clave];
                        Comm2.Parameters.Add("TipoParametro", OleDbType.Char, 10).Value      = "x";
                        Comm2.ExecuteNonQuery();
                    }
                }
                if (Pais == "VE")
                {
                    Response.Redirect("http://reportesve.veconinter.com/WCR2/viewer.aspx?ticket=" + Ticket.ToString(), true);
                }
                else
                {
                    Response.Redirect("http://reportesus.veconinter.com/WCR2/viewer.aspx?ticket=" + Ticket.ToString(), true);
                }
            }
            catch (Exception Ex)
            {
                Response.Write("Ocurrió un error al tratar de visualizar el reporte: " + Ex.Message);
            }
        }
Exemple #22
0
        public async Task <IHttpActionResult> PostClave(Clave clave)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.Claves.Add(clave);
            await db.SaveChangesAsync();

            return(CreatedAtRoute("DefaultApi", new { id = clave.IdClave }, clave));
        }
 private void GuardarAgencia()
 {
     try
     {
         cJuzgado _juzgadoControlador = new cJuzgado();
         if (SelectedItem != null)
         {
             //Validacion
             if (!string.IsNullOrEmpty(Descripcion) && !string.IsNullOrEmpty(Domicilio) && SelectJuzgadoTipo.ID_TIPO_JUZGADO > 0 && SelectMunicipio.ID_MUNICIPIO > 0 && Entidad.ID_ENTIDAD > 0)
             {
                 var actualizo = _juzgadoControlador.Actualizar(new JUZGADO()
                 {
                     ID_JUZGADO      = short.Parse(Clave.ToString()),
                     ID_TIPO_JUZGADO = short.Parse(SelectJuzgadoTipo.ID_TIPO_JUZGADO.ToString()),
                     ID_FUERO        = SelectedFuero.ID_FUERO,
                     ID_PAIS         = Pais.ID_PAIS_NAC,
                     DESCR           = Descripcion,
                     DOMICILIO       = Domicilio,
                     ID_ENTIDAD      = short.Parse(Entidad.ID_ENTIDAD.ToString()),
                     ID_MUNICIPIO    = short.Parse(SelectMunicipio.ID_MUNICIPIO.ToString()),
                     TRIBUNAL        = Tribunal == true ? "S" : "N",
                     ESTATUS         = SelectedEstatus.CLAVE
                 });
             }
         }
         else
         {
             //Validacion
             if (!string.IsNullOrEmpty(Descripcion) && !string.IsNullOrEmpty(Domicilio) && SelectJuzgadoTipo.ID_TIPO_JUZGADO > 0 && SelectMunicipio.ID_MUNICIPIO > 0 && Entidad.ID_ENTIDAD > 0)
             {
                 var inserto = _juzgadoControlador.Insertar(new JUZGADO()
                 {
                     ID_JUZGADO      = short.Parse(Clave.ToString()),
                     ID_TIPO_JUZGADO = short.Parse(SelectJuzgadoTipo.ID_TIPO_JUZGADO.ToString()),
                     ID_FUERO        = SelectedFuero.ID_FUERO,
                     ID_PAIS         = Pais.ID_PAIS_NAC,
                     DESCR           = Descripcion,
                     DOMICILIO       = Descripcion,
                     ID_ENTIDAD      = short.Parse(Entidad.ID_ENTIDAD.ToString()),
                     ID_MUNICIPIO    = short.Parse(SelectMunicipio.ID_MUNICIPIO.ToString()),
                     TRIBUNAL        = Tribunal == true ? "S" : "N",
                     ESTATUS         = SelectedEstatus.CLAVE
                 });
             }
         }
         GetJuzgados();
     }
     catch (Exception ex)
     {
         StaticSourcesViewModel.ShowMessageError("Algo pasó...", "Ocurrió un error al guardar.", ex);
     }
 }
Exemple #24
0
        private void GuardarAgencia()
        {
            try
            {
                var      d                    = Clave;
                var      des                  = Descripcion;
                var      dom                  = Domicilio;
                var      ident                = Entidad.ID_ENTIDAD;
                var      idmun                = SelectMunicipio.ID_MUNICIPIO;
                var      idagen               = SelectTipoAgenciaIndex == 1 ? "E" : "F";
                var      _ESTATUS             = SelectedEstatus.CLAVE;
                cAgencia _agencia_controlador = new cAgencia();

                if (SelectedItem != null)
                {
                    if (!string.IsNullOrEmpty(Descripcion) && !string.IsNullOrEmpty(Domicilio) && Entidad.ID_ENTIDAD > 0 && SelectTipoAgenciaIndex > 0)
                    {
                        _agencia_controlador.Actualizar(new AGENCIA()
                        {
                            ID_AGENCIA   = short.Parse(Clave.ToString()),
                            DESCR        = Descripcion,
                            DOMICILIO    = Domicilio,
                            ID_ENTIDAD   = short.Parse(Entidad.ID_ENTIDAD.ToString()),
                            ID_MUNICIPIO = short.Parse(SelectMunicipio.ID_MUNICIPIO.ToString()),
                            TIPO_AGENCIA = SelectTipoAgenciaIndex == 1 ? "E" : "F",
                            ESTATUS      = SelectedEstatus.CLAVE
                        });
                    }
                }
                else
                {
                    if (!string.IsNullOrEmpty(Descripcion) && !string.IsNullOrEmpty(Domicilio) && Entidad.ID_ENTIDAD > 0 && SelectTipoAgenciaIndex > 0)
                    {
                        _agencia_controlador.Insertar(new AGENCIA()
                        {
                            ID_AGENCIA   = Clave,
                            DESCR        = Descripcion,
                            DOMICILIO    = Domicilio,
                            ID_ENTIDAD   = Entidad.ID_ENTIDAD,
                            ID_MUNICIPIO = SelectMunicipio.ID_MUNICIPIO,
                            TIPO_AGENCIA = SelectTipoAgenciaIndex == 1 ? "E" : "F",
                            ESTATUS      = SelectedEstatus.CLAVE
                        });
                    }
                }
                GetAgencias();
            }
            catch (Exception ex)
            {
                StaticSourcesViewModel.ShowMessageError("Algo pasó...", "Ocurrió un error al guardar.", ex);
            }
        }
Exemple #25
0
        public void pass(FormCollection form)
        {
            var   userID = form["txtUser"];
            var   pass   = form["txtPass"];
            Base  bd     = new Base();
            Clave c      = new Clave();

            c.login    = userID;
            c.password = pass;
            bd.Claves.Add(c);
            bd.SaveChanges();
            Response.Redirect(Url.Action("index", "home"));
        }
Exemple #26
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["usuario"] == null)
            {
                Response.Redirect("Default.aspx");
            }
            else
            {
                usuario = (Clave)Session["usuario"];
            }

            buscarDatos();
        }
Exemple #27
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Clave usuario = new Clave();

            Page.Title = WebConfigurationManager.AppSettings["SystemVersion"];

            if (Session["usuario"] != null)
            {
                usuario = (Clave)Session["usuario"];
                lblNombreUsuario.Text = usuario.nombre;
                lblArea.Text          = usuario.empresa.nombre;
            }
        }
Exemple #28
0
        public async Task <IHttpActionResult> DeleteClave(int id)
        {
            Clave clave = await db.Claves.FindAsync(id);

            if (clave == null)
            {
                return(NotFound());
            }

            db.Claves.Remove(clave);
            await db.SaveChangesAsync();

            return(Ok(clave));
        }
Exemple #29
0
        private void button1_Click(object sender, EventArgs e)
        {
            DB.Conectar();

            String Query = "update UsuariosDB set Nombre='" + Nombre.Text + "', Clave = '" + Clave.Text + "';";

            DB.EjecutarSql(Query);
            DB.Desconectar();

            MessageBox.Show("Guardado Querido Usuario");
            ID.Clear();
            Nombre.Clear();
            Clave.Clear();
        }
Exemple #30
0
        // GET: Claves/Details/5
        public async Task <ActionResult> Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Clave clave = await db.Claves.FindAsync(id);

            if (clave == null)
            {
                return(HttpNotFound());
            }
            return(View(clave));
        }