public void Throw(LogInfo logInfo) { BASLOGModel model = new BASLOGModel(); model.LOGTYPECODE = LogType.ORMBaseOperate.ToString(); if (logInfo.Remark.Length > 0) { model.LOGCONTENT = logInfo.Remark.Substring(0, logInfo.Remark.Length > 999 ? 999 : logInfo.Remark.Length); } model.OPERATEUSERID = CurrentUser.Id; model.OPERATETIME = logInfo.LogTime; model.Insert(); }
/// <summary> /// 添加日志 /// </summary> protected void AddLog(TranModel tran, LogType logType, string logContent) { BASLOGModel model = new BASLOGModel(); model.LOGTYPECODE = logType.ToString(); model.LOGCONTENT = logContent; model.OPERATEUSERID = CurrentUser.Id; //model.OPERATETIME = DateTime.Now; model.OPERATEIP = this.GetIP(); if (tran == null) { model.Insert(); } else { model.Inserting(tran); } }