Exemplo n.º 1
0
 public void Create(Prevention prevention)
 {
     using (var context = new TesisContext())
     {
         context.Preventions.Add(prevention);
         context.SaveChanges();
     }
 }
Exemplo n.º 2
0
 public void Create(IntoPrevention intoPrevention)
 {
     using (var context = new TesisContext())
     {
         context.IntoPreventions.Add(intoPrevention);
         context.SaveChanges();
     }
 }
Exemplo n.º 3
0
 public void Create(Role role)
 {
     using (var context = new TesisContext())
     {
         context.Roles.Add(role);
         context.SaveChanges();
     }
 }
Exemplo n.º 4
0
 public void Create(Deficiency deficiency)
 {
     using (var context = new TesisContext())
     {
         context.Deficiencys.Add(deficiency);
         context.SaveChanges();
     }
 }
Exemplo n.º 5
0
 public void Create(Right right)
 {
     using (var context = new TesisContext())
     {
         context.Rights.Add(right);
         context.SaveChanges();
     }
 }
Exemplo n.º 6
0
 public void Create(User user)
 {
     using (var context = new TesisContext())
     {
         context.Users.Add(user);
         context.SaveChanges();
     }
 }
Exemplo n.º 7
0
 public void Create(Impairment imparirment)
 {
     using (var context = new TesisContext())
     {
         context.Impairments.Add(imparirment);
         context.SaveChanges();
     }
 }
Exemplo n.º 8
0
 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();
     }
 }
Exemplo n.º 9
0
 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();
     }
 }
Exemplo n.º 10
0
 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();
     }
 }
Exemplo n.º 11
0
 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();
     }
 }
Exemplo n.º 12
0
 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();
     }
 }
Exemplo n.º 13
0
 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();
     }
 }
Exemplo n.º 14
0
 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();
     }
 }
Exemplo n.º 15
0
 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();
     }
 }
Exemplo n.º 16
0
 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();
     }
 }
Exemplo n.º 17
0
 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();
     }
 }
Exemplo n.º 18
0
 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();
     }
 }
Exemplo n.º 19
0
 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();
     }
 }
Exemplo n.º 20
0
 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();
     }
 }
Exemplo n.º 21
0
 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();
     }
 }
Exemplo n.º 22
0
 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();
     }
 }