/// <summary> /// -1为系统,即计划任务中执行的工作 /// </summary> public static int Insert(string logTypeStr, string remind, int uid = -1) { M_IDC_Log model = new M_IDC_Log(); //如果日志表中数据大于20000,则移除最早的5000条 string sql = "Select COUNT(ID) From " + model.TbName; int count = SqlHelper.ObjectToInt32(sql); if (count > 20000) { sql = "Delete " + model.TbName + " Where ID in(SELECT TOP 5000 ID FROM " + model.TbName + ")"; SqlHelper.ExecuteSql(sql); } model.LogType = 0; model.OwnAdminID = -1; model.LogTypeStr = logTypeStr; model.Remind = remind; model.CreateDate = DateTime.Now; return(Insert(model)); }
public static int Insert(M_IDC_Log model) { return(Sql.insertID(model.TbName, model.GetParameters(), BLLCommon.GetParas(model), BLLCommon.GetFields(model))); }