Ejemplo n.º 1
0
 public static List<T_User> GetListUser()
 {
     using (BugTrackEntities2 bugtrack = new BugTrackEntities2())
     {
         List<T_User> list = bugtrack.T_User.ToList();
         return (list);
     }
 }
Ejemplo n.º 2
0
 public List<T_Comment> GetListComment()
 {
     using (BugTrackEntities2 bugtrack = new BugTrackEntities2())
     {
         List<T_Comment> list = bugtrack.T_Comment.ToList();
         return (list);
     }
 }
Ejemplo n.º 3
0
 public List<T_Project> GetListProject()
 {
     using (BugTrackEntities2 bugtrack = new BugTrackEntities2())
     {
         List<T_Project> list = bugtrack.T_Project.ToList();
         return (list);
     }
 }
Ejemplo n.º 4
0
 public List<T_Bug> GetListBug()
 {
     using (BugTrackEntities2 bugtrack = new BugTrackEntities2())
     {
         List<T_Bug> list = bugtrack.T_Bug.ToList();
         return (list);
     }
 }
Ejemplo n.º 5
0
 public T_Bug GetBug(long id)
 {
     using (BugTrackEntities2 bugtrack = new BugTrackEntities2())
     {
         T_Bug bug = bugtrack.T_Bug.Where(b => b.id == id).FirstOrDefault();
         return bug;
     }
 }
Ejemplo n.º 6
0
 public List<T_Transaction> GetListTransaction()
 {
     using (BugTrackEntities2 bugtrack = new BugTrackEntities2())
     {
         List<T_Transaction> list = bugtrack.T_Transaction.ToList();
         return (list);
     }
 }
Ejemplo n.º 7
0
 public bool DeleteComment(long id)
 {
     using (BugTrackEntities2 bugtrack = new BugTrackEntities2())
     {
         bugtrack.DeleteObject(bugtrack.T_Comment.Where(c => c.id == id).FirstOrDefault());
         bugtrack.SaveChanges();
         return true;
     }
 }
Ejemplo n.º 8
0
        public List<T_Comment> GetListCommentbyIdBug(long idBug)
        {
            using (BugTrackEntities2 bugtrack = new BugTrackEntities2())
            {
                List<T_Comment> com_List = bugtrack.T_Comment.Where(c => c.T_Bug.id == idBug).ToList();

                return (com_List);
            }
        }
Ejemplo n.º 9
0
        public bool CreateComment(T_Comment comment, long idUser, long idBug)
        {
            using (BugTrackEntities2 bugtrack = new BugTrackEntities2())
            {
                comment.T_User.id = idUser;
                comment.T_Bug.id = idBug;

                bugtrack.AddToT_Comment(comment);
                bugtrack.SaveChanges();
                return true;
            }
        }
Ejemplo n.º 10
0
 public bool UpdateUser(T_User user)
 {
     using (BugTrackEntities2 bugtrack = new BugTrackEntities2())
     {
         ObjectResult<T_User> us = bugtrack.UpdateUser(user.id, user.name, user.firstname, user.email, user.phone, user.password);
         if (us != null)
         {
             return true;
         }
         return false;
     }
 }
Ejemplo n.º 11
0
        public T_Transaction GetTransaction(long id)
        {
            using (BugTrackEntities2 bugtrack = new BugTrackEntities2())
            {
                T_Transaction trans = bugtrack.T_Transaction.Where(t => t.id == id).FirstOrDefault();

                if (trans != null)
                {
                    return (trans);
                }

                return null;
            }
        }
Ejemplo n.º 12
0
        public bool DeleteProject(long id)
        {
            using (BugTrackEntities2 bugtrack = new BugTrackEntities2())
            {
                bugtrack.DeleteObject(bugtrack.T_Project.Where(p => p.id == id).FirstOrDefault());
                bugtrack.SaveChanges();

                var test = from b in bugtrack.T_Project
                           where b.id == id
                           select b;

                return (test.Count() == 0);
            }
        }
Ejemplo n.º 13
0
        public T_Project GetProject(long id)
        {
            using (BugTrackEntities2 bugtrack = new BugTrackEntities2())
            {
                T_Project com = bugtrack.T_Project.Where(c => c.id == id).FirstOrDefault();

                if (com != null)
                {
                    return (com);
                }

                return null;
            }
        }
Ejemplo n.º 14
0
        public List<string> getListCommentbyIdbug(long idBug)
        {
            List<string> res = new List<string>();
            using (BugTrackEntities2 bugtrack = new BugTrackEntities2())
            {
                List<T_Comment> com_List = bugtrack.T_Comment.Where(c => c.T_Bug.id == idBug).ToList();

                foreach (T_Comment item in com_List)
                {
                    res.Add(item.details);
                }

                return (res);
            }
        }
Ejemplo n.º 15
0
        public bool CreateBug(T_Bug bug, long idProject)
        {
            using (BugTrackEntities2 bugtrack = new BugTrackEntities2())
            {
                bug.T_Project.id = idProject;
                bugtrack.AddToT_Bug(bug);
                bugtrack.SaveChanges();

                var test = from b in bugtrack.T_Bug
                           where b.id == bug.id
                           select b;

                return (test.Count() > 0);
            }
        }
Ejemplo n.º 16
0
        public bool CreateProject(T_Project project)
        {
            using (BugTrackEntities2 bugtrack = new BugTrackEntities2())
            {

                bugtrack.AddToT_Project(project);
                bugtrack.SaveChanges();

                var test = from b in bugtrack.T_Project
                           where b.id == project.id
                           select b;

                return (test.Count() > 0);
            }
        }
Ejemplo n.º 17
0
        public bool DeleteUser(long id)
        {
            using (BugTrackEntities2 bugtrack = new BugTrackEntities2())
            {
                ObjectResult<T_User> user = bugtrack.DeleteUser(id);

                if (user != null)
                {
                    return true;
                }
                else
                {
                    return false;
                }
            }
        }
Ejemplo n.º 18
0
        public bool CreateTransaction(T_Transaction transaction, long idBug, long idUser)
        {
            using (BugTrackEntities2 bugtrack = new BugTrackEntities2())
            {
                transaction.T_Bug.id = idBug;
                transaction.T_User.id = idUser;
                bugtrack.AddToT_Transaction(transaction);
                bugtrack.SaveChanges();

                var test = from b in bugtrack.T_Transaction
                           where b.id == transaction.id
                           select b;

                return (test.Count() > 0);
            }
        }
Ejemplo n.º 19
0
        public bool UpdateProject(T_Project project)
        {
            using (BugTrackEntities2 bugtrack = new BugTrackEntities2())
            {
                T_Project proj = bugtrack.T_Project.Where(p => p.id == project.id).FirstOrDefault();

                if (proj != null)
                {
                    proj = project;
                    bugtrack.SaveChanges();
                    return true;
                }
                else
                {
                    return false;
                }

            }
        }
Ejemplo n.º 20
0
 public bool UpdateBug(T_Bug bug)
 {
     using (BugTrackEntities2 bugtrack = new BugTrackEntities2())
     {
         T_Bug b = bugtrack.T_Bug.Where(r => r.id == bug.id).FirstOrDefault();
         if (b != null)
         {
             b.title = bug.title;
             b.T_Project.id = bug.T_Project.id;
             b.CreateDate = bug.CreateDate;
             bugtrack.SaveChanges();
             return true;
         }
         else
         {
             return false;
         }
     }
 }
Ejemplo n.º 21
0
        public bool DeleteBug(long id)
        {
            using (BugTrackEntities2 bugtrack = new BugTrackEntities2())
            {
                var bug = from b in bugtrack.T_Bug
                          where b.id == id
                          select b;
                var res = bug.FirstOrDefault();

                if (res != null)
                {
                    bugtrack.DeleteObject(res);
                    bugtrack.SaveChanges();
                    return true;
                }
                else
                    return false;
            }
        }
Ejemplo n.º 22
0
        public bool UpdateTransaction(T_Transaction transaction)
        {
            using (BugTrackEntities2 bugtrack = new BugTrackEntities2())
            {
                T_Transaction trans = bugtrack.T_Transaction.Where(t => t.id == transaction.id).FirstOrDefault();

                if (trans != null)
                {
                    trans = transaction;
                    bugtrack.SaveChanges();
                    return true;
                }
                else
                {
                    return false;
                }

            }
        }
Ejemplo n.º 23
0
        public bool UpdateComment(T_Comment comment)
        {
            using (BugTrackEntities2 bugtrack = new BugTrackEntities2())
            {
                T_Comment com = bugtrack.T_Comment.Where(c => c.id == comment.id).FirstOrDefault();

                if (com != null)
                {
                    com = comment;
                }
                bugtrack.SaveChanges();
                return true;
            }
        }