using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using QMFrameWork.Log;
using QMAPP.Entity.Sys;
using QMAPP.MD.Entity.Sys;
using QMAPP.DAL.Sys;
namespace QMAPP.BLL
{
///
/// 逻辑层基类
/// 作 者:李炳海
/// 编写日期:2012.11.16
///
public class BaseBLL
{
///
/// 登录信息
///
public LoginInfo LoginUser { get; set; }
public BaseBLL()
{
this.LoginUser = new LoginInfo();
}
#region 手持车载用户注入用户信息
///
/// 为业务逻辑类注入用户信息
///
/// 用户ID主键
public void RegistLoginUser(string userID)
{
try
{
if (LoginUser.UserID == null)
{
LoginUser = new LoginInfo();
User user = new UserManageDAL().GetBaseInfo(new User() { UserID = userID });
LoginUser.UserID = user.UserID;
LoginUser.UserName = user.UserName;
LoginUser.OrganID = user.OrgaID;
LoginUser.LoginUserID = user.LoginUserID;
}
}
catch (Exception ex)
{
throw ex;
}
}
#endregion
#region 输出异常日志
///
/// 输出异常日志
///
/// 异常
/// 自定义异常信息
public void RecordExceptionLog(Exception ex, string info)
{
LogManager.LogHelper.Error(new LogInfo()
{
ErrorInfo = ex,
Tag = ex.StackTrace,
Info = info
});
}
#endregion
}
}