Exemple #1
0
        public void DeleteById(int id)           // Delete function
        {
            TrackSkill emp = GetById(id);

            dbconn.TrackSkills.Remove(emp);
            dbconn.SaveChanges();
        }
Exemple #2
0
        public TrackSkill Add(TrackSkill emp)      // Adding Function
        {
            TrackSkill addedEmp = dbconn.TrackSkills.Add(emp);

            dbconn.SaveChanges();

            return(addedEmp);
        }
Exemple #3
0
        //// Add Skills
        public ActionResult AddSkills(int skillId, int trackId) // ID of track
        {
            var trackSkill = new TrackSkill();

            trackSkill.TrackID = trackId;
            List <Skill> skills = skillsbusinessManager.GetUnmappedSkillsByTrackId(trackId);

            if (skills.Where(s => s.ID == skillId).FirstOrDefault() != null)
            {
                trackSkill.SkillD = skillId;
                trackskillsbusinessManager.Add(trackSkill);
            }
            var trackSkills = trackskillsbusinessManager.GetByTrackID(trackId);

            return(PartialView("_trackSkills", trackSkills));
        }
Exemple #4
0
        // Adding a new skill not in the database
        public ActionResult AddNewSkill(int trackId, string skill)
        {
            var   trackSkill = new TrackSkill();
            Skill NewSkill   = new Skill();

            NewSkill.Name = skill;
            var added = skillsbusinessManager.Add(NewSkill);

            trackSkill.TrackID = trackId;
            List <Skill> skills = skillsbusinessManager.GetUnmappedSkillsByTrackId(trackId);

            if (skills.Where(j => j.ID == added.ID).FirstOrDefault() != null)
            {
                trackSkill.SkillD = added.ID;
                trackskillsbusinessManager.Add(trackSkill);
            }
            var trackSkills = trackskillsbusinessManager.GetByTrackID(trackId);

            return(PartialView("_trackSkills", trackSkills));
        }
Exemple #5
0
 public TrackSkill Update(TrackSkill emp)    // Update Function
 {
     dbconn.Entry(emp).State = EntityState.Modified;
     dbconn.SaveChanges();
     return(emp);
 }
Exemple #6
0
        public TrackSkill GetById(int id)          // Get the ID Function
        {
            TrackSkill emp = dbconn.TrackSkills.Where(e => e.ID == id).FirstOrDefault();

            return(emp);
        }
Exemple #7
0
 public TrackSkill Update(TrackSkill emp)
 {
     return(tracksskillsdatamanager.Update(emp));
 }
Exemple #8
0
 public TrackSkill Add(TrackSkill emp)
 {
     return(tracksskillsdatamanager.Add(emp));
 }