天津投入产出系统后端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

76 lines
1.9 KiB

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
{
/// <summary>
/// 逻辑层基类
/// 作 者:李炳海
/// 编写日期:2012.11.16
/// </summary>
public class BaseBLL
{
/// <summary>
/// 登录信息
/// </summary>
public LoginInfo LoginUser { get; set; }
public BaseBLL()
{
this.LoginUser = new LoginInfo();
}
#region 手持车载用户注入用户信息
/// <summary>
/// 为业务逻辑类注入用户信息
/// </summary>
/// <param name="userID">用户ID主键</param>
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 输出异常日志
/// <summary>
/// 输出异常日志
/// </summary>
/// <param name="ex">异常</param>
/// <param name="info">自定义异常信息</param>
public void RecordExceptionLog(Exception ex, string info)
{
LogManager.LogHelper.Error(new LogInfo()
{
ErrorInfo = ex,
Tag = ex.StackTrace,
Info = info
});
}
#endregion
}
}