Beispiel #1
0
 public static OperateLogBLL GetInstance()
 {
     if (instance == null)
     {
         instance = new OperateLogBLL();
     }
     return(instance);
 }
Beispiel #2
0
        /// <summary>
        /// 添加日志
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="uinfo"></param>
        /// <param name="BillNo"></param>
        /// <param name="tag"></param>
        /// <param name="t"></param>
        public void InsertLog <T>(UserLogInfo uinfo, int priceTempletId, string tag, T t) where T : class, new()
        {
            PriceTempletLog log = new PriceTempletLog
            {
                CreateTime     = DateTime.Now,
                Operator       = uinfo.Name,
                OperatorId     = uinfo.Id,
                IP             = uinfo.ClientIP,
                Title          = tag,
                PriceTempletId = priceTempletId,
                Message        = OperateLogBLL.ObjectToStr(t)
            };

            base.Add(log);
        }
Beispiel #3
0
        /// <summary>
        /// 添加日志
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="uinfo"></param>
        /// <param name="BillNo"></param>
        /// <param name="tag"></param>
        /// <param name="t"></param>
        public void InsertLog <T>(UserLogInfo uinfo, string BillNo, string tag, T t) where T : class, new()
        {
            OrderOperationLog log = new OrderOperationLog
            {
                CreateTime = DateTime.Now,
                Operator   = uinfo.Name,
                OperatorId = uinfo.Id,
                IP         = uinfo.ClientIP,
                Title      = tag,
                BillNo     = BillNo,
                Message    = OperateLogBLL.ObjectToStr(t)
            };

            base.Add(log);
        }
Beispiel #4
0
        /// <summary>
        /// 对象编辑 的日志
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="uinfo"></param>
        /// <param name="BillNo"></param>
        /// <param name="tag"></param>
        /// <param name="before"></param>
        /// <param name="after"></param>
        public void EditLog <T>(UserLogInfo uinfo, int priceTempletId, string tag, T before, T after) where T : class, new()
        {
            PriceTempletLog log = new PriceTempletLog
            {
                CreateTime     = DateTime.Now,
                Operator       = uinfo.Name,
                OperatorId     = uinfo.Id,
                IP             = uinfo.ClientIP,
                Title          = tag,
                PriceTempletId = priceTempletId,
                Message        = OperateLogBLL.ObjectEquals(before, after)
            };

            if (!string.IsNullOrEmpty(log.Message))
            {
                base.Add(log);
            }
        }
Beispiel #5
0
        /// <summary>
        /// 对象编辑 的日志
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="uinfo"></param>
        /// <param name="BillNo"></param>
        /// <param name="tag"></param>
        /// <param name="before"></param>
        /// <param name="after"></param>
        public void EditLog <T>(UserLogInfo uinfo, string BillNo, string tag, T before, T after) where T : class, new()
        {
            OrderOperationLog log = new OrderOperationLog
            {
                CreateTime = DateTime.Now,
                Operator   = uinfo.Name,
                OperatorId = uinfo.Id,
                IP         = uinfo.ClientIP,
                Title      = tag,
                BillNo     = BillNo,
                Message    = OperateLogBLL.ObjectEquals(before, after)
            };

            if (!string.IsNullOrEmpty(log.Message))
            {
                base.Add(log);
            }
        }
Beispiel #6
0
        public OptResult Login(string Username, string Password, string ip = "")
        {
            Employee user = TableNoTracking().Where(o => o.No == Username && o.EmployeeType == EmployeeTypeEnum.支持员工 && o.State == EmployeeStateEnum.架).FirstOrDefault();

            if (user == null)
            {
                return(new OptResult("帐号不存在"));
            }

            if (user.Password != CryptographyUtils.EncryptString(Password))
            {
                OperateLogBLL.GetInstance().LoginLog("用户登录", "密码不正确", user.Id, user.RealName, ip);
                return(new OptResult("密码不正确"));
            }

            OperateLogBLL.GetInstance().LoginLog("用户登录", "登录成功", user.Id, user.RealName, ip);
            return(new OptResult()
            {
                Data = user, Msg = "登录成功"
            });
        }