/// <summary> /// 列表 /// </summary> /// <param name="setting"></param> /// <returns></returns> public static IPageOfList <ResumeInfo> List(SearchSetting setting) { FastPaging fp = new FastPaging(); fp.PageIndex = setting.PageIndex; fp.PageSize = setting.PageSize; fp.Ascending = false; fp.TableName = "Resumes"; fp.TableReName = "p"; fp.PrimaryKey = "ID"; fp.QueryFields = "p.*"; fp.OverOrderBy = " CreateDateTime DESC"; fp.WithOptions = " WITH(NOLOCK)"; fp.Condition = " IsDeleted = 0"; IList <ResumeInfo> list = new List <ResumeInfo>(); ResumeInfo model = null; DataTable dt = SQLPlus.ExecuteDataTable(CommandType.Text, fp.Build2005()); if (dt != null && dt.Rows.Count > 0) { foreach (DataRow dr in dt.Rows) { model = GetByRow(dr); if (model != null) { list.Add(model); } } } int count = Convert.ToInt32(SQLPlus.ExecuteScalar(CommandType.Text, fp.BuildCountSQL())); return(new PageOfList <ResumeInfo>(list, setting.PageIndex, setting.PageSize, count)); }
private List <ResumeInfo> listResumeNodes(TreeNode rootNode, int depth) { List <ResumeInfo> nodeList = new List <ResumeInfo>(); if (rootNode.Nodes.Count == 1 && rootNode.Nodes[0].Text == notBrowsedText) { ResumeInfo info = new ResumeInfo(rootNode, depth); nodeList.Add(info); } else if (rootNode.Nodes.Count > 0) { if (unlimitedDepthCheck.Checked || depth < searchDepthValue.Value) { foreach (TreeNode subNode in rootNode.Nodes) { if (subNode.Nodes.Count > 0) { nodeList.AddRange(listResumeNodes(subNode, depth + 1)); } } } } return(nodeList); }
private void resumeBrowse(List <ResumeInfo> infos) { Task[] resumeTasks = new Task[infos.Count]; for (int i = 0; i < infos.Count; i++) { ResumeInfo info = infos[i]; resumeTasks[i] = Task.Run(() => { TreeNodeCollection subNodes = createNodeFor( getNodeFilePath(info.Node), info.Depth).Nodes; BeginInvoke(new Action(() => { info.Node.Nodes.Clear(); foreach (TreeNode subNode in subNodes) { info.Node.Nodes.Add(subNode); } })); }); } foreach (Task resumeTask in resumeTasks) { resumeTask.Wait(); } }
public async Task <ResumeInfo> GetInfoAsync() { ResumeInfo resume = await _context.ResumeInfos .OrderBy(ri => ri.Created) .LastOrDefaultAsync(); return(resume != null ? resume : new()); }
public bool AddInfoAsync(ResumeInfo info) { info.Created = DateTime.Now; _context.ResumeInfos.Add(info); _context.SaveChanges(); return(true); }
public async Task <ResumeViewModel> GetInfoAsync() { ResumeInfo resumeInfo = await _resumeManager.GetInfoAsync(); return(new() { LivingPlace = resumeInfo.LivingPlace, Nationality = resumeInfo.Nationality, ProfileName = resumeInfo.Name }); }
public void MattElandSnapshotTest() { // Arrange var resume = new ResumeInfo("Matt Eland"); // Act var result = Analyze(resume); // Assert result.ShouldMatchSnapshot(); }
static void Main(string[] args) { ResumeInfo resume = GetResumeFromArgs(args); IResumeAnalyzer analyzer = GetResumeAnalyzer(); IContainer container = BuildContainer(); var result = analyzer.Analyze(resume, container); Console.WriteLine($"{resume.FullName}'s resume score is {result.Score}"); }
public ActionResult Apply(ResumeInfo model, FormCollection fc) { /* * 设置_CommmonLayout.cshtml中的变量 */ ViewBag.RootCategoryInfo = ViewBag.CurrentCategoryInfo = CategoryService.Get(GeneralConfig.JobRootId); int jobId = CECRequest.GetQueryInt("jobId", 0); var jobInfo = JobService.Get(jobId); if (jobInfo.Id <= 0) { return(Redirect("/job")); } if (Request.HttpMethod.ToUpper() == "POST") { //生日 model.Birthday = string.Format("{0}-{1}", fc["Year"], fc["Month"]); //籍贯 string birthplace = string.Empty; string province = fc["Province"], city = fc["City"], town = fc["Town"]; if (!string.IsNullOrEmpty(province)) { birthplace = province; if (!string.IsNullOrEmpty(city)) { birthplace += "-" + city; if (!string.IsNullOrEmpty(town)) { birthplace += "-" + town; } } } model.BirthPlace = birthplace; int id = ResumeService.Create(model).Id; bool status = false; if (id > 0) { status = true; } //POST ViewBag.Status = status; } ViewBag.JobInfo = jobInfo; return(View(model)); }
// [UpdateSnapshots] // This should only be active the first run or if snapshot needs updating public void SamplePinningTest() { // Arrange var resume = new ResumeInfo("Some Body"); resume.Jobs.Add(new JobInfo("Test Engineer", "Universal Exports", 42)); // Act var result = Analyze(resume); // Assert result.ShouldMatchSnapshot(); }
public void ShouldScoreJobsBasedOnKeywords(string title, int expectedScore) { // Arrange var resume = new ResumeInfo("Someone Awesome"); resume.Jobs.Add(new JobInfo(title, "Universal Exports", 1)); // Act var result = Analyze(resume); // Assert Assert.Equal(expectedScore, result.Score); }
public void SingleJobShouldScoreForNumberOfMonthsInJob(int numMonths, int expectedScore) { // Arrange var resume = new ResumeInfo("John Doe"); resume.Jobs.Add(new JobInfo("Organ Donor", "State of Ohio", numMonths)); // Act var result = Analyze(resume); // Assert Assert.Equal(expectedScore, result.Score); }
/// <summary> /// 添加或编辑 /// </summary> /// <param name="model"></param> /// <returns></returns> public static ResumeInfo Create(ResumeInfo model) { if (model.Id == 0) { int id = ResumeManage.Insert(model); model.Id = id; } else { //Update } return(model); }
public void SingleJobScoreShouldMatchExpectedUsingBogus() { // Arrange var resume = new ResumeInfo(_bogus.Name.FullName()); var job = BuildJobEntry(); resume.Jobs.Add(job); // Act var result = Analyze(resume); // Assert result.Score.ShouldBe(job.MonthsInJob); }
public void MattElandShouldAlwaysScoreWell() { // Arrange var resume = new ResumeInfo("Matt Eland"); // Act var result = Analyze(resume); // Assert result.Score.Should().Be(int.MaxValue); result.Resume.Should().NotBeNull(); result.Resume.Should().Be(resume); result.Resume.Jobs.Count.Should().BeLessThan(1); }
public void setting() { Resume_Name.Text = user.NAME; Resume_Phone.Text = user.PHONE; Resume_Addr.Text = user.ADDR; Resume_Email.Text = user.EMAIL; ResumeInfo info = new ResumeInfo(); info.readRESUMEInfo(user.ID); Subject_text.Text = ResumeInfo.getSubject(); Location_text.Text = ResumeInfo.getLocation(); Exp_text.Text = ResumeInfo.getExp(); License_text.Text = ResumeInfo.getLicense(); Introduce_text.Text = ResumeInfo.getContent(); }
public void EntityFrameworkKeywordTestsShouldFunction() { // Arrange var resume = new ResumeInfo("Someone Awesome"); resume.Jobs.Add(new JobInfo("XUnit Tester", "Universal Exports", 1)); var provider = BuildEntityKeywordBonusProvider(); // Act var result = Analyze(resume, provider); // Assert result.Score.ShouldBe(6); }
IEnumerator QueryResumeInfoCoroutine(ResumeOptionHandler handler) { if (PlayerPrefs.HasKey(NetworkingController.LastJoinedRoomPrefKey) && !PlayerPrefs.GetString(NetworkingController.LastJoinedRoomPrefKey).IsNullOrEmpty()) { handler.HandleJoinCode(PlayerPrefs.GetString(NetworkingController.LastJoinedRoomPrefKey)); yield break; } if (!PlayerPrefs.HasKey(ResumeInfoPlayerPrefKey)) { yield break; } // Hmm ideally this is done in GetWorkShopItem, but I need to make that a MonoBehaviour. #if USE_STEAMWORKS while (!SteamManager.Initialized) { yield return(null); } #endif ResumeInfo info = JsonUtility.FromJson <ResumeInfo>(PlayerPrefs.GetString(ResumeInfoPlayerPrefKey)); #if USE_STEAMWORKS if (info.steamWorkshopFileId != 0) { SteamUtil.GetWorkShopItem(info.steamWorkshopFileId, item => { if (!item.IsEmpty()) { handler.HandleWorkshopItem(item.Value); } }); yield break; } else #endif if (info.bundleId != null) { handler.HandleBundleId(info.bundleId); yield break; } else { Util.LogError($"resume pref key exists, but it didn't have valid info. Json: {PlayerPrefs.GetString(ResumeInfoPlayerPrefKey)}"); } }
/// <summary> /// Search all xml files in directory and returns info for them. /// </summary> /// <returns></returns> public IEnumerable <ResumeInfo> AllResumesInfo() { var directory = new DirectoryInfo(this.resumeDirectory); var files = directory.GetFiles(this.resumeNamePattern, SearchOption.AllDirectories); var result = new List <ResumeInfo>(); foreach (var file in files) { var resumeInfo = new ResumeInfo() { Name = file.Name.Replace(".xml", ""), ResumeId = file.Name.Replace(".xml", "") }; result.Add(resumeInfo); } return(result); }
protected AnalysisResult Analyze(ResumeInfo resume, IKeywordBonusProvider?bonusProvider = null, [CallerMemberName] string caller = "") { InitializeResultPublisherAsNeeded(); var legacyAnalyzer = new ResumeAnalyzer(); var newAnalyzer = new RewrittenAnalyzer(); bonusProvider ??= BuildBonusProvider(); IContainer container = BuildTestContainer(bonusProvider); try { return(Scientist.Science <AnalysisResult>(caller, experiment => { experiment.Use(() => legacyAnalyzer.Analyze(resume, container)); // experiment.Try(() => newAnalyzer.Analyze(resume, container)); experiment.Compare((x, y) => x.Score == y.Score); })); } catch (AggregateException agEx) // Scientist wraps exceptions into an aggregate { var opEx = agEx.InnerException; // Scientist wraps exceptions into an OperationException if (opEx?.InnerException != null) { throw opEx.InnerException; // This is the actual exception that we threw on comparing assertions } else if (opEx != null) { throw opEx; } else { throw; } } }
/// <summary> /// 插入 /// </summary> /// <param name="model"></param> /// <returns></returns> public static int Insert(ResumeInfo model) { string strSQL = "INSERT INTO Resumes(Realname,Gender,Birthday,Email,[GUID],CreateDateTime,JobId,WorkExperience,Education,[Address],Phone,Family,Degree,Major,MaritalStatus,BirthPlace) VALUES(@RealName,@Gender,@Birthday,@Email,@GUID,GETDATE(),@JobId,@WorkExperience,@Education,@Address,@Phone,@Family,@Degree,@Major,@MaritalStatus,@BirthPlace);SELECT @@IDENTITY;"; SqlParameter[] param = { new SqlParameter("Realname", SqlDbType.NVarChar), new SqlParameter("Gender", SqlDbType.NVarChar), new SqlParameter("Birthday", SqlDbType.NVarChar), new SqlParameter("Email", SqlDbType.NVarChar), new SqlParameter("GUID", SqlDbType.NVarChar), new SqlParameter("JobId", SqlDbType.Int), new SqlParameter("WorkExperience", SqlDbType.NVarChar), new SqlParameter("Education", SqlDbType.NVarChar), new SqlParameter("Address", SqlDbType.NVarChar), new SqlParameter("Phone", SqlDbType.NVarChar), new SqlParameter("Family", SqlDbType.NVarChar), new SqlParameter("Degree", SqlDbType.NVarChar), new SqlParameter("Major", SqlDbType.NVarChar), new SqlParameter("MaritalStatus", SqlDbType.NVarChar), new SqlParameter("BirthPlace", SqlDbType.NVarChar), }; param[0].Value = model.Realname ?? string.Empty; param[1].Value = model.Gender ?? "男"; param[2].Value = model.Birthday ?? "1986-01-01"; param[3].Value = model.Email ?? string.Empty; param[4].Value = model.GUID ?? Guid.NewGuid().ToString(); param[5].Value = model.JobId; param[6].Value = model.WorkExperience ?? string.Empty; param[7].Value = model.Education ?? string.Empty; param[8].Value = model.Address ?? string.Empty; param[9].Value = model.Phone ?? string.Empty; param[10].Value = model.Family ?? string.Empty; param[11].Value = model.Degree ?? string.Empty; param[12].Value = model.Major ?? string.Empty; param[13].Value = model.MaritalStatus ?? string.Empty; param[14].Value = model.BirthPlace ?? string.Empty; return(Convert.ToInt32(SQLPlus.ExecuteScalar(CommandType.Text, strSQL, param))); }
public void CustomKeywordBonusesShouldCalculateCorrectly() { // Arrange var resume = new ResumeInfo("Someone Awesome"); resume.Jobs.Add(new JobInfo("Attendee", "CODNG", 1)); var mock = new Mock <IKeywordBonusProvider>(); mock.Setup(provider => provider.LoadKeywordBonuses()) .Returns(new Dictionary <string, ResumeKeyword> { ["attendee"] = new ResumeKeyword("Attendee", 50) }); // Act var result = Analyze(resume, mock.Object); // Assert result.Score.ShouldBe(51); // 50 bonus + 1 month in job mock.Verify(provider => provider.LoadKeywordBonuses(), Times.Exactly(1)); }
public void GivenAResume() { _resume = new ResumeInfo(_bogus.Person.FullName); }