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

            using (var context = new TesisContext())
            {
                intoPrevention = context.IntoPreventions.SingleOrDefault(r => r.Id == id);
            }
            return(intoPrevention);
        }
Esempio n. 15
0
        public ICollection <IntoPrevention> GetAll()
        {
            List <IntoPrevention> intoPreventions;

            using (var context = new TesisContext())
            {
                intoPreventions = context.IntoPreventions.ToList();
            }
            return(intoPreventions);
        }
Esempio n. 16
0
        public ICollection <Right> GetAll()
        {
            List <Right> rights;

            using (var context = new TesisContext())
            {
                rights = context.Rights.ToList();
            }
            return(rights);
        }
Esempio n. 17
0
        public Impairment GetForId(int id)
        {
            Impairment imparirment;

            using (var context = new TesisContext())
            {
                imparirment = context.Impairments.SingleOrDefault(r => r.Id == id);
            }
            return(imparirment);
        }
Esempio n. 18
0
        public ICollection <Impairment> GetAll()
        {
            List <Impairment> imparirments;

            using (var context = new TesisContext())
            {
                imparirments = context.Impairments.ToList();
            }
            return(imparirments);
        }
Esempio n. 19
0
        public Role GetForId(int id)
        {
            Role role;

            using (var context = new TesisContext())
            {
                role = context.Roles.SingleOrDefault(r => r.Id == id);
            }
            return(role);
        }
Esempio n. 20
0
        public Deficiency GetForId(int id)
        {
            Deficiency deficiency;

            using (var context = new TesisContext())
            {
                deficiency = context.Deficiencis.SingleOrDefault(r => r.Id == id);
            }
            return(deficiency);
        }
Esempio n. 21
0
        public ICollection <Deficiency> GetAll()
        {
            List <Deficiency> deficiencis;

            using (var context = new TesisContext())
            {
                deficiencis = context.Deficiencis.ToList();
            }
            return(deficiencis);
        }
Esempio n. 22
0
        public Right GetForId(int id)
        {
            Right right;

            using (var context = new TesisContext())
            {
                right = context.Rights.SingleOrDefault(r => r.Id == id);
            }
            return(right);
        }
Esempio n. 23
0
        public Prevention GetForId(int id)
        {
            Prevention prevention;

            using (var context = new TesisContext())
            {
                prevention = context.Preventions.SingleOrDefault(r => r.Id == id);
            }
            return(prevention);
        }
Esempio n. 24
0
        public ICollection <Prevention> GetAll()
        {
            List <Prevention> preventions;

            using (var context = new TesisContext())
            {
                preventions = context.Preventions.ToList();
            }
            return(preventions);
        }
Esempio n. 25
0
        public ICollection <Role> GetAll()
        {
            List <Role> roles;

            using (var context = new TesisContext())
            {
                roles = context.Roles.ToList();
            }
            return(roles);
        }
Esempio n. 26
0
        public User GetForId(int id)
        {
            User user;

            using (var context = new TesisContext())
            {
                user = context.Users.SingleOrDefault(r => r.Id == id);
            }
            return(user);
        }
Esempio n. 27
0
        public ICollection <User> GetAll()
        {
            List <User> users;

            using (var context = new TesisContext())
            {
                users = context.Users.ToList();
            }
            return(users);
        }
Esempio n. 28
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();
     }
 }
Esempio n. 29
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();
     }
 }
Esempio n. 30
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();
     }
 }