public void UpdateProject(CommonEntities.Projects project)
        {
            var proj    = _projectManager.Projects.Where(x => x.ProjectID == project.ProjectID).FirstOrDefault();
            var user    = _projectManager.Users.Where(x => x.UserID == project.ManagerID).FirstOrDefault();
            var extUser = _projectManager.Users.Where(x => x.ProjectID == project.ProjectID).FirstOrDefault();

            if (proj != null && user != null)
            {
                proj.ProjectName = project.ProjectName;
                proj.StartDate   = project.StartDate;
                proj.EndDate     = project.EndDate;
                proj.Priority    = project.Priority;
                if (extUser != null)
                {
                    extUser.ProjectID = null;
                }
                user.ProjectID = project.ProjectID;
                _projectManager.SaveChanges();
            }
        }
        public void AddProject(CommonEntities.Projects project)
        {
            Project proj = new Project
            {
                ProjectName = project.ProjectName,
                StartDate   = project.StartDate,
                EndDate     = project.EndDate,
                Priority    = project.Priority
            };

            _projectManager.Projects.Add(proj);
            _projectManager.SaveChanges();
            var proId = proj.ProjectID;
            var ur    = _projectManager.Users.Where(x => x.UserID == project.ManagerID).FirstOrDefault();

            if (ur != null)
            {
                ur.ProjectID = proId;
                _projectManager.SaveChanges();
            }
        }