Beispiel #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);
        }
Beispiel #2
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);
        }