public int AddTech(SkillDtl newEntry) { try { db.SkillDtls.Add(newEntry); db.SaveChanges(); return(1); } catch (DbEntityValidationException e) { foreach (var eve in e.EntityValidationErrors) { Console.WriteLine("Entity of type \"{0}\" in state \"{1}\" has the following validation errors:", eve.Entry.Entity.GetType().Name, eve.Entry.State); foreach (var ve in eve.ValidationErrors) { Console.WriteLine("- Property: \"{0}\", Value: \"{1}\", Error: \"{2}\"", ve.PropertyName, eve.Entry.CurrentValues.GetValue <object>(ve.PropertyName), ve.ErrorMessage); } } throw; } }
public void Delete() { user.DeleteSkills(30); SkillDtl user2 = user.skillById1(30); Assert.IsNull(user2); }
public UserInfo AddNewSkill(SkillDtl skillDtl) { try { string message = null; SkillDtl duplicateCheck = data.SkillDtls.SingleOrDefault(x => x.name == skillDtl.name); if (duplicateCheck == null) { data.SkillDtls.Add(skillDtl); data.SaveChanges(); message = "added successfully"; } else { message = "Already exists in data"; } return(new UserInfo() { message = message }); } catch { throw; } }
public void getSkillById() { user user = new user(); SkillDtl p = user.getSkillById(1); Assert.IsNotNull(p); }
public int DeleteSkills(int id) { SkillDtl emp = db.SkillDtls.Find(id); db.SkillDtls.Remove(emp); db.SaveChanges(); return(1); }
public void delete() { user user = new user(); user.DeleteSkillById(1); SkillDtl sk = user.getSkillById(1); Assert.IsTrue(sk == null); }
public void Delete() { UL user = new UL(); user.DeleteEmployee(3); SkillDtl user2 = user.skillById1(3); Assert.IsNull(user2); }
public void AddNewSkill(SkillDtl skillDtl) { try { data.SkillDtls.Add(skillDtl); data.SaveChanges(); } catch { throw; } }
public void saveSkill(SkillDtl skill) { try { db.SkillDtls.Add(skill); db.SaveChanges(); } catch { throw; } }
public void EditSkill(SkillDtl skillDtl) { try { data.Entry(skillDtl).State = EntityState.Modified; data.Configuration.ValidateOnSaveEnabled = false; data.SaveChanges(); data.Configuration.ValidateOnSaveEnabled = true; } catch { throw; } }
public int DeleteEmployee(int id) { try { SkillDtl emp = db.SkillDtls.Find(id); db.SkillDtls.Remove(emp); db.SaveChanges(); return(1); } catch { throw; } }
public void updateskill(SkillDtl skill) { try { SkillDtl skillDtl = data.SkillDtls.Find(skill.id); skillDtl.toc = skill.toc; skillDtl.prerequisites = skill.prerequisites; skillDtl.fees = skill.fees; data.Entry(skillDtl).State = EntityState.Modified; data.Configuration.ValidateOnSaveEnabled = false; data.SaveChanges(); data.Configuration.ValidateOnSaveEnabled = true; } catch { throw; } }
public int UpdateSkills(int id, SkillDtl skill) { SkillDtl emp = db.SkillDtls.Find(id); if (emp != null) { try { emp.name = skill.name; emp.toc = skill.toc; emp.prerequisites = skill.prerequisites; emp.fees = skill.fees; db.SaveChanges(); } catch { throw; } } return(1); }
public IHttpActionResult editSkillById(int id, SkillDtl skill) { ctrl.editSkillById(id, skill); return(Ok("updated")); }
public IHttpActionResult saveSkill(SkillDtl skill) { ctrl.saveSkill(skill); return(Ok("Technology Added")); }
public IHttpActionResult AddSkill(SkillDtl skillDtl) { userLogic.AddNewSkill(skillDtl); return(Ok("Request Sent")); }
public int EditSkill(int id, SkillDtl skill) { return(userlogic.UpdateSkills(id, skill)); }
public int AddTechnology(SkillDtl details) { return(userlogic.AddTech(details)); }
public IHttpActionResult updateskill(SkillDtl skill) { userLogic.updateskill(skill); return(Ok("Updated Sucessfully")); }
public IHttpActionResult AddSkill(SkillDtl skillDtl) { var result = userLogic.AddNewSkill(skillDtl); return(Ok(result)); }