示例#1
0
        /// <summary>
        /// 修改用户登录状态
        /// </summary>
        /// <param name="UserLoginObj"></param>
        /// <returns></returns>
        public bool UpdateUserLoginRecordStateInfo(T_SYS_USERLOGINRECORD UserLoginObj)
        {
            SysUserLoginRecordDAL UserLoginDal = new SysUserLoginRecordDAL();

            try
            {
                var entity = from ent in UserLoginDal.GetTable()
                             where ent.LOGINRECORDID == UserLoginObj.LOGINRECORDID
                             select ent;

                if (entity.Count() > 0)
                {
                    var entitys = entity.FirstOrDefault();
                    entitys.LOGINDATE   = UserLoginObj.LOGINDATE;
                    entitys.LOGINIP     = UserLoginObj.LOGINIP;
                    entitys.LOGINTIME   = UserLoginObj.LOGINTIME;
                    entitys.ONLINESTATE = UserLoginObj.ONLINESTATE;
                    entitys.REMARK      = UserLoginObj.REMARK;
                    entitys.USERNAME    = UserLoginObj.USERNAME;

                    if (UserLoginDal.Update(entitys) == 1)
                    {
                        return(true);
                    }
                }
                return(false);
            }
            catch (Exception ex)
            {
                Tracer.Debug("用户登录SysUserLoginRecordBll-UpdateUserLoginRecordStateInfo" + System.DateTime.Now.ToString() + " " + ex.ToString());
                return(false);

                throw (ex);
            }
        }
示例#2
0
        public T_SYS_USERLOGINRECORD GetLoginUserRecordInfsByRecordID(string StruserID, string StrState)
        {
            SysUserLoginRecordDAL UserLoginDal = new SysUserLoginRecordDAL();

            try
            {
                var entity = from ent in UserLoginDal.GetTable()
                             where ent.LOGINRECORDID == StruserID && ent.ONLINESTATE == StrState
                             select ent;



                return(entity.Count() > 0  ? entity.FirstOrDefault() : null);
            }
            catch (Exception ex)
            {
                Tracer.Debug("用户登录SysUserLoginRecordBll-GetLoginUserRecordInfsByRecordID" + System.DateTime.Now.ToString() + " " + ex.ToString());
                return(null);

                throw (ex);
            }
        }
示例#3
0
        /// <summary>
        /// 添加用户登录记录
        /// </summary>
        /// <param name="UserLoginObj"></param>
        /// <returns></returns>
        public bool AddUserLoginInfo(T_SYS_USERLOGINRECORD UserLoginObj)
        {
            SysUserLoginRecordDAL UserLoginDal = new SysUserLoginRecordDAL();

            try
            {
                //int i = dal.Add(UserLoginObj);
                dal.AddToContext(UserLoginObj);
                int i = dal.SaveContextChanges();
                if (i > 0)
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            catch (Exception ex)
            {
                Tracer.Debug("用户登录SysUserLoginRecordBll-AddUserLoginInfo" + System.DateTime.Now.ToString() + " " + ex.ToString());
                throw (ex);
            }
        }