示例#1
0
        public void SaveSkill(SkillsEvaluation skillEvaluation)
        {
            try
            {
                using (var db = new DatabaseContainer())
                {
                    db.SkillsEvaluations.Where(x => x.Id == skillEvaluation.Id).First().Mark = skillEvaluation.Mark;

                    db.SaveChanges();
                }
            }
            catch (Exception e)
            {
            }
        }
示例#2
0
        public long AddSkill(Candidate candidate, SkillsEvaluation skillEvaluation, string skillName)
        {
            try
            {
                using (var db = new DatabaseContainer())
                {
                    skillEvaluation.Skill        = db.Skills.Where(x => x.Name == skillName).First();
                    skillEvaluation.Mark         = skillEvaluation.Mark;
                    skillEvaluation.EvaluationId = candidate.Evaluation.Id;

                    db.Entry(skillEvaluation).State       = System.Data.Entity.EntityState.Added;
                    db.Entry(skillEvaluation.Skill).State = System.Data.Entity.EntityState.Unchanged;
                    db.SaveChanges();
                }
            }
            catch (Exception e)
            {
            }

            return(skillEvaluation.Id);
        }