/// <summary> /// /// </summary> /// <param name="operationType">操作类型</param> /// <param name="OperationContent">操作内容</param> /// <param name="Operator">操作者(后台系统可以不写)</param> public static void AddRunLog(OperationType operationType, string OperationContent, string Operator = null) { try { RunLogRepository repo = new RunLogRepository(); RunLog runLog = new RunLog(); runLog.OperationType = (int)operationType; runLog.OperationTime = DateTime.Now; runLog.Operator = Operator; runLog.OperationContent = OperationContent; repo.Insert(runLog); } catch { } }
public void GetTest() { //CameraListRepository repo = new CameraListRepository(); //List<CameraList> cameraList = repo.GetList(); //CameraList camera = repo.GetEntityById(cameraList[0].DeviceID); //cameraList = repo.GetListWithCondition(new { VideoType = camera.VideoType }); //cameraList = repo.GetListWithCondition("where VideoType=1 and VideoName like'14%'"); //TurnTableListRepository repo = new TurnTableListRepository(); //List<TurnTableList> result = repo.GetList(); //PresetListRepository repo = new PresetListRepository(); //List<PresetList> CameraList = repo.GetList(); RunLogRepository repo = new RunLogRepository(); List <RunLog> result = repo.GetListPaged(1, 0, null, "OperationTime desc"); //List<RunLog> result1 = repo.GetListPaged(2, 10, null, "OperationTime desc"); //List<RunLog> result2 = repo.GetListPaged(3, 10, null, "OperationTime desc"); //List<RunLog> result3 = repo.GetListPaged(4, 10, null, "OperationTime desc"); }
public override void ExecuteCommand(LogSession session, StringRequestInfo requestInfo) { try { string[] contents = requestInfo.Body.Split(','); int pageNumber = 0; int.TryParse(contents[0], out pageNumber); int rowsPerPage = 0; int.TryParse(contents[1], out rowsPerPage); RunLogRepository repo = new RunLogRepository(); RunLogAssemble runLogAssemble = new RunLogAssemble(); runLogAssemble.PageNumber = pageNumber; runLogAssemble.rowsPerPage = rowsPerPage; runLogAssemble.LogCount = repo.RecordCount(); runLogAssemble.PageCount = (int)Math.Ceiling((double)runLogAssemble.LogCount / rowsPerPage); runLogAssemble.RunLogList = repo.GetListPaged(pageNumber, rowsPerPage, null, "OperationTime desc"); session.TrySend(LogServerCommand.GetRunLogResult.ToString() + " " + JsonConvert.SerializeObject(runLogAssemble) + "\r\n"); } catch (Exception ex) { LogServerManager.AddErrLog(ErrLogType.InnerErr, ex); } }
public ProcessController() { repo = new RunLogRepository(); }