public static List<T_User> GetListUser() { using (BugTrackEntities2 bugtrack = new BugTrackEntities2()) { List<T_User> list = bugtrack.T_User.ToList(); return (list); } }
public List<T_Comment> GetListComment() { using (BugTrackEntities2 bugtrack = new BugTrackEntities2()) { List<T_Comment> list = bugtrack.T_Comment.ToList(); return (list); } }
public List<T_Project> GetListProject() { using (BugTrackEntities2 bugtrack = new BugTrackEntities2()) { List<T_Project> list = bugtrack.T_Project.ToList(); return (list); } }
public List<T_Bug> GetListBug() { using (BugTrackEntities2 bugtrack = new BugTrackEntities2()) { List<T_Bug> list = bugtrack.T_Bug.ToList(); return (list); } }
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; } }
public List<T_Transaction> GetListTransaction() { using (BugTrackEntities2 bugtrack = new BugTrackEntities2()) { List<T_Transaction> list = bugtrack.T_Transaction.ToList(); return (list); } }
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; } }
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); } }
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; } }
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; } }
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; } }
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); } }
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; } }
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); } }
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); } }
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); } }
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; } } }
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); } }
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; } } }
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; } } }
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; } }
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; } } }
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; } }