Beispiel #1
0
        public List <Project> GetAllProjects()
        {
            ProjectTrackingDbcontext db = new ProjectTrackingDbcontext();


            return(db.Projects.Select(pro => pro).ToList());
        }
Beispiel #2
0
        // GET: api/projecttask
        public IEnumerable <projecttask> Get()
        {
            ProjectTrackingDbcontext db = new ProjectTrackingDbcontext();

            return(db.Projecttasks.Select(t => t).ToList());
            //return new string[] { "value1", "value2" };
        }
        // POST: api/Userstory
        public void Post(Userstory value)
        {
            ProjectTrackingDbcontext db = new ProjectTrackingDbcontext();

            db.Userstories.Add(value);
            db.SaveChanges();
        }
Beispiel #4
0
        public static void Delete(managercomments comment)
        {
            ProjectTrackingDbcontext db = new ProjectTrackingDbcontext();

            db.Managercomments.Remove(comment);
            db.SaveChanges();
        }
        public Userstory searchbyid(Userstory u)
        {
            ProjectTrackingDbcontext db = new ProjectTrackingDbcontext();


            return((Userstory)db.Userstories.Where(story => story.userstory_id == u.userstory_id));
        }
Beispiel #6
0
        // GET: api/projecttask/5
        public projecttask Get(int id)
        {
            ProjectTrackingDbcontext db = new ProjectTrackingDbcontext();

            return(db.Projecttasks.Where(pro => pro.projecttask_id == id).FirstOrDefault());
            //return "value";
        }
Beispiel #7
0
        public static void Create(managercomments comment)
        {
            ProjectTrackingDbcontext db = new ProjectTrackingDbcontext();

            db.Managercomments.Add(comment);
            db.SaveChanges();
        }
Beispiel #8
0
        public Employee searchbyname(Employee e)
        {
            ProjectTrackingDbcontext db = new ProjectTrackingDbcontext();


            return(db.Employees.Where(emp => emp.employee_name == e.employee_name).FirstOrDefault());
        }
Beispiel #9
0
        public Project searchbyname(Project p)
        {
            ProjectTrackingDbcontext db = new ProjectTrackingDbcontext();


            return((Project)db.Projects.Where(Pro => Pro.project_name == p.project_name).FirstOrDefault());
        }
Beispiel #10
0
        public List <Employee> GetAllEmployees()
        {
            ProjectTrackingDbcontext db = new ProjectTrackingDbcontext();


            return(db.Employees.Select(emp => emp).ToList());
        }
Beispiel #11
0
        // POST: api/Employee
        public void Post(Employee value)
        {
            ProjectTrackingDbcontext db = new ProjectTrackingDbcontext();

            db.Employees.Add(value);
            db.SaveChanges();
        }
Beispiel #12
0
        // POST: api/Project
        public void Post(Project value)
        {
            ProjectTrackingDbcontext db = new ProjectTrackingDbcontext();

            db.Projects.Add(value);
            db.SaveChanges();
        }
            public projecttask searchbyid(projecttask t)
            {
                ProjectTrackingDbcontext db = new ProjectTrackingDbcontext();


                return((projecttask)db.Projecttasks.Where(ta => ta.projecttask_id == t.projecttask_id));
            }
Beispiel #14
0
        public void CreateNewProject(Project P)
        {
            ProjectTrackingDbcontext db = new ProjectTrackingDbcontext();


            db.Projects.Add(P);
            db.SaveChanges();
        }
        // GET: api/ManagerComment/5
        public managercomments Get(int id)
        {
            ProjectTrackingDbcontext db      = new ProjectTrackingDbcontext();
            managercomments          comment = new managercomments();

            comment.managercomment_id = id;
            return(CommentsRepository.Search(comment, db));
        }
Beispiel #16
0
        public Employee searchbyid(Employee e, ProjectTrackingDbcontext db)
        {
            //ProjectTrackingDbcontext db = new ProjectTrackingDbcontext();



            return(db.Employees.Where(emp => emp.employee_id == e.employee_id).FirstOrDefault());
        }
        public void CreateNewUserstory(Userstory u)
        {
            ProjectTrackingDbcontext db = new ProjectTrackingDbcontext();


            db.Userstories.Add(u);
            db.SaveChanges();
        }
            public void CreateNewTask(projecttask t)
            {
                ProjectTrackingDbcontext db = new ProjectTrackingDbcontext();


                db.Projecttasks.Add(t);
                db.SaveChanges();
            }
        // DELETE: api/ManagerComment/5
        public void Delete(int id)
        {
            ProjectTrackingDbcontext db  = new ProjectTrackingDbcontext();
            managercomments          com = db.Managercomments.Where(c => c.managercomment_id == id).FirstOrDefault();

            db.Managercomments.Remove(com);
            db.SaveChanges();
        }
Beispiel #20
0
        public void CreateNewEmployee(Employee e)
        {
            ProjectTrackingDbcontext db = new ProjectTrackingDbcontext();


            db.Employees.Add(e);
            db.SaveChanges();
        }
Beispiel #21
0
        // DELETE: api/projecttask/5
        public void Delete(int id)
        {
            ProjectTrackingDbcontext db = new ProjectTrackingDbcontext();
            projecttask t1 = db.Projecttasks.Where(ta => ta.projecttask_id == id).FirstOrDefault();

            db.Projecttasks.Remove(t1);
            db.SaveChanges();
        }
Beispiel #22
0
        // GET: api/Project
        public IEnumerable <Project> Get()
        {
            ProjectTrackingDbcontext db = new ProjectTrackingDbcontext();


            return(db.Projects.ToList());
            //return new string[] { "value1", "value2" };
        }
Beispiel #23
0
        // DELETE: api/Employee/5
        public void Delete(int id)
        {
            ProjectTrackingDbcontext db = new ProjectTrackingDbcontext();

            Employee emp = db.Employees.Where(em => em.employee_id == id).FirstOrDefault();

            db.Employees.Remove(emp);
            db.SaveChanges();
        }
        // DELETE: api/Userstory/5
        public void Delete(int id)
        {
            ProjectTrackingDbcontext db = new ProjectTrackingDbcontext();

            Userstory user = db.Userstories.Where(u => u.userstory_id == id).FirstOrDefault();

            db.Userstories.Remove(user);
            db.SaveChanges();
        }
Beispiel #25
0
        public static void Edit(managercomments comment)
        {
            ProjectTrackingDbcontext db = new ProjectTrackingDbcontext();
            managercomments          c  = Search(comment, db);

            c.comments       = comment.comments;
            c.projecttask_id = comment.projecttask_id;
            db.SaveChanges();
        }
Beispiel #26
0
        // DELETE: api/Project/5
        public void Delete(int id)
        {
            ProjectTrackingDbcontext db = new ProjectTrackingDbcontext();

            Project pro = db.Projects.Where(p => p.project_id == id).FirstOrDefault();

            db.Projects.Remove(pro);
            db.SaveChanges();
        }
Beispiel #27
0
        public void DeleteProject(Project p)
        {
            ProjectTrackingDbcontext db = new ProjectTrackingDbcontext();

            Project pro = db.Projects.Where(pr => pr.project_id == p.project_id).FirstOrDefault();

            db.Projects.Remove(p);
            db.SaveChanges();
        }
        public void DeleteEmployee(Userstory u)
        {
            ProjectTrackingDbcontext db = new ProjectTrackingDbcontext();


            Userstory user = db.Userstories.Where(story => story.userstory_id == u.userstory_id).FirstOrDefault();

            db.Userstories.Remove(u);
            db.SaveChanges();
        }
        public void Edit(Userstory u)
        {
            ProjectTrackingDbcontext db = new ProjectTrackingDbcontext();

            Userstory u1 = searchbyid(u);

            u.story = u1.story;

            db.SaveChanges();
        }
            public void Edit(projecttask t)
            {
                ProjectTrackingDbcontext db = new ProjectTrackingDbcontext();

                projecttask t2 = searchbyid(t);

                t.projecttask_id = t2.projecttask_id;
                t.taskstartdate  = t2.taskstartdate;
                t.taskenddate    = t2.taskenddate;
                t.taskcompletion = t2.taskcompletion;
                db.SaveChanges();
            }