示例#1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            lbTodayPlan.Text    = ProjectPlan.GetProjectTotalToday().ToString();
            lbTodayProject.Text = Project.GetProjectTotalToday().ToString();
            lbTotalPlan.Text    = ProjectPlan.GetProjectPlanTotal().ToString();
            lbFinishedPlan.Text = ProjectPlan.GetProjectTotalFinish().ToString();
            double numerator   = ProjectPlan.GetProjectTotalFinish();
            double denominator = ProjectPlan.GetProjectPlanTotal();

            lbPlanRate.Text        = Convert.ToDouble(numerator / denominator).ToString("P");
            lbTotalProject.Text    = Project.GetProjectTotal().ToString();
            lbFinishedProject.Text = Project.GetProjectTotalFinish().ToString();
            numerator               = Project.GetProjectTotalFinish();
            denominator             = Project.GetProjectTotal();
            lbProjectRate.Text      = Convert.ToDouble(numerator / denominator).ToString("P");
            lbDelayPlan.Text        = ProjectPlan.GetProjectTotalDelay().ToString();
            numerator               = ProjectPlan.GetProjectTotalDelay();
            denominator             = ProjectPlan.GetProjectPlanTotal();
            lbDelayPlanRate.Text    = Convert.ToDouble(numerator / denominator).ToString("0.00");
            lbDelayProject.Text     = Project.GetProjectTotalDelay().ToString();
            numerator               = Project.GetProjectTotalDelay();
            denominator             = Project.GetProjectTotal();;
            lbDelayProjectRate.Text = Convert.ToDouble(numerator / denominator).ToString("0.00");
            lbDPlan.Text            = (ProjectPlan.GetProjectTotalType(CustomWithCamera) + ProjectPlan.GetProjectTotalType(CustomWithNoCamera)).ToString();
            lbDProject.Text         = (Project.GetProjectTotalPlanType(CustomWithCamera) + Project.GetProjectTotalPlanType(CustomWithNoCamera)).ToString();
            lbAPlan.Text            = ProjectPlan.GetProjectTotalType(Diy).ToString();
            lbAProject.Text         = Project.GetProjectTotalPlanType(Diy).ToString();
            lbBPlan.Text            = ProjectPlan.GetProjectTotalType(Cooperate).ToString();
            lbBProject.Text         = Project.GetProjectTotalPlanType(Cooperate).ToString();
            lbIPlan.Text            = ProjectPlan.GetProjectTotalType(InPut).ToString();
            lbIProject.Text         = Project.GetProjectTotalPlanType(InPut).ToString();
        }
示例#2
0
        public ProjectPlan GetProjectPlanById(int?id)
        {
            //IEnumerable<Person> PersonListTemp = _ctx.Persons
            //                     .OrderBy(p => p.FullName)
            //                     .ToList();

            // ProjectPlan ProjectPlanWithIdTemp_New = new ProjectPlan();
            ProjectPlan ProjectPlanWithIdTemp_Old = _ctx.ProjectPlans
                                                    .Where(s => s.Id == id)
                                                    .FirstOrDefault();

            // string[] WorkerListCodesTemp = ProjectPlanWithIdTemp_Old.WorkerListCodes.Split(',');
            //foreach (Person person in PersonListTemp)
            //{
            //    foreach (string item in WorkerListCodesTemp)
            //    {
            //        if (item == Convert.ToString(person.Id))
            //        {
            //            ProjectPlanWithIdTemp_New.WorkerList = ProjectPlanWithIdTemp_New.WorkerList + ","+  person.FullName ;
            //        }
            //    }
            //}
            // ProjectPlanWithIdTemp_Old.personList = ProjectPlanWithIdTemp_Old.WorkerListCodes.Split(',');
            // ProjectPlanWithIdTemp_New.WorkerList= ProjectPlanWithIdTemp_New.WorkerList.Remove(0,1)+",";
            //ProjectPlanWithIdTemp_Old.WorkerList = ProjectPlanWithIdTemp_New.WorkerList;
            return(ProjectPlanWithIdTemp_Old);
        }
        public void create_solution_add_project_save_and_reload_2()
        {
            // Yeah, this is a big bang test.  Just go with it.

            var solution = Solution.CreateNew("TestSolution", "Lib1.TestSolution");

            var reference = solution.AddProject("TestProject");

            reference.ProjectGuid.ShouldNotEqual(Guid.Empty);
            reference.ProjectName.ShouldEqual("TestProject");
            reference.RelativePath.ShouldEqual("TestProject".AppendPath("TestProject.csproj"));

            var plan = new ProjectPlan(reference.ProjectName);

            CodeFileTemplate.Class("Foo").Alter(reference.Project, plan);
            CodeFileTemplate.Class("Bar").Alter(reference.Project, plan);

            solution.Save();

            File.Exists("TestSolution".AppendPath("Lib1.TestSolution.sln")).ShouldBeTrue();
            File.Exists("TestSolution".AppendPath("TestProject", "TestProject.csproj")).ShouldBeTrue();

            var solution2  = Solution.LoadFrom("TestSolution".AppendPath("Lib1.TestSolution.sln"));
            var reference2 = solution2.FindProject("TestProject");

            reference2.ShouldNotBeNull();

            var project2 = reference2.Project;

            project2.ShouldNotBeNull();

            project2.All <CodeFile>().OrderBy(x => x.Include)
            .Select(x => x.Include)
            .ShouldHaveTheSameElementsAs("Bar.cs", "Foo.cs");
        }
        public void SetUp()
        {
            thePlan = TemplatePlan.CreateClean("copy-references");

            thePlan.FileSystem.WriteStringToFile("ripple.dependencies.config", @"FubuCore
FubuMVC.Core
");

            thePlan.Add(new CreateSolution("References"));
            var originalPlan = new ProjectPlan("References");

            thePlan.Add(originalPlan);
            originalPlan.Add(new SystemReference("System.Data"));
            originalPlan.Add(new SystemReference("System.Configuration"));
            originalPlan.Add(new CopyFileToProject("ripple.dependencies.config", "ripple.dependencies.config"));
            originalPlan.NugetDeclarations.Add("Bottles");
            originalPlan.NugetDeclarations.Add("FubuMVC.Core");
            originalPlan.NugetDeclarations.Add("FubuLocalization");

            testingPlan = new ProjectPlan("References.Testing");
            thePlan.Add(testingPlan);
            thePlan.Add(new CopyProjectReferences("References"));


            thePlan.Execute();

            theOriginalProject = thePlan.Solution.FindProject("References").Project;
            theTestingProject  = thePlan.Solution.FindProject("References.Testing").Project;
        }
示例#5
0
        public void SetUp()
        {
            var context = TemplatePlan.CreateClean("assembly-info");

            context.Add(new CreateSolution("AssemblyInfoSolution"));

            var project = new ProjectPlan("MyProject");

            context.Add(project);

            var system = new FileSystem();

            system.CreateDirectory("assembly-info");
            system.CreateDirectory("assembly-info", "src");
            system.CreateDirectory("assembly-info", "src", "MyProject");
            system.CreateDirectory("assembly-info", "src", "MyProject", "Properties");


            var expectedPath = "assembly-info".AppendPath("src", "MyProject", "Properties", "AssemblyInfo.cs");

            system.WriteStringToFile(expectedPath, @"using System.Reflection;

[assembly: AssemblyTitle('MyProject')]
".Replace("'", "\""));

            var alteration = new AssemblyInfoAlteration("using System.Reflection;", "[assembly: AssemblyTitle(\"%ASSEMBLYNAME%\")]", "using FubuMVC.Core;", "[assembly: FubuModule]");

            project.Add(alteration);

            context.Execute();

            theProject  = CsProjFile.LoadFrom("assembly-info".AppendPath("src", "MyProject", "MyProject.csproj"));
            theContents =
                new FileSystem().ReadStringFromFile(expectedPath);
        }
示例#6
0
    {//最简单、原始的、可能的查询计划
        public Plan createPlan(QueryData data, Transaction tx)
        {
            //第一步:为每一个出现的表或者视图定义创建一个plan
            List <Plan> plans = new List <Plan>();

            foreach (string tblname in data.tables())
            {
                string viewdef = SimpleDB.mdMgr().getViewDef(tblname, tx);
                if (viewdef != null)
                {
                    plans.Add(SimpleDB.planner().createQueryPlan(viewdef, tx));
                }
                else
                {
                    plans.Add(new TablePlan(tblname, tx));
                }
            }

            //第二步:创建所有表计划的叉积运算
            Plan p = plans[0];

            plans.RemoveAt(0);
            foreach (Plan nextplan in plans)
            {
                p = new ProductPlan(p, nextplan);
            }

            //第三步:为predicate添加一个选择运算selection
            p = new SelectPlan(p, data.pred());

            //第四步:做字段名称上的投影运算
            p = new ProjectPlan(p, data.fields());
            return(p);
        }
示例#7
0
 public void WritePreview()
 {
     this.Logger.Starting(this._steps.Count);
     this._substitutions.Trace(this.Logger);
     GenericEnumerableExtensions.Each <ITemplateStep>(this._steps, delegate(ITemplateStep x)
     {
         this.Logger.TraceStep(x);
         ProjectPlan project = x as ProjectPlan;
         if (project != null)
         {
             this.Logger.StartProject(project.Alterations.Count);
             project.Substitutions.Trace(this.Logger);
             GenericEnumerableExtensions.Each <IProjectAlteration>(project.Alterations, delegate(IProjectAlteration alteration)
             {
                 this.Logger.TraceAlteration(this.ApplySubstitutions(alteration.ToString()));
             });
             this.Logger.EndProject();
         }
     });
     string[] projectsWithNugets = this.determineProjectsWithNugets();
     if (projectsWithNugets.Any <string>())
     {
         Console.WriteLine();
         Console.WriteLine("Nuget imports:");
         GenericEnumerableExtensions.Each <string>(projectsWithNugets, delegate(string x)
         {
             Console.WriteLine(x);
         });
     }
 }
示例#8
0
        public string DeleteProjectPlan(int projectplanid)
        {
            ProjectPlan projectplan = ProjectPlanRepository.GetProjectPlans().SingleOrDefault(c => c.ProjectPlanID == projectplanid);

            int deletedprojectplan = Task.Run <int>(async() => await ProjectPlanRepository.DeleteProjectPlan(projectplanid)).Result;

            return(deletedprojectplan > 0 ? "Successfully Deleted project plan record" : "Deletion failed");
        }
示例#9
0
        public void SetUp()
        {
            new FileSystem().DeleteDirectory("Templated");
            new FileSystem().CreateDirectory("Templated");

            theProject = CsProjFile.CreateAtSolutionDirectory("TemplatedProject", "Templated");
            thePlan    = new ProjectPlan(theProject.ProjectName);
        }
 public IHttpActionResult UpdateProjectPlan(ProjectPlan projectplan)
 {
     if (!ModelState.IsValid)
     {
         return(BadRequest("Not a valid model"));
     }
     Task.Run(async() => await _ProjectPlan.UpdateProjectPlan(projectplan));
     return(Ok());
 }
示例#11
0
        public IActionResult DeleteProjectPlan(int id, ProjectPlanViewModel model)
        {
            ProjectPlan projectPlan = _repository.GetProjectPlanById(id);

            _repository.DeleteEntity(projectPlan);

            _repository.SaveAll();
            return(RedirectToAction("AllProjectPlan"));
        }
        public async Task <int> DeleteProjectPlan(int projectplanid)
        {
            ProjectPlan projectplan = await FetchbyDocumentById(projectplanid);

            db.ProjectPlans.Remove(projectplan);
            int result = await db.SaveChangesAsync();

            return(result);
        }
示例#13
0
 public async Task <IActionResult> Post([FromBody] ProjectPlan projectPlanForInsert, int employeeId)
 {
     //var projectPlan = _mapper.Map<ProjectPlan>(projectPlanForInsert);
     if (!await _logic.Insert(projectPlanForInsert))
     {
         return(BadRequest("Neuspešno sačuvan plan projekta"));
     }
     return(Ok());
 }
示例#14
0
 public async Task <IActionResult> Put(int id, [FromBody] ProjectPlan projectPlan)
 {
     //var projectPlan = _mapper.Map<ProjectPlan>(projectPlanForUpdate);
     if (!await _logic.Update(projectPlan))
     {
         return(BadRequest("Neuspešno izmenjen plan projekta"));
     }
     return(Ok());
 }
        public async Task <int> AddProjectPlan(ProjectPlan projectplan)
        {
            db.ProjectPlans.Add(projectplan);
            await db.SaveChangesAsync();

            int insertedProjectPlanid = projectplan.ProjectPlanID;

            return(insertedProjectPlanid);
        }
 public void get_namespace_shallow()
 {
     ProjectPlan.GetNamespace("Foo", "Lib1").ShouldEqual("Lib1");
     ProjectPlan.GetNamespace("Foo.cs", "Lib1").ShouldEqual("Lib1");
     ProjectPlan.GetNamespace("Sub/Foo.cs", "Lib1").ShouldEqual("Lib1.Sub");
     ProjectPlan.GetNamespace("Sub/Foo", "Lib1").ShouldEqual("Lib1.Sub");
     ProjectPlan.GetNamespace("Sub/Other/Foo", "Lib1").ShouldEqual("Lib1.Sub.Other");
     ProjectPlan.GetNamespace("Sub/Other/Foo.cs", "Lib1").ShouldEqual("Lib1.Sub.Other");
 }
示例#17
0
 public BusinessCase(
     ProjectMandate projectMandate,
     ProjectBrief projectBrief,
     ProjectPlan projectPlan,
     SeniorUser[] seniorUsers,
     Executive executive,
     RiskRegister riskRegister,
     IssueRegister issueRegister
     ) => throw new NotImplementedException();
示例#18
0
        protected override void configurePlan(string directory, TemplatePlan plan)
        {
            ProjectPlan current = plan.Steps.OfType <ProjectPlan>().LastOrDefault <ProjectPlan>();

            GenericEnumerableExtensions.Each <ProjectDirectory>(ProjectDirectory.PlanForDirectory(directory), delegate(ProjectDirectory x)
            {
                current.Add(x);
            });
        }
        public async Task <int> UpdateProjectPlan(ProjectPlan projectplan)
        {
            ProjectPlan existingProjectplan = await FetchbyDocumentById(projectplan.ProjectPlanID);

            db.Entry(existingProjectplan).State = EntityState.Detached;
            db.Entry(projectplan).State         = EntityState.Modified;
            int result = await db.SaveChangesAsync();

            return(result);
        }
示例#20
0
 public EndProjectReport(
     ProjectInitiationDocumentation projectInitiationDocumentation,
     BusinessCase businessCase,
     ProjectPlan projectPlan,
     BenefitsManagementApproach benefitsManagementApproach,
     IssueRegister issueRegister,
     QualityRegister qualityRegister,
     RiskRegister riskRegister,
     LessonsLog lessonsLog,
     EndStageReport endStageReport
     ) => throw new NotImplementedException();
示例#21
0
 public EndStageReport(
     StagePlan stagePlan,
     ProjectPlan projectPlan,
     BenefitsManagementApproach benefitsManagementApproach,
     IssueRegister issueRegister,
     QualityRegister qualityRegister,
     RiskRegister riskRegister,
     ExceptionReport exceptionReport,
     LessonsLog lessonsLog,
     WorkPackage[] workPackages,
     BusinessCase businessCase
     ) => throw new NotImplementedException();
示例#22
0
        public bool IsProjectPlanExist(int projectid)
        {
            bool        isprojectplanexist = false;
            ProjectPlan projectplan        = ProjectPlanRepository.GetProjectPlans().FirstOrDefault(c => c.ProjectID == projectid);

            if (projectplan != null)
            {
                isprojectplanexist = true;
            }

            return(isprojectplanexist);
        }
示例#23
0
 public void UpdateProject(ProjectViewModel m)
 {
     using (new TransactionScope(TransactionScopeOption.Suppress))
     {
         var now = DateTime.UtcNow;
         var d   = new NKDC(_users.ApplicationConnectionString, null);
         var p   = new Project();
         p.ProjectName           = (m.ProjectName == "null") ? null : m.ProjectName;
         p.Comment               = (m.Comment == "null") ? null : m.Comment;
         p.ProjectID             = Guid.NewGuid();
         p.VersionOwnerContactID = m.Creator;
         p.VersionUpdated        = now;
         p.VersionUpdatedBy      = m.User;
         d.Projects.AddObject(p);
         var n = new ProjectPlan();
         n.ProjectPlanID         = Guid.NewGuid();
         n.ProjectID             = p.ProjectID;
         n.ProjectPlanName       = "Resource Modelling";
         n.ResponsibleContactID  = m.Creator;
         n.VersionOwnerContactID = m.User;
         n.VersionUpdated        = now;
         n.VersionUpdatedBy      = m.User;
         d.ProjectPlans.AddObject(n);
         var t = new ProjectPlanTask();
         t.ProjectPlanTaskID     = Guid.NewGuid();
         t.ProjectPlanID         = n.ProjectPlanID;
         t.ProjectTaskName       = m.StageName;
         t.VersionOwnerContactID = m.Creator;
         t.VersionUpdated        = now;
         t.VersionUpdatedBy      = m.User;
         d.ProjectPlanTasks.AddObject(t);
         var tr = new ProjectPlanTask();
         tr.ProjectPlanTaskID     = Guid.NewGuid();
         tr.ProjectPlanID         = n.ProjectPlanID;
         tr.ProjectTaskName       = "Review";
         tr.VersionOwnerContactID = m.Reviewer;
         tr.VersionUpdated        = now.AddSeconds(-1); //This is not the current task
         tr.VersionUpdatedBy      = m.User;
         d.ProjectPlanTasks.AddObject(tr);
         var tc = new ProjectPlanTask();
         tc.ProjectPlanTaskID     = Guid.NewGuid();
         tc.ProjectPlanID         = n.ProjectPlanID;
         tc.ProjectTaskName       = "Complete";
         tc.VersionOwnerContactID = m.User;
         tc.VersionUpdated        = now.AddSeconds(-1); //This is not the current task
         tc.VersionUpdatedBy      = m.User;
         d.ProjectPlanTasks.AddObject(tr);
         d.SaveChanges();
     }
 }
        public void project_plan_applies_the_dot_net_version()
        {
            thePlan = TemplatePlan.CreateClean("create-solutionProject");
            thePlan.Add(new CreateSolution("MySolution"));
            var projectPlan = new ProjectPlan("MyProject");

            thePlan.Add(projectPlan);

            thePlan.Execute();

            var file = thePlan.SourceDirectory.AppendPath("MyProject", "MyProject.csproj");

            File.Exists(file).ShouldBeTrue();

            var project = CsProjFile.LoadFrom(file);

            project.DotNetVersion.ShouldEqual(DotNetVersion.V40);
        }
        public void adds_the_project_file_to_the_csproj_file_as_Content()
        {
            thePlan = TemplatePlan.CreateClean("copy-file-to-project");

            thePlan.Add(new CreateSolution("MySolution"));
            var projectPlan = new ProjectPlan("MyProject");

            thePlan.Add(projectPlan);

            thePlan.FileSystem.WriteStringToFile("foo.txt", "some text");
            projectPlan.Add(new CopyFileToProject("foo.txt", "foo.txt"));

            thePlan.Execute();

            var project = CsProjFile.LoadFrom("copy-file-to-project".AppendPath("src", "MyProject", "MyProject.csproj"));

            project.Find <Content>("foo.txt").ShouldNotBeNull();
        }
        public void copy_a_deep_path_to_the_right_spot()
        {
            thePlan = TemplatePlan.CreateClean("copy-file-to-project");

            thePlan.Add(new CreateSolution("MySolution"));
            var projectPlan = new ProjectPlan("MyProject");

            thePlan.Add(projectPlan);

            thePlan.FileSystem.WriteStringToFile("foo.txt", "some text");
            projectPlan.Add(new CopyFileToProject("bar/folder/foo.txt", "foo.txt"));

            thePlan.Execute();

            var file = FileSystem.Combine(thePlan.SourceDirectory, "MyProject", "bar", "folder", "foo.txt");

            File.Exists(file).ShouldBeTrue();
        }
示例#27
0
        public async Task <string> UpdateProjectPlan(ProjectPlan projectplans)
        {
            string      mailSent    = "";
            string      MailSubject = "Project Plan Status";
            string      MailBody    = "";
            ProjectPlan projectplan = ProjectPlanRepository.GetProjectPlans().FirstOrDefault(c => c.ProjectPlanID == projectplans.ProjectPlanID);

            if (projectplan == default(ProjectPlan))
            {
                return("projectplan doen't exist");
            }
            else
            {
                projectplan.ProjectPlanStatus = projectplans.ProjectPlanStatus;
                projectplan.ReopenReason      = projectplans.ReopenReason;
                projectplan.CreatedDate       = DateTime.Now;
            }

            if (projectplans.ProjectPlanStatus == "Submitted")
            {
                MailBody = "Project Plan has been submitted.Kindly approve.";
            }
            if (projectplans.ProjectPlanStatus == "Rejected")
            {
                MailBody = "Project Plan has been rejected by following reason <br/><br/>" + projectplans.ReopenReason;
            }
            if (projectplans.ProjectPlanStatus == "Approved")
            {
                MailBody = "Project Plan has been Approved.";
            }
            if (projectplans.ProjectPlanStatus == "ReOpened")
            {
                MailBody = "Project Plan has been ReOpened by following reason <br/><br/>" + projectplans.ReopenReason;
            }

            int updateprojectplan = await ProjectPlanRepository.UpdateProjectPlan(projectplan);

            if (updateprojectplan > 0)
            {
                mailSent = Mail.SendMail(projectplans.ProjectID, projectplans.ProjectPlanStatus, MailSubject, MailBody);
            }

            return(updateprojectplan == 0 ? "Successfully updated projectplan and reply record" : "Updation failed");
        }
        public void can_write_assembly_reference_to_a_project()
        {
            var theContext = TemplatePlan.CreateClean("assembly-ref");

            theContext.Add(new CreateSolution("MySolution"));
            var projectPlan = new ProjectPlan("MyProject");

            theContext.Add(projectPlan);

            projectPlan.Add(new SystemReference("System.Configuration"));

            theContext.Execute();


            var project = CsProjFile.LoadFrom("assembly-ref".AppendPath("src", "MyProject", "MyProject.csproj"));

            project.Find <AssemblyReference>("System.Configuration")
            .ShouldNotBeNull();
        }
        public void remembers_the_last_project_plan()
        {
            var context = new TemplatePlan("something");
            var plan1   = new ProjectPlan("NewProj1");
            var plan2   = new ProjectPlan("NewProj2");

            context.Add(new GitIgnoreStep("foo"));
            context.CurrentProject.ShouldBeNull();

            context.Add(plan1);
            context.CurrentProject.ShouldBeTheSameAs(plan1);

            context.Add(new CopyFileToSolution("foo", "foo.txt"));
            context.CurrentProject.ShouldBeTheSameAs(plan1);

            context.Add(plan2);

            context.CurrentProject.ShouldBeTheSameAs(plan2);
        }
        public void applies_substitutions()
        {
            thePlan = TemplatePlan.CreateClean("copy-file-to-project");

            thePlan.Add(new CreateSolution("MySolution"));
            var projectPlan = new ProjectPlan("MyProject");

            thePlan.Add(projectPlan);
            projectPlan.Substitutions.Set("%TEAM%", "Chiefs");

            thePlan.FileSystem.WriteStringToFile("foo.txt", "*%TEAM%*");
            projectPlan.Add(new CopyFileToProject("foo.txt", "foo.txt"));

            thePlan.Execute();

            var file = FileSystem.Combine(thePlan.SourceDirectory, "MyProject", "foo.txt");

            thePlan.FileSystem.ReadStringFromFile(file).ShouldEqual("*Chiefs*");
        }