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

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

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

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

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

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

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

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

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

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

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

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

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

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

            using (var context = new TesisContext())
            {
                users = context.Users.ToList();
            }
            return(users);
        }
예제 #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();
     }
 }
예제 #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();
     }
 }
예제 #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();
     }
 }