Example #1
0
 public List<T_Project> GetListProject()
 {
     using (BugTrackLikeEntities bugtrack = new BugTrackLikeEntities())
     {
         List<T_Project> list = bugtrack.T_Project.ToList();
         return (list);
     }
 }
Example #2
0
 public List<T_Comment> GetListComment()
 {
     using (BugTrackLikeEntities bugtrack = new BugTrackLikeEntities())
     {
         List<T_Comment> list = bugtrack.T_Comment.ToList();
         return (list);
     }
 }
Example #3
0
 public List<T_Transaction> GetListTransaction()
 {
     using (BugTrackLikeEntities bugtrack = new BugTrackLikeEntities())
     {
         List<T_Transaction> list = bugtrack.T_Transaction.ToList();
         return (list);
     }
 }
Example #4
0
 public List<T_Bug> GetListBug()
 {
     using (BugTrackLikeEntities bugtrack = new BugTrackLikeEntities())
     {
         List<T_Bug> list = bugtrack.T_Bug.ToList();
         return (list);
     }
 }
Example #5
0
 public T_Bug GetBug(long id)
 {
     using (BugTrackLikeEntities bugtrack = new BugTrackLikeEntities())
     {
         T_Bug bug = bugtrack.T_Bug.Where(b => b.id == id).FirstOrDefault();
         return bug;
     }
 }
Example #6
0
 public List<T_User> GetListUser()
 {
     using (BugTrackLikeEntities bugtrack = new BugTrackLikeEntities())
     {
         List<T_User> list = bugtrack.T_User.ToList();
         return (list);
     }
 }
Example #7
0
        public List<T_Comment> GetListCommentbyIdBug(long idBug)
        {
            using (BugTrackLikeEntities bugtrack = new BugTrackLikeEntities())
            {
                List<T_Comment> com_List = bugtrack.T_Comment.Where(c => c.T_Bug.id == idBug).ToList();

                return (com_List);
            }
        }
Example #8
0
 public bool DeleteComment(long id)
 {
     using (BugTrackLikeEntities bugtrack = new BugTrackLikeEntities())
     {
         bugtrack.DeleteObject(bugtrack.T_Comment.Where(c => c.id == id).FirstOrDefault());
         bugtrack.SaveChanges();
         return true;
     }
 }
Example #9
0
 public bool UpdateUser(T_User user)
 {
     using (BugTrackLikeEntities bugtrack = new BugTrackLikeEntities ())
     {
         ObjectResult<T_User> us = bugtrack.UpdateUser(user.id, user.email, user.phone, user.password);
         if (us != null)
         {
             return true;
         }
         return false;
     }
 }
Example #10
0
        public bool CreateComment(T_Comment comment, long idUser, long idBug)
        {
            using (BugTrackLikeEntities bugtrack = new BugTrackLikeEntities ())
            {
                comment.T_User.id = idUser;
                comment.T_Bug.id = idBug;

                bugtrack.AddToT_Comment(comment);
                bugtrack.SaveChanges();
                return true;
            }
        }
Example #11
0
        public T_Project GetProject(long id)
        {
            using (BugTrackLikeEntities bugtrack = new BugTrackLikeEntities())
            {
                T_Project com = bugtrack.T_Project.Where(c => c.Id == id).FirstOrDefault();

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

                return null;
            }
        }
Example #12
0
        public bool DeleteTransaction(long id)
        {
            using (BugTrackLikeEntities bugtrack = new BugTrackLikeEntities())
            {
                bugtrack.DeleteObject(bugtrack.T_Transaction.Where(t => t.id == id).FirstOrDefault());
                bugtrack.SaveChanges();

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

                return (test.Count() == 0);
            }
        }
Example #13
0
        public T_Transaction GetTransaction(long id)
        {
            using (BugTrackLikeEntities bugtrack = new BugTrackLikeEntities())
            {
                T_Transaction trans = bugtrack.T_Transaction.Where(t => t.id == id).FirstOrDefault();

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

                return null;
            }
        }
Example #14
0
        public bool DeleteProject(long id)
        {
            using (BugTrackLikeEntities bugtrack = new BugTrackLikeEntities ())
            {
                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);
            }
        }
Example #15
0
        public bool CreateProject(T_Project project)
        {
            using (BugTrackLikeEntities bugtrack = new BugTrackLikeEntities())
            {

                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);
            }
        }
Example #16
0
        public List<string> getListCommentbyIdbug(long idBug)
        {
            List<string> res = new List<string>();
            using (BugTrackLikeEntities bugtrack = new BugTrackLikeEntities())
            {
                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);
            }
        }
Example #17
0
        public bool CreateBug(T_Bug bug, long idProject)
        {
            using (BugTrackLikeEntities bugtrack = new BugTrackLikeEntities())
            {
                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);
            }
        }
Example #18
0
        public bool CreateTransaction(T_Transaction transaction, long idBug, long idUser)
        {
            using (BugTrackLikeEntities bugtrack = new BugTrackLikeEntities())
            {
                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);
            }
        }
Example #19
0
        public bool DeleteUser(long id)
        {
            using ( BugTrackLikeEntities bugtrack = new BugTrackLikeEntities ())
               {
               ObjectResult<T_User> user = bugtrack.DeleteUser(id);

               if (user != null)
               {
                   return true;
               }
               else
               {
                   return false;
               }
               }
        }
Example #20
0
        public bool UpdateTransaction(T_Transaction transaction)
        {
            using (BugTrackLikeEntities bugtrack = new BugTrackLikeEntities())
            {
                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;
                }

            }
        }
Example #21
0
 public bool UpdateBug(T_Bug bug)
 {
     using (BugTrackLikeEntities bugtrack = new BugTrackLikeEntities ())
     {
         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;
         }
     }
 }
Example #22
0
        public bool DeleteBug(long id)
        {
            using (BugTrackLikeEntities bugtrack = new BugTrackLikeEntities())
            {
                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;
            }
        }
Example #23
0
        public bool UpdateProject(T_Project project)
        {
            using (BugTrackLikeEntities bugtrack = new BugTrackLikeEntities())
            {
                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;
                }

            }
        }
Example #24
0
        public bool UpdateComment(T_Comment comment)
        {
            using (BugTrackLikeEntities bugtrack = new BugTrackLikeEntities())
            {
                T_Comment com = bugtrack.T_Comment.Where(c => c.id == comment.id).FirstOrDefault();

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