Example #1
0
        /// <summary>
        /// Ghi nhận việc đăng nhập của một cá nhân
        /// </summary>
        /// <param name="p"></param>
        /// <param name="note"></param>
        /// <returns></returns>
        public int logLogin(HttpRequestBase p, string note)
        {
            int       ret       = 0;
            LOGME_BUS bus_logme = new LOGME_BUS();
            LOGME_OBJ obj_logme = new LOGME_OBJ();

            obj_logme.ACTION     = "LOG";
            obj_logme.CODE       = bus_logme.GenNextCode(obj_logme);
            obj_logme.CREATETIME = DateTime.Now;
            obj_logme.IP         = com.getIp(p);
            obj_logme.NOTE       = note;
            obj_logme.RECORDCODE = "";
            obj_logme.STAFFCODE  = ses.loginCode;
            obj_logme.STAFFNAME  = ses.loginName;
            obj_logme.TABLENAME  = "STAFF";
            //            obj_logme.ENDTIME = com.minDate();
            obj_logme.COMPUTERNAME = com.getComputerName(p);
            obj_logme.WEBBROWSER   = com.getWebBrowser(p);
            obj_logme.OS           = com.getOS(p);
            obj_logme.URLSHORT     = ""; // p.Url.AbsoluteUri;
            obj_logme.SESSIONCODE  = ses.pSessionCode;
            obj_logme.URLNAME      = ""; // p.RawUrl;
            ret = bus_logme.Insert(obj_logme);
            bus_logme.CloseConnection();
            //save
            ses.pLoginSession = obj_logme.CODE;
            return(ret);
        }
Example #2
0
        /// <summary>
        /// Ghi nhận kết thúc một session
        /// </summary>
        /// <returns></returns>
        public int logSessionOut()
        {
            int       ret = 0;
            LOGME_OBJ obj = new LOGME_OBJ();
            LOGME_BUS bus = new LOGME_BUS();

            obj.CODE     = ses.pSessionCode;
            obj._ID.CODE = obj.CODE;
            obj.ENDTIME  = DateTime.Now;
            string[] fi = { "ENDTIME" };
            bus.Update(fi, obj);
            bus.CloseConnection();
            return(ret);
        }
Example #3
0
        /// <summary>
        /// Ghi nhật bắt đầu session
        /// </summary>
        /// <returns></returns>
        public int logSession()
        {
            int       ret = 0;
            LOGME_BUS bus = new LOGME_BUS();
            LOGME_OBJ obj = new LOGME_OBJ();

            obj.CODE         = bus.GenNextCode(obj);
            ses.pSessionCode = obj.CODE;
            obj.ACTION       = "SES";
            obj.CREATETIME   = DateTime.Now;
            obj.ENDTIME      = com.minDate();
            ret = bus.Insert(obj);
            bus.CloseConnection();
            return(ret);
        }
Example #4
0
        /// <summary>
        /// Thoát đăng nhập
        /// </summary>
        /// <param name="p"></param>
        /// <returns></returns>
        public int logLogout()
        {
            int       ret     = 0;
            LOGME_BUS bus_log = new LOGME_BUS();
            LOGME_OBJ obj_log = new LOGME_OBJ();

            obj_log.CODE     = ses.pLoginSession;
            obj_log._ID.CODE = ses.pLoginSession;
            obj_log.ENDTIME  = DateTime.Now;
            string[] fi = { "ENDTIME" };
            ret = bus_log.Update(fi, obj_log);
            bus_log.CloseConnection();
            ses.pLoginSession = "";//clear
            return(ret);
        }