public void Create(Prevention prevention) { using (var context = new TesisContext()) { context.Preventions.Add(prevention); context.SaveChanges(); } }
public void Create(IntoPrevention intoPrevention) { using (var context = new TesisContext()) { context.IntoPreventions.Add(intoPrevention); context.SaveChanges(); } }
public void Create(Role role) { using (var context = new TesisContext()) { context.Roles.Add(role); context.SaveChanges(); } }
public void Create(Deficiency deficiency) { using (var context = new TesisContext()) { context.Deficiencys.Add(deficiency); context.SaveChanges(); } }
public void Create(Right right) { using (var context = new TesisContext()) { context.Rights.Add(right); context.SaveChanges(); } }
public void Create(User user) { using (var context = new TesisContext()) { context.Users.Add(user); context.SaveChanges(); } }
public void Create(Impairment imparirment) { using (var context = new TesisContext()) { context.Impairments.Add(imparirment); 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(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(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(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(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(Role role) { using (var context = new TesisContext()) { var roleDelete = context.Roles.SingleOrDefault(r => r.Id == role.Id); context.Roles.Remove(roleDelete); context.SaveChanges(); } }
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(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(); } }
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(Prevention prevention) { using (var context = new TesisContext()) { var preventionUpdate = context.Preventions.SingleOrDefault(r => r.Id == prevention.Id); if (preventionUpdate != null) { preventionUpdate.Kind = prevention.Kind; preventionUpdate.Name = prevention.Name; preventionUpdate.Description = prevention.Description; preventionUpdate.VisitCount = prevention.VisitCount; } context.SaveChanges(); } }
public void Update(Impairment imparirment) { using (var context = new TesisContext()) { var imparirmentUpdate = context.Impairments.SingleOrDefault(r => r.Id == imparirment.Id); if (imparirmentUpdate != null) { imparirmentUpdate.Kind = imparirment.Kind; imparirmentUpdate.Name = imparirment.Name; imparirmentUpdate.Description = imparirment.Description; imparirmentUpdate.VisitCount = imparirment.VisitCount; } context.SaveChanges(); } }
public void Update(Impairment imparirment) { using (var context = new TesisContext()) { var imparirmentUpdate = context.Impairments.SingleOrDefault(r => r.Id == imparirment.Id); if (imparirmentUpdate != null) { imparirmentUpdate.Kind = imparirment.Kind; imparirmentUpdate.Name = imparirment.Name; imparirmentUpdate.Introduction = imparirment.Introduction; imparirmentUpdate.Symptom = imparirment.Symptom; imparirmentUpdate.Prevention = imparirment.Prevention; } context.SaveChanges(); } }
public void Update(IntoPrevention intoPrevention) { using (var context = new TesisContext()) { var intoPreventionUpdate = context.IntoPreventions.SingleOrDefault(r => r.Id == intoPrevention.Id); if (intoPreventionUpdate != null) { intoPreventionUpdate.PreventionId = intoPrevention.PreventionId; intoPreventionUpdate.Kind = intoPrevention.Kind; intoPreventionUpdate.Title = intoPrevention.Title; intoPreventionUpdate.Description = intoPrevention.Description; intoPreventionUpdate.Prevention = intoPrevention.Prevention; } context.SaveChanges(); } }
public void Update(Deficiency deficiency) { using (var context = new TesisContext()) { var deficiencyUpdate = context.Deficiencis.SingleOrDefault(r => r.Id == deficiency.Id); if (deficiencyUpdate != null) { deficiencyUpdate.ImpairmentId = deficiency.ImpairmentId; deficiencyUpdate.Kind = deficiency.Kind; deficiencyUpdate.Name = deficiency.Name; deficiencyUpdate.Introduction = deficiency.Introduction; deficiencyUpdate.Symptom = deficiency.Symptom; deficiencyUpdate.Prevention = deficiency.Prevention; } context.SaveChanges(); } }
public void Update(User user) { using (var context = new TesisContext()) { var userUpdate = context.Users.SingleOrDefault(r => r.Id == user.Id); if (userUpdate != null) { userUpdate.FirstName = user.FirstName; userUpdate.SecondName = user.SecondName; userUpdate.LastName = user.LastName; userUpdate.Telefono = user.Telefono; userUpdate.Email = user.Email; userUpdate.Ci = user.Ci; } context.SaveChanges(); } }