Exemplo n.º 1
0
 public void insertAuthetication(E_Auth autentication)
 {
     using (var db = new Mapeo())
     {
         db.autentication.Add(autentication);
         db.SaveChanges();
     }
 }
Exemplo n.º 2
0
    protected void Connection()
    {
        E_Auth authenticate = new E_Auth();
        Mac    connection   = new Mac();

        authenticate.fecha_Fin = DateTime.Now;
        authenticate.Ip        = connection.ip();
        authenticate.Mac       = connection.mac();
        authenticate.User_id   = ((E_user)Session["validUser"]).Id;
        authenticate.Session   = Session.SessionID;
        new DAO_Security().insertAuthetication(authenticate);
    }
Exemplo n.º 3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        E_Auth auth = new E_Auth();

        auth.User_id = ((E_user)Session["validUser"]).Id;
        auth.Session = Session.SessionID;
        new DAO_Security().updateUser(auth);
        Session["validUser"] = null;
        Session.Abandon();
        Session.Clear();
        Response.Redirect("~/View/Login.aspx");
    }
Exemplo n.º 4
0
 public void updateUser(E_Auth authenticate)
 {
     using (var db = new Mapeo())
     {
         E_Auth auth = new E_Auth();
         auth           = db.autentication.Where(x => x.Session == authenticate.Session && x.User_id == authenticate.User_id).First();
         auth.fecha_Fin = DateTime.Now;
         db.autentication.Attach(auth);
         var entry = db.Entry(auth);
         entry.State = System.Data.Entity.EntityState.Modified;
         db.SaveChanges();
     }
 }