/// <summary> /// 添加日志 (登陆前使用) /// </summary> /// <param name="description"></param> /// <param name="userId"></param> /// <returns></returns> public static int AddLog(string description, int userId) { string ipAddress = HttpContext.Current.Request.UserHostAddress; string url = HttpContext.Current.Request.Path; return(LogBLL.AddLog(description, ipAddress, url, userId)); }
/// <summary> /// 添加日志(登陆后,用户票据存在时使用) /// </summary> /// <param name="description">日志内容描述</param> /// <returns>成功,返回日志标识,否则,返回-1</returns> public static int AddLog(string description) { string ipAddress = HttpContext.Current.Request.UserHostAddress; string url = HttpContext.Current.Request.Path; //int userId = Convert.ToInt32(HttpContext.Current.Request.Cookies["__UserInfo"]["userId"]); int userId = 1; return(LogBLL.AddLog(description, ipAddress, url, userId)); }