BEST /BaliEnterpriseSystems/BaliEnterpriseSystems/Logout.aspx.cs

Language C# Lines 51
MD5 Hash fef9af641d64bfb0f59869cf1efe799f
Repository https://github.com/sirivedula/BEST.git View Raw File
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using BaliEnterpriseSystems.BestObjects;
using System.Collections.Generic;

namespace BaliEnterpriseSystems
{
    public partial class Logout : System.Web.UI.Page
    {
        protected void Page_LoadComplete(object sender, EventArgs e)
        {
            if (HttpContext.Current.Session["CurrentUser"] != null)
            {

                var cUser = Utils.User.BestUser;
                if (cUser != null)
                {
                    var sessguid = HttpContext.Current.Session["SessionGuid"];
                    if (sessguid != null)
                    {
                        BestField sguid = new BestField() { fieldName = "sessionguid", fieldType = "System.Guid", paramOledbType = System.Data.OleDb.OleDbType.Guid, fieldSize = 40 };
                        sguid.fieldValue = sessguid.ToString();
                        BestLogins bslog = new BestLogins();
                        List<BestField> bparam = new List<BestField>();
                        bparam.Add(sguid);
                        bslog.LoadRows("sessionguid=?", bparam);
                        if (bslog.TableRows.Count > 0)
                        {
                            bslog.logoutdate = DateTime.Now;
                            bslog.CurrentRow.Save();
                        }
                    }

                }
            }

            Session.Contents.Abandon();
        }
    }
}
Back to Top