示例#1
0
文件: Project.cs 项目: yoan-durand/TP
 public List<T_Project> GetListProject()
 {
     using (BugTrackLikeEntities bugtrack = new BugTrackLikeEntities())
     {
         List<T_Project> list = bugtrack.T_Project.ToList();
         return (list);
     }
 }
示例#2
0
文件: Comment.cs 项目: yoan-durand/TP
 public List<T_Comment> GetListComment()
 {
     using (BugTrackLikeEntities bugtrack = new BugTrackLikeEntities())
     {
         List<T_Comment> list = bugtrack.T_Comment.ToList();
         return (list);
     }
 }
示例#3
0
 public List<T_Transaction> GetListTransaction()
 {
     using (BugTrackLikeEntities bugtrack = new BugTrackLikeEntities())
     {
         List<T_Transaction> list = bugtrack.T_Transaction.ToList();
         return (list);
     }
 }
示例#4
0
文件: Bug.cs 项目: yoan-durand/TP
 public List<T_Bug> GetListBug()
 {
     using (BugTrackLikeEntities bugtrack = new BugTrackLikeEntities())
     {
         List<T_Bug> list = bugtrack.T_Bug.ToList();
         return (list);
     }
 }
示例#5
0
文件: Bug.cs 项目: yoan-durand/TP
 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;
     }
 }
示例#6
0
文件: User.cs 项目: yoan-durand/TP
 public List<T_User> GetListUser()
 {
     using (BugTrackLikeEntities bugtrack = new BugTrackLikeEntities())
     {
         List<T_User> list = bugtrack.T_User.ToList();
         return (list);
     }
 }
示例#7
0
文件: Comment.cs 项目: yoan-durand/TP
        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);
            }
        }
示例#8
0
文件: Comment.cs 项目: yoan-durand/TP
 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;
     }
 }
示例#9
0
文件: User.cs 项目: yoan-durand/TP
 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;
     }
 }
示例#10
0
文件: Comment.cs 项目: yoan-durand/TP
        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;
            }
        }
示例#11
0
文件: Project.cs 项目: yoan-durand/TP
        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;
            }
        }
示例#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);
            }
        }
示例#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;
            }
        }
示例#14
0
文件: Project.cs 项目: yoan-durand/TP
        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);
            }
        }
示例#15
0
文件: Project.cs 项目: yoan-durand/TP
        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);
            }
        }
示例#16
0
文件: Comment.cs 项目: yoan-durand/TP
        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);
            }
        }
示例#17
0
文件: Bug.cs 项目: yoan-durand/TP
        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);
            }
        }
示例#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);
            }
        }
示例#19
0
文件: User.cs 项目: yoan-durand/TP
        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;
               }
               }
        }
示例#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;
                }

            }
        }
示例#21
0
文件: Bug.cs 项目: yoan-durand/TP
 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;
         }
     }
 }
示例#22
0
文件: Bug.cs 项目: yoan-durand/TP
        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;
            }
        }
示例#23
0
文件: Project.cs 项目: yoan-durand/TP
        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;
                }

            }
        }
示例#24
0
文件: Comment.cs 项目: yoan-durand/TP
        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;
            }
        }