Example #1
0
 public User GetUser()
 {
     foreach (UserProject pr in projects)
     {
         string   temp = Regex.Replace(pr.Environment, ",(?=[^()]*\\))", "|");
         string[] buff = Regex.Split(temp, ", ");
         foreach (string s in buff)
         {
             string buffer = s.Replace("|", ",");
             var    skill  = new SkillInProject {
                 exactName = buffer
             };
             PrivateDictionary.FindSkill(skill);
             pr.skills.Add(skill);
         }
     }
     return(this);
 }
Example #2
0
        public UpdateDefinition <BsonDocument> GetUserBson()
        {
            foreach (UserProject pr in projects)
            {
                string   temp = Regex.Replace(pr.Environment, ",(?=[^()]*\\))", "|");
                string[] buff = Regex.Split(temp, ", ");
                foreach (string s in buff)
                {
                    string buffer = s.Replace("|", ",");
                    var    skill  = new SkillInProject {
                        exactName = buffer
                    };
                    PrivateDictionary.FindSkill(skill);
                    pr.skills.Add(skill);
                }
            }
            var update = Builders <BsonDocument> .Update.Set("firstname", fname);

            var up = new BsonDocument
            {
                { "firstname", fname },
                { "middlename", mname },
                { "lastname", lname },
                { "passport", new BsonDocument {
                      { "givenNames", passport[0] },
                      { "surname", passport[1] }
                  } },
                { "startWorkingDay", startWork },
                { "officeRoomNumber", room },
                { "officeAddress", adress },
                { "sphere", new BsonDocument {
                      { "name", sphere }
                  } },
                { "division", new BsonDocument {
                      { "name", division }
                  } },
                { "department", new BsonDocument {
                      { "name", department }
                  } },
                { "sector", new BsonDocument {
                      { "name", sector }
                  } },
                { "company", new BsonDocument {
                      { "name", company }
                  } },
                { "position", position },
                { "email", email },
                { "skills", GetSkills() },
                { "universities", GetUniversities() },
                { "phones", GetPhones() },
                { "vacation", new BsonDocument {
                      { "start_date", vacation[0] }, { "end_date", vacation[1] }
                  } },
                { "resumeParserError", error == null ? new BsonArray(0) : new BsonArray(error) },
                { "resumeLastUpdated", lUploaded },
                { "resumeLastParsed", lParsed },
                { "resumeParsedSource", sParse },
                { "academicDegrees", GetDegrees() },
                { "foreignLanguages", GetForLangs() },
                { "exams", new BsonArray(exams) },
                { "educations", new BsonArray(educations) },
                { "birthDay", birthDay },
                { "projects", GetProj() },
            };

            foreach (var item in up)
            {
                update = update.Set(item.Name, item.Value);
            }
            return(update);
        }