Ejemplo n.º 1
0
        public static void CreateNewEmployee(Employee Emp)
        {
            EmpDBContext db = new EmpDBContext();

            db.Employees.Add(Emp);
            db.SaveChanges();
        }
Ejemplo n.º 2
0
        public static Userstories SearchUserById(Userstories p, EmpDBContext db)

        {
            Userstories z = (db.userstories.Where(e => e.userstoryid == p.userstoryid)).First();

            return(z);
        }
Ejemplo n.º 3
0
        public static void CreateNewUserstories(Userstories userstory)
        {
            EmpDBContext db = new EmpDBContext();

            db.userstories.Add(userstory);
            db.SaveChanges();
        }
Ejemplo n.º 4
0
        public static Project SearchProjectsById(Project p, EmpDBContext db)

        {
            Project z = (db.Project.Where(e => e.proid == p.proid)).First();

            return(z);
        }
        public static void Delete(ManagerComment comment)
        {
            EmpDBContext db = new EmpDBContext();

            db.ManagerComments.Remove(comment);
            db.SaveChanges();
        }
Ejemplo n.º 6
0
        public static Employee SearchEmployeesById(Employee em, EmpDBContext db)

        {
            Employee x = (db.Employees.Where(e => e.eid == em.eid)).First();

            return(x);
        }
        public static void Create(ManagerComment comment)
        {
            EmpDBContext db = new EmpDBContext();

            db.ManagerComments.Add(comment);
            db.SaveChanges();
        }
Ejemplo n.º 8
0
        public static void CreateTask(ProjectTask task)
        {
            EmpDBContext db = new EmpDBContext();

            db.ProjectTasks.Add(task);
            db.SaveChanges();
        }
Ejemplo n.º 9
0
        public static void CreateNewProject(Project prjct)
        {
            EmpDBContext db = new EmpDBContext();

            db.Project.Add(prjct);
            db.SaveChanges();
        }
        // GET: api/Userstories/5
        public Userstories Get(int id)
        {
            EmpDBContext db = new EmpDBContext();
            Userstories  pr = new Userstories();

            pr.userstoryid = id;
            return(UserstoryRepo.SearchUserById(pr, db));
        }
        // GET: api/ProjectController/5
        public Project Get(int id)
        {
            EmpDBContext db = new EmpDBContext();
            Project      pr = new Project();

            pr.proid = id;
            return(ProjectRepo.SearchProjectsById(pr, db));
        }
        // GET: api/ManagerComments/5
        public ManagerComment Get(int id)
        {
            EmpDBContext   db      = new EmpDBContext();
            ManagerComment comment = new ManagerComment();

            comment.managerid = id;
            return(ManagerCommentRepo.Search(comment, db));
        }
Ejemplo n.º 13
0
        // GET: api/ProjectTask/5
        public ProjectTask Get(int id)
        {
            EmpDBContext db  = new EmpDBContext();
            ProjectTask  obj = new ProjectTask();

            obj.task_id = id;
            return(ProTaskRepo.SearchById(obj, db));
        }
Ejemplo n.º 14
0
        public static void Delete(ProjectTask ts)
        {
            EmpDBContext db = new EmpDBContext();
            ProjectTask  tk = SearchById(ts, db);

            db.ProjectTasks.Remove(tk);
            db.SaveChanges();
        }
Ejemplo n.º 15
0
        // GET: api/Employee/5
        public Employee Get(int id)
        {
            EmpDBContext db  = new EmpDBContext();
            Employee     obj = new Employee();

            obj.eid = id;
            return(EmployeeRepo.SearchEmployeesById(obj, db));
        }
        public static void Edit(ManagerComment comment)
        {
            EmpDBContext   db = new EmpDBContext();
            ManagerComment c  = Search(comment, db);

            c.comments = comment.comments;
            c.taskid   = comment.taskid;
            db.SaveChanges();
        }
Ejemplo n.º 17
0
        public EmployeeRepository()
        {
            _db = new EmpDBContext();

            var config = new MapperConfiguration(cfg =>
            {
                cfg.CreateMap <Employee, EmployeeDTO>();
            });
        }
Ejemplo n.º 18
0
        public static void EditUserstories(Userstories e)
        {
            EmpDBContext db  = new EmpDBContext();
            Userstories  usr = SearchUserById(e, db);

            usr.story = e.story;
            usr.proid = e.proid;

            db.SaveChanges();
        }
Ejemplo n.º 19
0
        public static void DeleteAllProject(int proid)
        {
            EmpDBContext db     = new EmpDBContext();
            var          delete = db.Project.FirstOrDefault(s => s.proid == proid);

            if (delete != null)
            {
                db.Project.Remove(delete);
                db.SaveChanges();
            }
        }
Ejemplo n.º 20
0
        public static void DeleteAllEmployee(int eid)
        {
            EmpDBContext db     = new EmpDBContext();
            var          delete = db.Employees.FirstOrDefault(s => s.eid == eid);

            if (delete != null)
            {
                db.Employees.Remove(delete);
                db.SaveChanges();
            }
        }
Ejemplo n.º 21
0
        public static void DeleteallUserstories(int userstoryid)
        {
            EmpDBContext db     = new EmpDBContext();
            var          delete = db.userstories.FirstOrDefault(s => s.userstoryid == userstoryid);

            if (delete != null)
            {
                db.userstories.Remove(delete);
                db.SaveChanges();
            }
        }
Ejemplo n.º 22
0
        public static void Edit(ProjectTask t)
        {
            EmpDBContext db = new EmpDBContext();
            ProjectTask  ta = SearchById(t, db);

            ta.assigned_to     = t.assigned_to;
            ta.end_date        = t.end_date;
            ta.start_date      = t.start_date;
            ta.completion_date = t.completion_date;
            ta.userstoryid     = t.userstoryid;
            db.SaveChanges();
        }
Ejemplo n.º 23
0
        public static void EditProject(Project e)
        {
            EmpDBContext db  = new EmpDBContext();
            Project      pro = SearchProjectsById(e, db);

            pro.proid      = e.proid;
            pro.proname    = e.proname;
            pro.startdate  = e.startdate;
            pro.enddate    = e.enddate;
            pro.clientname = e.clientname;
            // p.skillsets = e.skillsets;
            db.SaveChanges();
        }
Ejemplo n.º 24
0
        public static void EditEmployee(Employee Emp)
        {
            EmpDBContext db = new EmpDBContext();
            Employee     em = SearchEmployeesById(Emp, db);

            em.eid         = Emp.eid;
            em.name        = Emp.name;
            em.designation = Emp.designation;
            em.contactno   = Emp.contactno;
            em.emailid     = Emp.emailid;
            em.skillsets   = Emp.skillsets;
            db.SaveChanges();
        }
Ejemplo n.º 25
0
 public static ProjectTask SearchById(ProjectTask ta, EmpDBContext db)
 {
     return((db.ProjectTasks.Select(t => t).Where(t => t.task_id == ta.task_id)).First());
 }
Ejemplo n.º 26
0
 public OrdersController(EmpDBContext context)
 {
     _context = context;
 }
 public LineItemsController(EmpDBContext context)
 {
     _context = context;
 }
 public CartItemsController(EmpDBContext context)
 {
     _context = context;
 }
Ejemplo n.º 29
0
 public InventoriesController(EmpDBContext context)
 {
     _context = context;
 }
Ejemplo n.º 30
0
        public List <ProjectTask> ShowAllTasks()
        {
            EmpDBContext db = new EmpDBContext();

            return(db.ProjectTasks.Select(task => task).ToList());
        }