Ejemplo n.º 1
0
        /// <summary>
        /// In the given path and all folders below it, load all valid projects, currently only .csproj files
        /// </summary>
        /// <param name="SearchPath"></param>
        /// <returns></returns>
        public ProjectList GetAllProjects()
        {
            //return list of projects
            ProjectList projects = new ProjectList();
            Console.WriteLine("start to fetch .csproj files");
            //get list of all csproj files below current directory
            string[] FilePaths = Directory.GetFiles(SearchPath, "*.csproj", SearchOption.AllDirectories);
            foreach (string FilePath in FilePaths)
            {
                if (!FilePath.ToLower().Contains("mainline") && MainLineOnly.ToUpper().Equals("T"))
                    continue;
                else
                {
                    string FileName = new FileInfo(FilePath).Name;

                    //if not a unit test (Test or UnitTest.csproj, then add it
                    //TODO: refactor to allow exclusions to be passed in?
                    if (!FileName.StartsWith("Test") && !FileName.StartsWith("UnitTest"))
                    {
                        Console.WriteLine(string.Format("Adding project {0} ...", FilePath));
                        projects.Add(new Project(FilePath));
                    }
                }
            }
            return projects;
        }
Ejemplo n.º 2
0
        public BuildEngine(FrameworkVersions toolsVersion, string frameworkPath)
        {
            _framework = toolsVersion;
            _frameworkPath = frameworkPath;
			Engine = CreateEngine(_framework, _frameworkPath);
            _projects = new ProjectList(this, _framework);
            _properties = new PropertyList(Engine.GlobalProperties);
        }
Ejemplo n.º 3
0
 private void DisplayList(ProjectList list)
 {
   //Csla.SortedBindingList<ProjectInfo> sortedList =
   //  new Csla.SortedBindingList<ProjectInfo>(list);
   //sortedList.ApplySort("Name", ListSortDirection.Ascending);
   //this.projectListBindingSource.DataSource = sortedList;
   var sortedList = from p in list orderby p.Name select p;
   this.projectListBindingSource.DataSource = sortedList;
 }
Ejemplo n.º 4
0
 public void ToReferenceXMLTest()
 {
     ProjectList target = new ProjectList(); // TODO: Initialize to an appropriate value
     string expected = string.Empty; // TODO: Initialize to an appropriate value
     string actual;
     actual = target.ToReferenceXML();
     Assert.AreEqual(expected, actual);
     //Assert.Inconclusive("Verify the correctness of this test method.");
 }
 public void GetDistinctProjectsTest()
 {
     PrivateObject param0 = null; // TODO: Initialize to an appropriate value
     DependencyFinder_Accessor target = new DependencyFinder_Accessor(param0); // TODO: Initialize to an appropriate value
     ProjectList projects = new ProjectList(); // TODO: Initialize to an appropriate value
     ProjectList projectList = new ProjectList(); // TODO: Initialize to an appropriate value
     ProjectList expectList = new ProjectList();
     //target.GetDistinctProjects(projects, projectList);
     //Assert.AreEqual(expectList, projectList);
     // Assert.Inconclusive("A method that does not return a value cannot be verified.");
 }
Ejemplo n.º 6
0
        public void LoadFromFile()
        {
            var dlg = new OpenFileDialog()
            {
                Filter = "back testing project|*." + BacktestingResource.BacktestingProjectFileExt + "|analyse project|*." + BacktestingResource.AnalyseProjectFileExt + "| (*.*)|*.*"
            };

            if (dlg.ShowDialog() == true)
            {
                if (!dlg.FileName.EndsWith(BacktestingResource.AnalyseProjectFileExt))
                {
                    try {
                        var bp = CommonLib.CommonProc.LoadObjFromFile <BacktestingProject>(dlg.FileName);
                        if (bp != null)
                        {
                            bp.RecoverySerialObject();
                            var svm = new BacktestingProjectSummaryViewModel()
                            {
                                TargetProject = bp, Open = Open, Delete = Delete, Start = Start, Pause = Pause, Stop = Stop
                            };
                            ProjectList.Add(svm);
                            OpenBacktestingProject(svm);
                        }
                        return;
                    }
                    catch (Exception ex)
                    {
                        LogSupport.Error(ex);
                    }
                }
                if (!dlg.FileName.EndsWith(BacktestingResource.BacktestingProjectFileExt))
                {
                    try {
                        var ap = CommonLib.CommonProc.LoadObjFromFile <AnalyseProject>(dlg.FileName);
                        if (ap != null)
                        {
                            ap.RecoverySerialObject();
                            var svm = new AnalyseProjectSummaryViewModel()
                            {
                                TargetProject = ap, Open = Open, Delete = Delete, Start = Start, Pause = Pause, Stop = Stop
                            };
                            ProjectList.Add(svm);
                            OpenAnalyseProject(svm);
                        }
                        return;
                    }
                    catch (Exception ex)
                    {
                        LogSupport.Error(ex);
                    }
                }
            }
        }
Ejemplo n.º 7
0
        private void _btnEdit_Click(object sender, EventArgs e)
        {
            WorkorderForm frm = new WorkorderForm();

            frm.Owner = this;
            if (frm.ShowDialog() == DialogResult.OK)
            {
                _allProjects       = ProjectList.Load(true);
                _rbShowAll.Checked = true;
                RepopulateGrid();
            }
        }
 /// <summary>
 /// saves in the db the status for a specific project
 /// </summary>
 /// <param name="id"></param>
 /// <param name="state"></param>
 /// <returns></returns>
 public JsonResult ProjectFinished(int id, int state)
 {
     try
     {
         ProjectList p = db.ProjectList.Find(id);
         p.finished = (state == 1) ? true : false;
         db.SaveChanges();
         return(Json("Correct", JsonRequestBehavior.AllowGet));
     }
     catch (Exception ex)
     { return(Json("Error", JsonRequestBehavior.AllowGet)); }
 }
        /// <summary>
        /// On item selected event
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void OnItemSelected(object sender, EventArgs e)
        {
            ProjectModel project = sender as ProjectModel;

            if (project == null)
            {
                return;
            }

            selectAll = ProjectList.All(p => p.Selected);
            NotifyPropertyChanged(nameof(SelectAll));
        }
Ejemplo n.º 10
0
        // GET: Project
        public ActionResult Index()
        {
            User userin = System.Web.HttpContext.Current.Session["user"] as User;

            if (userin == null || userin.UserTypeDescription != "Admin")
            {
                return(RedirectToAction("Index", "Home"));
            }

            projects = new ProjectList();
            projects.Load();
            return(View(projects));
        }
Ejemplo n.º 11
0
        public void Edit_StateUnderTest_ExpectedBehavior1()
        {
            // Arrange
            var         projectListsController = this.CreateProjectListsController();
            ProjectList projectList            = null;

            // Act
            //var result = projectListsController.Edit(
            //    projectList);

            // Assert
            //Assert.Fail();
        }
Ejemplo n.º 12
0
        private void ModifyProjectMnBtn_Click(object sender, EventArgs e)
        {
            StudentsList.Hide();
            TeamGroupBox.Hide();
            AssignToWhomLabel.Hide();
            AssignProjectBtn.Hide();
            GradeList.Hide();
            GradeGroupBox.Hide();

            ProjectList.Show();
            ProjectGroupBox.Show();
            ProjectGroupBox.Location = new Point(450, 12);
        }
Ejemplo n.º 13
0
        public void Delete()
        {
            ProjectList projects = new ProjectList();

            projects.Load();
            Project project = new Project();

            project.LoadById(projects.FirstOrDefault(p => p.Name == "Test").Id);

            int rowsAffected = project.Delete();

            Assert.IsTrue(rowsAffected == 1);
        }
Ejemplo n.º 14
0
        /*
         * Environnement:
         *  DEV: https://dev.bimtrack.co/en/Login
         *  QA: https://qa.bimtrack.co/en/Login
         *  PROD: https://bimtrackapp.co/en/Login (edited)
         */

        public void createUser()
        {
            KeyChain kc = CTX.keyChain;

            CTX.driver.Url = kc.UrlBimTrack;

            BTLogin login = new BTLogin();

            login.LogIn(kc.LoginUsername, kc.LoginPassword);

            BTHubsTracks btHubsTracks = new BTHubsTracks();
            ProjectList  prjList      = btHubsTracks.OpenHubByName(kc.HubName);

            prjList.SelectProject(kc.DefaultProject);

            MainProject mainProject = new MainProject();

            SideBarMenu sideBarMenu = mainProject.GetSidebarMenu();

            sideBarMenu.ClickMenuItem("Hub Settings");
            HubSettings        hubSettings = new HubSettings();
            UserManagementForm userForm    = hubSettings.ClickButtonAddUser();

            var emailSuffix = BimTrackUser.GetNewUserSuffix();
            var email       = BimTrackUser.GetUniqueUserEmail(emailSuffix);

            if (userForm.AddNewUser(new BimTrackUser(email, true)))
            {
                // PROCESS EMAIL
                BimEmailProcessor proc   = new BimEmailProcessor();
                string            szLink = null;
                while (szLink == null)
                {
                    szLink = proc.GetLatestActivationForUser(emailSuffix);
                    Console.Out.WriteLine("Loop waiting");
                    Thread.Sleep(1500);
                }

                Console.Out.WriteLine("SzLink == " + szLink);
                CTX.driver.Close();

                // Complete the user creation
                new CompleteUserFormTest().ActivateUser(szLink);

                //hubSettings.FillNewUserInformation(userSuffix, true);

                Thread.Sleep(1500);
            }

            CTX.driver.Close();
        }
Ejemplo n.º 15
0
    static void Main(string[] args)
    {
        var PlayerDebug = false;

        var samples            = new List <Sample>();
        var availableMolecules = new AvailableMoleculesList();
        var players            = new List <Player>();
        var projectList        = new ProjectList();

        players.Add(new Player()
        {
            Id = 0
        });
        players.Add(new Player()
        {
            Id = 1
        });

        ProcessOneTimeInputs(ref projectList);

        // game loop
        while (true)
        {
            ProcessInputs(players, ref samples, ref availableMolecules);

            //foreach (var availableMolecule in availableMolecules)
            //Console.Error.WriteLine(availableMolecules);

            var myPlayer  = players.Where(p => p.IsMine).First();
            var oppPlayer = players.Where(p => !p.IsMine).First();

            if (PlayerDebug)
            {
                Console.Error.WriteLine(myPlayer);
                Console.Error.WriteLine(".");
                Console.Error.WriteLine(".");
                Console.Error.WriteLine(".");
                Console.Error.WriteLine(oppPlayer);
            }
            var nextMove = GetNextMove(ref players, samples, availableMolecules, projectList);

            if (nextMove == "DUMP MOLECULES")
            {
                nextMove = "GOTO DIAGNOSIS Tired of Waiting!!";
                myPlayer.IsDumpAllMolecules = true;
            }

            Console.WriteLine(nextMove);
        }
    }
Ejemplo n.º 16
0
        /// <summary>
        /// Create an empty instance of the project
        /// </summary>
        public ProjectManager()
        {
            _projects = new ProjectList();
            string settingsFolder = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);

            settingsFolder = settingsFolder + "\\OpenLauncher";

            if (!Directory.Exists(settingsFolder))
            {
                Directory.CreateDirectory(settingsFolder);
            }

            _projectFile = settingsFolder + "\\projects.json";
        }
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="projects">Project list</param>
        public ProjectsView(IList<string> projects)
        {
            InitializeComponent();
            DataContext = this;

            SelectAll = true;

            foreach (var project in projects.Select(p => new ProjectModel(p)).Where(p => !string.IsNullOrWhiteSpace(p.Key)))
            {
                ProjectList.Add(project);
                project.OnSelected += OnItemSelected;
            }

        }
Ejemplo n.º 18
0
        private void _btnProjectBrowse_Click(object sender, EventArgs e)
        {
            var projects          = ProjectList.Load(false);
            WorkorderSelector frm = new WorkorderSelector(projects);

            frm.Owner = this;

            if (frm.ShowDialog() == DialogResult.OK)
            {
                _lblProjectCode.Text = frm.SelectedProject.Code;
                _lblProjectCode.Tag  = frm.SelectedProject.Id;
                CheckTimesForOverlap();
            }
        }
Ejemplo n.º 19
0
        private ProjectData(Data data)
        {
            this.projects = new ProjectList();
            foreach (var project in data.projects)
            {
                this.projects.Add(project.Name, project);
            }

            this.packages = new PackageList();
            foreach (var package in data.packages)
            {
                this.packages.Add(package.Name, package);
            }
        }
Ejemplo n.º 20
0
        public ProjectsWindow(ProjectList projList)
        {
            InitializeComponent();
            _projList = projList;

            InitializePictureMarkerSymbol();
            MyMapView.Loaded    += MyMapView_Loaded;
            MyMapView.MouseDown += MyMapView_MouseDown;

            foreach (ProjectLocation loc in _projList.Locations)
            {
                ProjectListLB.Items.Add(loc);
            }
        }
Ejemplo n.º 21
0
        // ----------------------------------- END PORTFOLIOS ------------------------------------------
        #endregion Portfolio


        #region ProjectPortfolio
        // ----------------------------------- START PROJECTPORTFOLIO ------------------------------------------

        // GET: DeleteProjectPortfolio
        public ActionResult DeleteProjectPortfolio(Guid?id)
        {
            Guid ID = id.GetValueOrDefault();

            if (ID == Guid.Empty)
            {
                if (Authenticate.IsAuthenticated())
                {
                    return(RedirectToAction("EditPortfolios", "UserProfile", new { returnurl = HttpContext.Request.Url }));
                }
                else
                {
                    return(RedirectToAction("Index", "Login", new { returnurl = HttpContext.Request.Url }));
                }
            }
            else
            {
                if (Authenticate.IsAuthenticated())
                {
                    UserProfile up = new UserProfile()
                    {
                        Portfolio  = new Portfolio(),
                        Portfolios = new PortfolioList(),
                        Projects   = new ProjectList(),
                        Privacies  = new PrivacyList(),
                        User       = new User()
                    };
                    up.Portfolio.LoadById(ID);
                    up.Privacies.Load();
                    User        userin       = System.Web.HttpContext.Current.Session["user"] as User;
                    ProjectList portProjects = new ProjectList();
                    portProjects.LoadbyPortfolioID(ID);
                    up.Projects = portProjects;

                    foreach (Project p in up.Projects)
                    {
                        if (p.Image == string.Empty)
                        {
                            p.Image = "Images/UserProfiles/Default.png";
                        }
                    }
                    up.User.LoadById(userin.Id);
                    return(View(up));
                }
                else
                {
                    return(RedirectToAction("Index", "Login", new { returnurl = HttpContext.Request.Url }));
                }
            }
        }
Ejemplo n.º 22
0
        /// <summary>
        /// Bind Data to Drop Downs
        /// </summary>
        private void BindProjects()
        {
            ProjectList list = (new ProjectBLL()).GetProjectNames(Convert.ToInt32(Session["USER_ID"]));

            drpProject.DataSource     = list;
            drpProject.DataTextField  = "ProjectName";
            drpProject.DataValueField = "ProjectID";
            drpProject.DataBind();

            drpProjectsearch.DataSource     = list;
            drpProjectsearch.DataTextField  = "ProjectName";
            drpProjectsearch.DataValueField = "ProjectID";
            drpProjectsearch.DataBind();
        }
        // GET: ProjectLists/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            ProjectList projectList = db.ProjectLists.Find(id);

            if (projectList == null)
            {
                return(HttpNotFound());
            }
            return(View(projectList));
        }
Ejemplo n.º 24
0
        private void ChooseCourseMnBtn_Click(object sender, EventArgs e)
        {
            YouAreHere(ChooseCourseMnBtn);
            ProjectGroupBox.Hide();
            ProjectList.Hide();
            GradeList.Hide();
            GradeGroupBox.Hide();
            TeamGroupBox.Hide();
            TeamList.Hide();
            SelectedCourseLabel.Show();

            CoursesList.Show();
            SelectCourseBtn.Show();
        }
Ejemplo n.º 25
0
        /*
         * Environnement:
         *  DEV: https://dev.bimtrack.co/en/Login
         *  QA: https://qa.bimtrack.co/en/Login
         *  PROD: https://bimtrackapp.co/en/Login (edited)
         */

        public void startBimTrack()
        {
//            CTX.driver.Url = "http://bimtrackapp.co";
            CTX.driver.Url = "https://qa.bimtrack.co/";

            BTLogin login = new BTLogin();

            login.LogIn("*****@*****.**", "Z3nt3l1499!");

            BTHubsTracks btHubsTracks = new BTHubsTracks();
            ProjectList  prjList      = btHubsTracks.OpenHubByName("ZenyTest");

            prjList.SelectProject("ZENPROJECT001");

            MainProject mainProject = new MainProject();

            SideBarMenu sideBarMenu = mainProject.GetSidebarMenu();

            sideBarMenu.ClickMenuItem("Hub Settings");
            HubSettings        hubSettings = new HubSettings();
            UserManagementForm userForm    = hubSettings.ClickButtonAddUser();

            var emailSuffix = BimTrackUser.GetNewUserSuffix();
            var email       = BimTrackUser.GetUniqueUserEmail(emailSuffix);

            userForm.AddNewUser(new BimTrackUser(email, true));

            // PROCESS EMAIL
            BimEmailProcessor proc   = new BimEmailProcessor();
            string            szLink = null;

            while (szLink == null)
            {
                szLink = proc.GetLatestActivationForUser(emailSuffix);
                Console.Out.WriteLine("Loop waiting");
                Thread.Sleep(1500);
            }

            Console.Out.WriteLine("SzLink == " + szLink);
            CTX.driver.Close();

            // Complete the user creation
            new CompleteUserFormTest().ActivateUser(szLink);

            //hubSettings.FillNewUserInformation(userSuffix, true);

            Thread.Sleep(1500);
            CTX.driver.Close();
        }
Ejemplo n.º 26
0
        public async Task ProjectListShouldFilterByParticipating()
        {
            var mockFoundProject      = new Mock <IProjectParticipateData>();
            var mockParticipatingRepo = new Mock <IProjectParticipantsRepository>();

            mockParticipatingRepo.Setup(x => x.GetAsync("1", "Project1")).ReturnsAsync(mockFoundProject.Object);
            mockParticipatingRepo.Setup(x => x.GetAsync("1", "Project2")).ReturnsAsync((IProjectParticipateData)null);

            var projectList = await ProjectList.CreateProjectList(mockRepo.Object);

            var projects = (await projectList.FilterByParticipating("1", mockParticipatingRepo.Object)).GetProjects();

            Assert.Equal(1, projects.Count());
            Assert.Equal("Project1", projects.First().Id);
        }
Ejemplo n.º 27
0
    void initializeProjects()
    {
        projects = new ProjectList();
        Project project1 = new Project(1, 50, 50, 120);
        Project project2 = new Project(2, 10, 30, 120);
        Project project3 = new Project(3, 25, 40, 120);
        Project project4 = new Project(4, 30, 15, 120);
        Project project5 = new Project(5, 60, 45, 120);

        projects.AddProject(project1);
        projects.AddProject(project2);
        projects.AddProject(project3);
        projects.AddProject(project4);
        projects.AddProject(project5);
    }
Ejemplo n.º 28
0
        public void Bind()
        {
            string strWhere = "(tbl_designcorrect.NodeUser like '%" + WebCommon.Public.GetUserName() + "%' or UserName='******' or DT_JiaoDuiRen='" + WebCommon.Public.GetUserName() + "' or DT_ShenHeRen='" + WebCommon.Public.GetUserName() + "' or DT_ShenDingRen='" + WebCommon.Public.GetUserName() + "')";

            if (WebCommon.Public.ToString(Request.QueryString["where"]) != "")
            {
                strWhere += " and " + Request.QueryString["where"];
            }
            //分页设置
            AspNetPager1.PageSize    = 6;
            AspNetPager1.RecordCount = WebBLL.Tbl_DesignCorrectManager.GetDataTableByCount(strWhere);

            //绑定分页数据
            ProjectList.DataSource = WebBLL.Tbl_DesignCorrectManager.GetDataTableByPage(AspNetPager1.PageSize, AspNetPager1.CurrentPageIndex, strWhere, "tbl_DesignCorrect.id desc");
            ProjectList.DataBind();
        }
Ejemplo n.º 29
0
        void loadOperationProject_Completed(object sender, EventArgs e)
        {
            ProjectList.Clear();
            LoadOperation loadOperation = sender as LoadOperation;

            foreach (ProductManager.Web.Model.project project in loadOperation.Entities)
            {
                ProjectEntity projectEntity = new ProjectEntity();
                projectEntity.Project = project;
                projectEntity.Update();
                ProjectList.Add(projectEntity);
            }

            UpdateChanged("ProjectList");
            IsBusy = false;
        }
Ejemplo n.º 30
0
        private void BindProject()
        {
            string projectName      = string.Empty;
            string projectStartDate = string.Empty;
            string projectEndDate   = string.Empty;
            string projectStatus    = string.Empty;

            ProjectBLL  BLLobj   = new ProjectBLL();
            ProjectList Projects = new ProjectList();

            Projects = BLLobj.GetProjects(projectName, projectStartDate, projectEndDate, projectStatus);
            ddlProject.DataSource     = BLLobj.GetProjects(projectName, projectStartDate, projectEndDate, projectStatus);
            ddlProject.DataTextField  = "projectName";
            ddlProject.DataValueField = "projectID";
            ddlProject.DataBind();
        }
Ejemplo n.º 31
0
        public async Task <IActionResult> GetCreatedProjects()
        {
            ViewBag.CreatedProjects       = ViewBag.CreatedProjects != true;
            ViewBag.MyProjects            = true;
            ViewBag.FollowingProjects     = false;
            ViewBag.ParticipatingProjects = false;

            var user = UserModel.GetAuthenticatedUser(User.Identity);

            var projectList = (await ProjectList.CreateProjectList(_projectRepository))
                              .FilterByAuthorId(user.Email);

            var viewModel = await BuildViewModel(projectList);

            return(View("Myprojects", viewModel));
        }
Ejemplo n.º 32
0
        public override Task <ProjectList> List(Empty request, ServerCallContext context)
        {
            var result = new ProjectList();

            result.Project.Add(new ProjectModel
            {
                Name = "amousa",
                Code = "002"
            });
            result.Project.Add(new ProjectModel
            {
                Name = "kevin",
                Code = "003"
            });
            return(Task.FromResult(result));
        }
        public void Bind()
        {
            string strWhere = "";

            if (WebCommon.Public.ToString(Request.QueryString["where"]) != "")
            {
                strWhere = Request.QueryString["where"];
            }
            //分页设置
            AspNetPager1.PageSize    = 15;
            AspNetPager1.RecordCount = WebBLL.Tbl_ProjectArchiveVersionManager.GetDataTableByCount(strWhere);

            //绑定分页数据
            ProjectList.DataSource = WebBLL.Tbl_ProjectArchiveVersionManager.GetDataTableByPage(AspNetPager1.PageSize, AspNetPager1.CurrentPageIndex, strWhere, "a.id desc");
            ProjectList.DataBind();
        }
Ejemplo n.º 34
0
        public void Bind()
        {
            string strWhere = "parentid=0";

            if (WebCommon.Public.ToString(Request.QueryString["where"]) != "")
            {
                strWhere += " and " + Request.QueryString["where"];
            }
            //分页设置
            AspNetPager1.PageSize    = 15;
            AspNetPager1.RecordCount = WebBLL.Tbl_FlowWorkLogManager.GetDataTableByCount(strWhere);

            //绑定分页数据
            ProjectList.DataSource = WebBLL.Tbl_FlowWorkLogManager.GetDataTableByPage(AspNetPager1.PageSize, AspNetPager1.CurrentPageIndex, strWhere, "id desc");
            ProjectList.DataBind();
        }
Ejemplo n.º 35
0
        public void LoadProjectList()
        {
            if (Projects != null)
            {
                return;
            }

            try
            {
                Projects = Globals.iS3Service.PrivilegeService.QueryAccessableProject(Globals.userID);
            }
            catch (Exception error)
            {
                MessageBox.Show(error.Message, "Error", MessageBoxButton.OK);
            }
        }
Ejemplo n.º 36
0
        /// <summary>
        /// This will output all dependencies since that is what we care about. Will need some additional work if we want to display straggler projects with no dependencies also.
        /// </summary>
        /// <param name="sb"></param>
        /// <param name="projects"></param>
        private void AppendProjectLinks(StringBuilder sb, ProjectList projects)
        {
            //loop through every project and output its dependencies to the file in the format
            //parent -> child
            //order doesn't matter for dot files
            foreach (Project project in projects)
            {
                foreach (Project reference in project.ReferencedProjects)
                {
                    //if not processed output link and add to processed list
                    if (!ProcessedLinks.Contains(project.Name + "-" + reference.Name))
                    {
                        sb.Append("\"" + project.Name + "\" -> \"" + reference.Name + "\"" + Environment.NewLine);
                        ProcessedLinks.Add(project.Name + "-" + reference.Name);
                    }

                    AppendProjectLinks(sb, project.ReferencedProjects);
                }

            }
        }
Ejemplo n.º 37
0
        public static ScheduleItemList GetProjectSchedules(ProjectList projects, DateTime startDate, DateTime endDate)
        {
            ScheduleItemList schedules = null;

            if (projects != null && projects.Count > 0)
            {
                var parms = new Dictionary<string, string>();
                parms.Add("@ProjectList", string.Join(",", (from p in projects select p.Id).ToArray()));
                parms.Add("@StartDate", startDate.ToShortDateString());
                parms.Add("@EndDate", endDate.ToShortDateString());

                using (var db = new DataBase("sp_GetProjectSchedules_NEW", parms))
                {
                    var reader = db.ExecuteReader();

                    if (reader.HasRows)
                    {
                        schedules = ConvertReaderDataToScheduleItemList(reader);
                    }
                }
            }
            return schedules;
        }
Ejemplo n.º 38
0
        private void WriteRefencesToXML(StringBuilder sbRefer, ProjectList projects)
        {
            foreach (Project project in projects)
            {
                string tempfix = project.Name;
                Console.WriteLine(tempfix + ": " + project.ProjectPath);
                // sbRefer.AppendLine(project.Name + ":" + project.ProjectPath);
                foreach (string refer in project.ReferenceList)
                {
                    Console.WriteLine(tempfix + " Assembly Refer: " + refer);
                    // sbRefer.AppendLine(prefix +" Assembly Refer:" + refer);
                }
                foreach (Project reference in project.ReferencedProjects)
                {
                    //if not processed output link and add to processed list
                    if (!ProcessedLinks.Contains(project.Name + "-" + reference.Name))
                    {
                        // sb.Append("\"" + project.Name + "\" -> \"" + reference.Name + "\"" + Environment.NewLine);
                        ProcessedLinks.Add(project.Name + "-" + reference.Name);
                        Console.WriteLine(tempfix + " Project Refer: " + reference.Name);
                        // sbRefer.AppendLine(prefix + " Project Refer:" + reference.Name);

                    }
                }

            }
            // return sbRefer;
        }
Ejemplo n.º 39
0
        private static ProjectList ConvertReaderDataToProjectList(SqlDataReader reader)
        {
            ProjectList projects = null;

            if (reader.HasRows)
            {
                projects = new ProjectList();
                while (reader.Read())
                {
                    var project = new Project();

                    project.Id = reader.GetValueOrDefault<int>("ID");
                    project.ProjectNumber = reader.GetValueOrDefault<decimal>("ProjectNo");
                    project.Name = reader.GetValueOrDefault<string>("ProjectName");
                    project.ClientId = reader.GetValueOrDefault<int>("ClientID");
                    project.StatusId = reader.GetValueOrDefault<int>("ProjectStatus");
                    project.Location = reader.GetValueOrDefault<string>("ProjectLocation");
                    project.ConstructionType = reader.GetValueOrDefault<string>("ConstructionType");
                    project.ProjectType = reader.GetValueOrDefault<string>("ProjectType");
                    project.PhaseId = reader.GetValueOrDefault<int>("PhaseID");
                    project.EstimatedStartDate = reader.GetValueOrDefault<DateTime>("EstimatedStartDate");
                    project.EstimatedCompletionDate = reader.GetValueOrDefault<DateTime>("EstimatedCompletionDate");
                    project.FeeAmount = reader.GetValueOrDefault<decimal>("FeeAmount");
                    project.FeeStructure = reader.GetValueOrDefault<string>("FeeStructure");
                    project.ContractTypeId = reader.GetValueOrDefault<int>("ContractType");
                    project.PICId = reader.GetValueOrDefault<int>("PIC");
                    project.PM1Id = reader.GetValueOrDefault<int>("PM1");
                    project.PM2Id = reader.GetValueOrDefault<int>("PM2");
                    project.LastModifiedByUserId = reader.GetValueOrDefault<int>("LastModifiedByUserID");
                    project.PICCode = reader.GetValueOrDefault<string>("PICCode");
                    project.PM1Code = reader.GetValueOrDefault<string>("PM1Code");
                    project.PM2Code = reader.GetValueOrDefault<string>("PM2Code");
                    project.Comments = reader.GetValueOrDefault<string>("Comments");
                    project.IsActive = reader.GetValueOrDefault<bool>("Active");
                    project.LastModifiedDate = reader.GetValueOrDefault<DateTime>("LastModifiedDate");

                    projects.Add(project);
                }
            }

            return projects;
        }
Ejemplo n.º 40
0
        private string PushDataIntoDB(ProjectList projects, string name)
        {
            string connectionString = "Integrated Security=SSPI;Initial Catalog=ShareDB;Data Source=devdb.dev.sh.ctriptravel.com,28747";
            using (System.Data.SqlClient.SqlConnection conn = new System.Data.SqlClient.SqlConnection(connectionString))
            {
                System.Data.SqlClient.SqlCommand cmd = new System.Data.SqlClient.SqlCommand();
                cmd.Connection = conn;
                cmd.CommandText = @"INSERT INTO [CDM_DBXML]([DBName],[XMLData],[ModifyDate]) VALUES (@dbname,@xmlData,getdate()); select @tid = @@Identity";
                cmd.Parameters.AddWithValue("@dbname", name);
                cmd.Parameters.AddWithValue("@xmlData", projects.ToReferenceXML());
                cmd.Parameters.Add("@tid", System.Data.SqlDbType.Int);
                cmd.Parameters["@tid"].Direction = System.Data.ParameterDirection.Output;
                //cmd.CommandText = "INSERT INTO [CDM_DBXML]([DBName],[XMLData],[ModifyDate]) VALUES ('" + DateTime.Now.ToString("yyyymmddhhMMss") + "','" + projects.ToReferenceXML() + "',getdate())";

                conn.Open();
                cmd.ExecuteNonQuery();
                int rValue = Convert.ToInt32(cmd.Parameters["@tid"].Value);
                Console.WriteLine(rValue);
                return name;
            }
        }
		/// <summary>コピーコンストラクタ。</summary>
		/// <param name="previous"></param>
		public GlobalStructureNumericsData(GlobalStructureNumericsData previous)
			{
			Parameters = new ProjectList<ParameterData>( previous.Parameters );
			Functions = new ProjectList<FunctionData>( previous.Functions );
			}
 public async Task<ProjectList.response> ProjectList(ProjectList.request request, CancellationToken? token = null)
 {
     return await SendAsync<ProjectList.response>(request.ToXmlString(), token.GetValueOrDefault(CancellationToken.None));
 }
Ejemplo n.º 43
0
        private void GetDistinctProjects(ProjectList projects, ProjectList projectList)
        {
            // ProjectList projectList = new ProjectList();
            foreach (Project project in projects)
            {

                if (!projectList.Any(x => x.Name == project.Name))
                    projectList.Add(project);

                foreach (string refer in project.ReferenceList)
                {
                    Project tmp = new Project();
                    tmp.Name = refer;
                    if (!projectList.Any(x => x.Name == refer))
                        projectList.Add(tmp);
                }

                foreach (Project reference in project.ReferencedProjects)
                {
                    if (!projectList.Any(x => x.Name == reference.Name))
                    {
                        projectList.Add(reference);
                        GetDistinctProjects(reference.ReferencedProjects, projectList);
                    }
                }

            }
        }
		/// <summary>デフォルトコンストラクタ。</summary>
		public GlobalStructureNumericsData()
			{
			Parameters = new ProjectList<ParameterData>();
			Functions = new ProjectList<FunctionData>();
			}
Ejemplo n.º 45
0
        private void FetchRefence(StringBuilder sbRefer, ProjectList projects, string prefix, StreamWriter outfile, bool isRoot = true)
        {
            foreach (Project project in projects)
            {
                if (isRoot)
                {
                    outfile.WriteLine();
                }
                FetchProjectRefence( project, prefix, outfile, false);
                #region change to function
                //string tempfix = prefix + " - " + project.Name;
                //Console.WriteLine(tempfix + ": " + project.ProjectPath);
                //// sbRefer.AppendLine(project.Name + ":" + project.ProjectPath);
                //outfile.WriteLine(tempfix + ": " + project.ProjectPath);
                //foreach (string refer in project.ReferenceList)
                //{
                //    Console.WriteLine(tempfix + " Assembly Refer: " + refer);
                //    // sbRefer.AppendLine(prefix +" Assembly Refer:" + refer);
                //    outfile.WriteLine(tempfix + " Assembly Refer: " + refer);
                //}
                //foreach (Project reference in project.ReferencedProjects)
                //{
                //    //if not processed output link and add to processed list
                //    if (!ProcessedLinks.Contains(project.Name + "-" + reference.Name))
                //    {
                //        // sb.Append("\"" + project.Name + "\" -> \"" + reference.Name + "\"" + Environment.NewLine);
                //        ProcessedLinks.Add(project.Name + "-" + reference.Name);
                //        foreach (string refer in reference.ReferenceList)
                //        {
                //            Console.WriteLine(tempfix + " Assembly Refer: " + refer);
                //            // sbRefer.AppendLine(prefix +" Assembly Refer:" + refer);
                //            outfile.WriteLine(tempfix + " Assembly Refer: " + refer);
                //        }
                //        Console.WriteLine(tempfix + " Project Refer: " + reference.Name);
                //        // sbRefer.AppendLine(prefix + " Project Refer:" + reference.Name);
                //        outfile.WriteLine(tempfix + " Project Refer: " + reference.Name);
                //        FetchRefence(sbRefer, reference.ReferencedProjects, tempfix, outfile, false);

                //    }

                //}
                #endregion

            }
        }
 public ResourceViewModel(Resource resource, RoleList roleList, ProjectList projectList)
 {
     Resource = resource;
     RoleList = roleList;
     ProjectList = projectList;
 }
Ejemplo n.º 47
0
 private BuildOrder(ProjectList projects)
 {
     _projects = projects;
     _buildList = new List<ProjectInfo>();
 }
Ejemplo n.º 48
0
 public BuildOrder(ProjectList projects, IEnumerable<string> buildList)
     : this(projects)
 {
     PrepareBuild(FileToProject(buildList));
 }
Ejemplo n.º 49
0
        /// <summary>
        /// Given a filepath for a JPG, get all the projects and their dependencies and output a JPG file to that path.
        /// Download graphviz from http://www.graphviz.org/pub/graphviz/ARCHIVE/graphviz-2.14.1.exe
        /// </summary>
        /// <param name="OutputJPGFilePath"></param>
        private void VisualOutput(ProjectList projects, string OutputJPGFilePath)
        {
            //get temp file for outputting dot file for graphviz
            string DOTFile = System.IO.Path.GetTempFileName();

            StringBuilder sb = new StringBuilder("");

            //beginning dot text required
            sb.Append("digraph G {" + Environment.NewLine);

            //loop through every project and output its dependencies to the file in the format
            //and then through it sdependencies and so on and so forth
            AppendProjectLinks(sb, projects);

            //ending dot text required
            sb.Append(Environment.NewLine + "}");

            //output the file for DOT to handle
            System.IO.File.WriteAllText(DOTFile, sb.ToString());
            Console.Write(sb.ToString());

            //get a reference to the registry key used for graphviz
            Microsoft.Win32.RegistryKey GraphvizKey = Microsoft.Win32.Registry.LocalMachine.OpenSubKey("Software\\ATT\\Graphviz");
            if (GraphvizKey == null) throw new ApplicationException("Unable to find Graphviz registry entry - is it installed?");

            //get path to dot.exe, should be in bin directory in install path
            string DotExePath = System.IO.Path.Combine(GraphvizKey.GetValue("InstallPath").ToString(), "bin\\dot.exe");

            //call out to graphviz to create JPG file
            System.Diagnostics.Process.Start(
                DotExePath,
                "-Tjpg \"" + DOTFile + "\" \"-o" + OutputJPGFilePath + "\""
            );

            //let's wait for it to show up, then return
            //TODO: Include some sort of timeout in case the dot.exe hangs or errors out?
            while (true)
            {
                if (System.IO.File.Exists(OutputJPGFilePath))
                    break;
                else
                    System.Threading.Thread.Sleep(500); //wait half a second before checking again
            }
        }
Ejemplo n.º 50
0
        private void ConsoleOutput(ProjectList projects, string OutputPath)
        {
            if (projects.Count == 0)
            {
                Console.WriteLine("No Project was found, please remove mainonlyflag and try again");
                return;
            }
            //loop through every project and output its dependencies to the file in the format
            //parent -> child  && Child back to parent

            string[] path = SearchPath.Split('\\');
            // string rootName =  + ;
            string rootName = string.Format("{0}_{1}", path.Length > 0 ? path[path.Length - 1] : projects[0].Name , DateTime.Now.ToString("yyyymmddhhMMss"));
            StringBuilder sbRefer = new StringBuilder();
            FileStream fs;
            if (!Directory.Exists(OutputPath))
                Directory.CreateDirectory(OutputPath);

            string target = string.Format("{0}\\{1}_relation.xml", OutputPath, rootName);
            if (File.Exists(target))
            {
                File.Delete(target);
            }

            ProjectList distinctProjects = new ProjectList();
            GetDistinctProjects(projects, distinctProjects);

            System.IO.File.WriteAllText(target, distinctProjects.ToReferenceXML());

            OutputPath = string.Format("{0}\\{1}_details", OutputPath, rootName);
            if (!Directory.Exists(OutputPath))
                Directory.CreateDirectory(OutputPath);

            foreach (Project p in distinctProjects)
            {
                target = string.Format("{0}\\{1}.txt", OutputPath, p.Name);
                if (File.Exists(target))
                {
                    File.Delete(target);
                }
                fs = System.IO.File.OpenWrite(target);
                using (StreamWriter outfile = new StreamWriter(fs))
                {
                    FetchProjectRefence(p, "Root", outfile, true);
                }
            }

            OutputPath = string.Format("{0}\\..\\{1}_ReferedBy", OutputPath, rootName);
            if (!Directory.Exists(OutputPath))
                Directory.CreateDirectory(OutputPath);
            ProcessedLinks.Clear();
            foreach (Project p in distinctProjects)
            {
                target = string.Format("{0}\\{1}.txt", OutputPath, p.Name);
                if (File.Exists(target))
                {
                    File.Delete(target);
                }
                fs = System.IO.File.OpenWrite(target);
                using (StreamWriter outfile = new StreamWriter(fs))
                {
                    FetchProjectReferedBy(p, distinctProjects, p.Name, outfile, p.Name);
                }

            }
            // Write to DB
            string rowName = PushDataIntoDB(distinctProjects, rootName);
            System.Diagnostics.Process.Start(string.Format("http://citsm.sh.ctriptravel.com/CITSM.Data/index.aspx?listid=8&DesignName=&DesignDBName={0}", rowName));
        }
		/// <summary>コピーコンストラクタ。</summary>
		/// <param name="previous"></param>
		public ProjectManifestData(ProjectManifestData previous)
			{
			ManifestVisualizingLayer = new VirtualLayer();

			_SimulationRegion = new SimulationRegionData( previous.SimulationRegion );
			SimulationTime = previous.SimulationTime;
			Resolution = previous.Resolution;
			_BackgroundMaterial = new MaterialData( previous.BackgroundMaterial );

			Sources = new ProjectList<SourceData>();
			foreach( SourceData src in previous.Sources )
				Sources.Add( src.MakeDeepCopy() );

			FluxAnalyses = new ProjectList<FluxAnalysisData>( previous.FluxAnalyses );
			foreach( FluxAnalysisData flx in previous.FluxAnalyses )
				FluxAnalyses.Add( new FluxAnalysisData( flx ) );

			VisualizationOutputs = new ProjectList<VisualizationOutputData>( previous.VisualizationOutputs );
			foreach( VisualizationOutputData vis in previous.VisualizationOutputs )
				VisualizationOutputs.Add( new VisualizationOutputData( vis ) );

			ManifestVisualizingLayer.Shapes.AddRange( SimulationRegion.Shapes );
			SimulationRegion.Parent = this;
			BackgroundMaterial.Parent = this;
			}
		/// <summary>デフォルトコンストラクタ。</summary>
		public ProjectManifestData()
			{
			ManifestVisualizingLayer = new VirtualLayer();

			SimulationRegion = new SimulationRegionData();
			SimulationTime = 0;
			Resolution = 10;
			BackgroundMaterial = new MaterialData();
			Sources = new ProjectList<SourceData>();
			FluxAnalyses = new ProjectList<FluxAnalysisData>();
			VisualizationOutputs = new ProjectList<VisualizationOutputData>();

			SimulationRegion.Parent = this;
			BackgroundMaterial.Parent = this;
			}
Ejemplo n.º 53
0
        private void FetchProjectReferedBy(Project project, ProjectList projects, string suffix, StreamWriter outfile, string rootName)
        {
            Console.WriteLine(string.Format("Try to find projects have directly refer to {0} from {1}", project.Name, rootName));

            foreach (Project parentProject in projects)
            {
                if (!ProcessedLinks.Contains(parentProject.Name + "-" + rootName))
                {
                    if (parentProject.ReferencedProjects.Any(p => p.Name == project.Name) || parentProject.ReferenceList.Contains(project.Name))
                    {
                        Console.WriteLine(string.Format("{0} --> {3}; project path is {2}", parentProject.Name, project.Name, parentProject.ProjectPath, suffix));
                        outfile.WriteLine(string.Format("{0} --> {3}; project path is {2}", parentProject.Name, project.Name, parentProject.ProjectPath, suffix));
                        suffix = string.Format(" {0} --> {1}", parentProject.Name, suffix);
                        ProcessedLinks.Add(parentProject.Name + "-" + rootName);
                        FetchProjectReferedBy(parentProject, projects, suffix, outfile, rootName);
                    }
                }
            }
        }