public ResumeResult ResumeScript(Lua script) { _currThread = script; try { LuaLibraryBase.SetCurrentThread(_currThread); var execResult = script.Resume(0); script.Resume(1); _lua.RunScheduledDisposes(); //not sure how this is going to work out, so do this too script.RunScheduledDisposes(); _currThread = null; var result = new ResumeResult(); if (execResult == 0) { // terminated result.Terminated = true; } else { // yielded result.WaitForFrame = FrameAdvanceRequested; } FrameAdvanceRequested = false; return(result); } finally { LuaLibraryBase.ClearCurrentThread(); } }
public bool Save(FileActivity activity, ResumeResult data) { try { _Save(activity, data); return(true); } catch (Exception ex) { LoggerWrapper.Logger.Error("简历数据存储异常", ex); return(false); } }
protected override void _Save(FileActivity activity, ResumeResult data) { if (activity.IsChanged) { _conn.ExecuteScalar(string.Format("delete from resumelist where guid='{0}';delete from resumedetaillist where guid='{0}';", activity.HashCode)); } DateTime dateTime = DateTime.Now; ResumeData resumeData = data.ResumeInfo; //记录简历信息 _conn.ExecuteNonQuery(string.Format(InsertResumeSql, activity.HashCode, resumeData.Name, resumeData.Age, resumeData.Gender, resumeData.Phone, resumeData.Email, resumeData.JobTarget == null ? string.Empty : resumeData.JobTarget.JobCareer, resumeData.LatestDegree, resumeData.JobTarget == null ? string.Empty : resumeData.JobTarget.JobCareer, resumeData.Residence, activity.FilePath, "本地计算机", resumeData.WorkYears, dateTime.ToString(DateFormat), dateTime.ToUniversalTime(), Dorado.SystemInfo.SystemInfo.GetMacAddress(), data.Text)); }
public OperateResult <ResumeResult> ParseText(string text) { try { //先判别文件是否是有效简历 OperateResult <ResumePredictResult> predictResult = PredictText(text); if (predictResult.Status == OperateStatus.Failure) { return(new OperateResult <ResumeResult>(OperateStatus.Failure, predictResult.Description)); } ResumeResult resumeResult = new ResumeResult { Text = predictResult.Data.Text, Score = predictResult.Data.Score }; if (!predictResult.Data.IsResume) { return(new OperateResult <ResumeResult>(OperateStatus.Failure, string.Format("不是有效的简历格式,得分[{0}]", predictResult.Data.Score), resumeResult)); } //文本简历解析 TextCVParser parser = new TextCVParser(predictResult.Data.Text); ResumeData resumeData = parser.Parse(); if (!resumeData.IsValid()) { return(new OperateResult <ResumeResult>(OperateStatus.Failure, "不是有效的简历格式,缺少简历必要信息", resumeResult)); } resumeResult.IsResume = true; resumeResult.ResumeInfo = resumeData; return(new OperateResult <ResumeResult>(OperateStatus.Success, "操作成功", resumeResult)); } catch (Exception ex) { LoggerWrapper.Logger.Error("简历解析错误", ex); return(new OperateResult <ResumeResult>(OperateStatus.Failure, ex.Message)); } }
public ResumeResult ResumeScript(Lua script) { EventsLibrary.CurrentThread = script; _currThread = script; var execResult = script.Resume(0); _currThread = null; var result = new ResumeResult(); if (execResult == 0) { // terminated result.Terminated = true; } else { // yielded result.WaitForFrame = FrameAdvanceRequested; } FrameAdvanceRequested = false; return(result); }
public override ResumeResult ResumeScript(LuaFile lf) { _currThread = lf.Thread; try { LuaLibraryBase.SetCurrentThread(lf); var execResult = _currThread.Resume(0); _lua.RunScheduledDisposes(); // TODO: I don't think this is needed anymore, we run this regularly anyway // not sure how this is going to work out, so do this too _currThread.RunScheduledDisposes(); _currThread = null; var result = new ResumeResult(); if (execResult == 0) { // terminated result.Terminated = true; } else { // yielded result.WaitForFrame = FrameAdvanceRequested; } FrameAdvanceRequested = false; return(result); } finally { LuaLibraryBase.ClearCurrentThread(); } }
public ResumeResult ResumeScript(Lua script) { _currThread = script; try { LuaLibraryBase.SetCurrentThread(_currThread); var execResult = script.Resume(0); _lua.RunScheduledDisposes(); //not sure how this is going to work out, so do this too script.RunScheduledDisposes(); _currThread = null; var result = new ResumeResult(); if (execResult == 0) { // terminated result.Terminated = true; } else { // yielded result.WaitForFrame = FrameAdvanceRequested; } FrameAdvanceRequested = false; return result; } finally { LuaLibraryBase.ClearCurrentThread(); } }
protected override void _Save(FileActivity activity, ResumeResult data) { throw new NotImplementedException(); }
public ResumeResult ResumeScript(Lua script) { EventsLibrary.CurrentThread = script; _currThread = script; var execResult = script.Resume(0); _currThread = null; var result = new ResumeResult(); if (execResult == 0) { // terminated result.Terminated = true; } else { // yielded result.WaitForFrame = FrameAdvanceRequested; } FrameAdvanceRequested = false; return result; }
protected abstract void _Save(FileActivity activity, ResumeResult data);