Ejemplo n.º 1
0
        private static void RegistrarAcceso(string nombre, segabasEntities db)
        {
            try
            {
                var sacceso = new SEGACCESO()
                {
                    USUARIO          = nombre,
                    DIRECCIONIP      = HttpContext.Current.Request.UserHostAddress,
                    AUFECHACREACION  = DateTime.Now,
                    ESTASINCRONIZADA = 0
                };
                db.SEGACCESOS.AddObject(sacceso);
                db.SaveChanges();
            }

            catch (UpdateException ex)
            {
                throw new Exception(ex.Message);

                //todo: save to log 22-06-40-00
            }
            catch (Exception ex) {
                throw new Exception(ex.Message);
                //todo: save to log;
            }
        }
Ejemplo n.º 2
0
 public static bool CambiarClave(string claveNueva)
 {
     using (var db = new segabasEntities())
     {
         var usr = db.SEGUSUARIOS.FirstOrDefault(u => u.IDUSUARIO == UsuarioGlobal.IDUSUARIO);
         if (usr == null)
         {
             return(false);
         }
         usr.CLAVE = claveNueva;
         db.SaveChanges();
         return(true);
     }
 }