public void Create(Impairment imparirment) { using (var context = new TesisContext()) { context.Impairments.Add(imparirment); context.SaveChanges(); } }
public void Create(Role role) { using (var context = new TesisContext()) { context.Roles.Add(role); context.SaveChanges(); } }
public void Create(IntoPrevention intoPrevention) { using (var context = new TesisContext()) { context.IntoPreventions.Add(intoPrevention); context.SaveChanges(); } }
public void Create(User user) { using (var context = new TesisContext()) { context.Users.Add(user); context.SaveChanges(); } }
public void Create(Right right) { using (var context = new TesisContext()) { context.Rights.Add(right); context.SaveChanges(); } }
public void Create(Prevention prevention) { using (var context = new TesisContext()) { context.Preventions.Add(prevention); context.SaveChanges(); } }
public void Create(Deficiency deficiency) { using (var context = new TesisContext()) { context.Deficiencys.Add(deficiency); context.SaveChanges(); } }
public void Delete(Right right) { using (var context = new TesisContext()) { var rightDelete = context.Rights.SingleOrDefault(r => r.Id == right.Id); context.Rights.Remove(rightDelete); context.SaveChanges(); } }
public void Delete(Prevention prevention) { using (var context = new TesisContext()) { var preventionDelete = context.Preventions.SingleOrDefault(r => r.Id == prevention.Id); context.Preventions.Remove(preventionDelete); context.SaveChanges(); } }
public void Delete(User user) { using (var context = new TesisContext()) { var userDelete = context.Users.SingleOrDefault(r => r.Id == user.Id); context.Users.Remove(userDelete); context.SaveChanges(); } }
public void Delete(Deficiency deficiency) { using (var context = new TesisContext()) { var deficiencyDelete = context.Deficiencis.SingleOrDefault(r => r.Id == deficiency.Id); context.Deficiencis.Remove(deficiencyDelete); context.SaveChanges(); } }
public void Delete(Impairment imparirment) { using (var context = new TesisContext()) { var imparirmentDelete = context.Impairments.SingleOrDefault(r => r.Id == imparirment.Id); context.Impairments.Remove(imparirmentDelete); context.SaveChanges(); } }
public void Delete(Role role) { using (var context = new TesisContext()) { var roleDelete = context.Roles.SingleOrDefault(r => r.Id == role.Id); context.Roles.Remove(roleDelete); context.SaveChanges(); } }
public IntoPrevention GetForId(int id) { IntoPrevention intoPrevention; using (var context = new TesisContext()) { intoPrevention = context.IntoPreventions.SingleOrDefault(r => r.Id == id); } return(intoPrevention); }
public ICollection <IntoPrevention> GetAll() { List <IntoPrevention> intoPreventions; using (var context = new TesisContext()) { intoPreventions = context.IntoPreventions.ToList(); } return(intoPreventions); }
public ICollection <Right> GetAll() { List <Right> rights; using (var context = new TesisContext()) { rights = context.Rights.ToList(); } return(rights); }
public Impairment GetForId(int id) { Impairment imparirment; using (var context = new TesisContext()) { imparirment = context.Impairments.SingleOrDefault(r => r.Id == id); } return(imparirment); }
public ICollection <Impairment> GetAll() { List <Impairment> imparirments; using (var context = new TesisContext()) { imparirments = context.Impairments.ToList(); } return(imparirments); }
public Role GetForId(int id) { Role role; using (var context = new TesisContext()) { role = context.Roles.SingleOrDefault(r => r.Id == id); } return(role); }
public Deficiency GetForId(int id) { Deficiency deficiency; using (var context = new TesisContext()) { deficiency = context.Deficiencis.SingleOrDefault(r => r.Id == id); } return(deficiency); }
public ICollection <Deficiency> GetAll() { List <Deficiency> deficiencis; using (var context = new TesisContext()) { deficiencis = context.Deficiencis.ToList(); } return(deficiencis); }
public Right GetForId(int id) { Right right; using (var context = new TesisContext()) { right = context.Rights.SingleOrDefault(r => r.Id == id); } return(right); }
public Prevention GetForId(int id) { Prevention prevention; using (var context = new TesisContext()) { prevention = context.Preventions.SingleOrDefault(r => r.Id == id); } return(prevention); }
public ICollection <Prevention> GetAll() { List <Prevention> preventions; using (var context = new TesisContext()) { preventions = context.Preventions.ToList(); } return(preventions); }
public ICollection <Role> GetAll() { List <Role> roles; using (var context = new TesisContext()) { roles = context.Roles.ToList(); } return(roles); }
public User GetForId(int id) { User user; using (var context = new TesisContext()) { user = context.Users.SingleOrDefault(r => r.Id == id); } return(user); }
public ICollection <User> GetAll() { List <User> users; using (var context = new TesisContext()) { users = context.Users.ToList(); } return(users); }
public void Update(Role role) { using (var context = new TesisContext()) { var roletUpdate = context.Roles.SingleOrDefault(r => r.Id == role.Id); if (roletUpdate != null) { roletUpdate.Name = role.Name; } context.SaveChanges(); } }
public void Update(Deficiency deficiency) { using (var context = new TesisContext()) { var deficiencyUpdate = context.Deficiencys.SingleOrDefault(r => r.Id == deficiency.Id); if (deficiencyUpdate != null) { deficiencyUpdate.Kind = deficiency.Kind; deficiencyUpdate.Name = deficiency.Name; deficiencyUpdate.Description = deficiency.Description; } context.SaveChanges(); } }
public void Update(Right right) { using (var context = new TesisContext()) { var rightUpdate = context.Rights.SingleOrDefault(r => r.Id == right.Id); if (rightUpdate != null) { rightUpdate.Title = right.Title; rightUpdate.Description = right.Description; rightUpdate.FilePdf = right.FilePdf; } context.SaveChanges(); } }