public GuidelineContentPage(Principle principle)
 {
     InitializeComponent();
     Guidelines = new ObservableCollection <Guideline>(principle.Guidelines);
     Title      = principle.Heading;
     GuidelineListView.ItemsSource = Guidelines;
 }
Пример #2
0
 public void TearDown()
 {
     mockPriciple   = null;
     principle      = null;
     testRoles      = null;
     testCredential = null;
 }
        public PrincipleDetailViewModel(Principle principle, ILogger <PrincipleDetailViewModel> logger)
        {
            Analytics.TrackEvent($"{nameof(PrincipleDetailViewModel)}-{principle.Name}");

            Principle = principle;
            Title     = Principle.Name;
        }
Пример #4
0
        public async Task <IActionResult> Edit(int id, [Bind("PrincipleID,PrincipleName,TeamID,StrategyPlan,TechnicalID")] Principle principle)
        {
            if (id != principle.PrincipleID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(principle);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!PrincipleExists(principle.PrincipleID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["TeamID"]      = new SelectList(_context.Teams, "TeamID", "TeamID", principle.TeamID);
            ViewData["TechnicalID"] = new SelectList(_context.Technicals, "TechnicalID", "TechnicalID", principle.TechnicalID);
            return(View(principle));
        }
Пример #5
0
        public Response Post(Principle principle)
        {
            _principleService.Create(principle);

            return(new Response {
                Body = "success"
            });
        }
Пример #6
0
        public Response Update(Principle principle)
        {
            _principleService.Update(principle);

            return(new Response {
                Body = "success"
            });
        }
Пример #7
0
        public IActionResult Principleinfo(Principle p)
        {
            ORM.Principle.Add(p);
            ORM.SaveChanges();

            ViewBag.massage = "This is field have been Successful ";

            return(View());
        }
Пример #8
0
        public Principle ToDomain(PrincipleEntity entity)
        {
            Principle domain = new Principle {
            };

            _itemMapper.ToDomain(entity, domain);

            return(domain);
        }
Пример #9
0
        public PrincipleEntity ToEntity(Principle domain)
        {
            PrincipleEntity entity = new PrincipleEntity {
            };

            _itemMapper.ToEntity(domain, entity);

            return(entity);
        }
Пример #10
0
        public void Delete(int id)
        {
            var Principle = new Principle
            {
                Principle_id = id
            };

            unitOfWork.PrincipleRepository.Delete(Principle);
            unitOfWork.Save();
        }
Пример #11
0
        public void Setup()
        {
            var mockPrinciple = new Mock <Principle>();

            principle = mockPrinciple.Object;

            mockAutheticationManager = new Mock <AuthenticationManager>();
            mockAutheticationManager.Setup(auth => auth.GetPrinciple()).Returns(principle);
            authenticationManager = mockAutheticationManager.Object;
        }
Пример #12
0
        public void Create(PrincipleViewModel PrincipleViewModel)
        {
            var Principle = new Principle
            {
                Principle_name = PrincipleViewModel.Principle_name,
                CountryId      = PrincipleViewModel.CountryId
            };

            unitOfWork.PrincipleRepository.Insert(Principle);
            unitOfWork.Save();
        }
 private void RecommendedWay()
 {
     Console.WriteLine("Recommended Way");
     Principle principleOffice = new Principle();
     ClassRooms classRoom1 = new ClassRooms(principleOffice);
     ClassRooms classRoom2 = new ClassRooms(principleOffice);
     ClassRooms classRoom3 = new ClassRooms(principleOffice);
     ClassRooms classRoom4 = new ClassRooms(principleOffice);
     ClassRooms classRoom5 = new ClassRooms(principleOffice);
     ClassRooms classRoom6 = new ClassRooms(principleOffice);
     principleOffice.RaiseAlarm();
 }
        private void RecommendedWay()
        {
            Console.WriteLine("Recommended Way");
            Principle  principleOffice = new Principle();
            ClassRooms classRoom1      = new ClassRooms(principleOffice);
            ClassRooms classRoom2      = new ClassRooms(principleOffice);
            ClassRooms classRoom3      = new ClassRooms(principleOffice);
            ClassRooms classRoom4      = new ClassRooms(principleOffice);
            ClassRooms classRoom5      = new ClassRooms(principleOffice);
            ClassRooms classRoom6      = new ClassRooms(principleOffice);

            principleOffice.RaiseAlarm();
        }
Пример #15
0
        public async Task <IActionResult> Create([Bind("PrincipleID,PrincipleName,TeamID,StrategyPlan,TechnicalID")] Principle principle)
        {
            if (ModelState.IsValid)
            {
                _context.Add(principle);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["TeamID"]      = new SelectList(_context.Teams, "TeamID", "TeamID", principle.TeamID);
            ViewData["TechnicalID"] = new SelectList(_context.Technicals, "TechnicalID", "TechnicalID", principle.TechnicalID);
            return(View(principle));
        }
        public static Principle ToRepository(this DtoPrinciple dto)
        {
            if (dto == null)
            {
                return(null);
            }
            var model = new Principle()
            {
                Id   = dto.Id,
                Name = dto.Name
            };

            return(model);
        }
        public static DtoPrinciple ToDTO(this Principle model)
        {
            if (model == null)
            {
                return(null);
            }
            var dto = new DtoPrinciple()
            {
                Id   = model.Id,
                Name = model.Name
            };

            return(dto);
        }
Пример #18
0
        public void Setup()
        {
            testUsername      = "******";
            testCredential    = new Mock <Credential>().Object;
            testIsActiveValue = true;
            testRoles         = new List <Role>();
            testRoles.Add(new Mock <Role>().Object);

            mockPriciple = new Mock <Principle>();
            mockPriciple.Setup(principle => principle.GetUsername()).Returns(testUsername);
            mockPriciple.Setup(principle => principle.GetCredential()).Returns(testCredential);
            mockPriciple.Setup(principle => principle.IsActive()).Returns(testIsActiveValue);
            mockPriciple.Setup(principle => principle.GetRoles()).Returns(testRoles);

            principle = mockPriciple.Object;
        }
Пример #19
0
        private IPrincipleManager GetPrincipleManager(Principle principle)
        {
            switch (principle)
            {
            case Principle.Encapsulation:
                return(new EncapsulationManager());

            case Principle.Inheritance:
                return(new InheritanceManager());

            case Principle.Polymorphism:
                return(new PolymorphismManager());

            default:
                throw new Exception("Отсутствует реализация");
            }
        }
Пример #20
0
    //COMBINE PRINCIPLES
    void CheckPrincipleCombination(Principle principle)
    {
        CombinationDicctionary.Principles secondCard = Cards[1].GetComponent <Principle>().PrincipleType;

        switch (principle.PrincipleType)
        {
        case (CombinationDicctionary.Principles.Arcana):
            if (secondCard == CombinationDicctionary.Principles.Death || secondCard == CombinationDicctionary.Principles.Light)
            {
                // LVL UP
            }
            break;

        case (CombinationDicctionary.Principles.Death):
            //LVL UP
            break;

        case (CombinationDicctionary.Principles.Light):
            if (secondCard == CombinationDicctionary.Principles.Arcana)
            {
                //LVL UP
            }
            break;

        case (CombinationDicctionary.Principles.Nature):
            if (secondCard == CombinationDicctionary.Principles.Owl || secondCard == CombinationDicctionary.Principles.Death)
            {
                //LVL UP
            }
            break;

        case (CombinationDicctionary.Principles.Owl):
            if (secondCard == CombinationDicctionary.Principles.Arcana || secondCard == CombinationDicctionary.Principles.Stone)
            {
                //LVL UP
            }
            break;

        case (CombinationDicctionary.Principles.Stone):
            if (secondCard == CombinationDicctionary.Principles.Light || secondCard == CombinationDicctionary.Principles.Owl)
            {
                //LVL UP
            }
            break;
        }
    }
Пример #21
0
        protected override void OnModelCreating(ModelBuilder modelBuilder)
        {
            base.OnModelCreating(modelBuilder);
            // Create the applcation users (2).
            modelBuilder.Entity <ApplicationUser>()
            .Property(u => u.EnrollDate)
            .HasDefaultValueSql("GETDATE()");

            ApplicationUser user = new ApplicationUser
            {
                FirstName          = "Admin",
                LastName           = "Admin",
                UserName           = "******",
                NormalizedUserName = "******",
                Email           = "*****@*****.**",
                NormalizedEmail = "*****@*****.**",
                EmailConfirmed  = true,
                LockoutEnabled  = false,
                SecurityStamp   = Guid.NewGuid().ToString("D"),
                EnrollDate      = new DateTime(2008, 10, 15)
            };
            var passwordHash = new PasswordHasher <ApplicationUser>();

            user.PasswordHash = passwordHash.HashPassword(user, "Admin8*");
            modelBuilder.Entity <ApplicationUser>().HasData(user);

            ApplicationUser user2 = new ApplicationUser
            {
                FirstName          = "Guest",
                LastName           = "Guest",
                UserName           = "******",
                NormalizedUserName = "******",
                Email           = "*****@*****.**",
                NormalizedEmail = "*****@*****.**",
                EmailConfirmed  = true,
                LockoutEnabled  = false,
                SecurityStamp   = Guid.NewGuid().ToString("D"),
                EnrollDate      = new DateTime(2010, 11, 10)
            };
            var passwordHash2 = new PasswordHasher <ApplicationUser>();

            user2.PasswordHash = passwordHash2.HashPassword(user2, "Admin10*");
            modelBuilder.Entity <ApplicationUser>().HasData(user2);

            /******************** PRINCIPLES ********************/
            var principles = new Principle[]
            {
                // SOLID
                new Principle
                {
                    PrincipleId          = 1,
                    PrincipleImage       = "~/Images/SOLID_Img.png",
                    PrincipleName        = "S.O.L.I.D.",
                    PrincipleDescription = "SOLID is an acronym for the first five object-oriented design(OOD) principles by Robert C. Martin. These principles, when combined together, make it easy for a programmer to develop software that are easy to maintain and extend, and are also a part of agile, an adaptive software development principle. [S]ingle Responsibility Principle, [O]pen/ Closed Principle, [L]iskov Substitution Principle, [I]ntegration Segregation Principle, [D]ependency Inversion Principle",
                    UserId = null
                },

                // OPP
                new Principle
                {
                    PrincipleId          = 2,
                    PrincipleImage       = "~/Images/OOP_Img.png",
                    PrincipleName        = "O.O.P.",
                    PrincipleDescription = "Object Oriented Programming(OOP) is a language model that is organized around objects rather than actions and data rather than logic. There are four pillars of OOP: Abstraction, Polymorphism, Inheritance, and Encapsulation. You can remember this mnemonic device - A.P.I.E., because pie is awesome!",
                    UserId = null
                },

                // SRP
                new Principle
                {
                    PrincipleId          = 3,
                    PrincipleImage       = "~/Images/AGILE_Img.png",
                    PrincipleName        = "Agile",
                    PrincipleDescription = "There are four values derived from the Agile Manifesto: Individuals and Interactions Over Processes and Tools, Working Software Over Comprehensive Documentation, Customer Collaboration Over Contract Negotiation, Responding to Change Over Following a Plan.",
                    UserId = null
                }
            };

            modelBuilder.Entity <Principle>().HasData(principles);

            /******************** WHITEBOARD ********************/

            var whiteboards = new Whiteboard[]
            {
                // Median of Arrays
                new Whiteboard
                {
                    WhiteboardId          = 1,
                    WhiteboardImage       = "~/Images/MedianArrays_Img.png",
                    WhiteboardName        = "Median of Arrays",
                    WhiteboardDescription = "Find the median of two sorted arrays.",
                    UserId = null
                },
                // Fizz Buzz
                new Whiteboard
                {
                    WhiteboardId          = 2,
                    WhiteboardImage       = "~/Images/FizzBuzz_Img.png",
                    WhiteboardName        = "Fizz Buzz",
                    WhiteboardDescription = "Write a program that prints the numbers from 1 to 100 (here I have only written it for 1 to 15). But for multiples of three print 'Fizz' instead of the number and for the multiples of five print 'Buzz'. For numbers which are multiples of both three and five print 'FizzBuzz'.",
                    UserId = null
                }
            };

            modelBuilder.Entity <Whiteboard>().HasData(whiteboards);

            /******************** INTERVIEW QUESTIONS ********************/
            var intQuestions = new IntQuestion[]
            {
                // Question 1
                new IntQuestion {
                    IntQuestionId          = 1,
                    IntQuestionName        = "What are the two types of pop-ups?",
                    IntQuestionDescription = "Alert and Prompt.",
                    UserId = null
                },
                // Question 2
                new IntQuestion {
                    IntQuestionId          = 2,
                    IntQuestionName        = "What is the disadvantage of using : 'innerHTML'?",
                    IntQuestionDescription = "Content can be replaced anywhere.",
                    UserId = null
                },
                // Question 3
                new IntQuestion {
                    IntQuestionId          = 3,
                    IntQuestionName        = "What is the difference between var and let?",
                    IntQuestionDescription = "var is function-scoped and let is block-scoped.",
                    UserId = null
                },
                // Question 4
                new IntQuestion {
                    IntQuestionId          = 4,
                    IntQuestionName        = "What is the difference between '==' and '==='?",
                    IntQuestionDescription = "The first option == checks value equality, whereas === returns false, and checks both type and value equality.",
                    UserId = null
                }
            };

            modelBuilder.Entity <IntQuestion>().HasData(intQuestions);

            /******************** HELPFUL LINKS ********************/
            var helpfulLinks = new HelpfulLink[]
            {
                // Link 1
                new HelpfulLink {
                    HelpfulLinkId   = 1,
                    LinkUrl         = "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference",
                    LinkDescription = "JavaScript language Documentation",
                    UserId          = null
                },
                // Link 2
                new HelpfulLink {
                    HelpfulLinkId   = 2,
                    LinkUrl         = "https://docs.microsoft.com/en-us/dotnet/csharp/",
                    LinkDescription = "C# language Documentation",
                    UserId          = null
                },
                // Link 3
                new HelpfulLink {
                    HelpfulLinkId   = 3,
                    LinkUrl         = "https://reactjs.org/docs/getting-started.html",
                    LinkDescription = "React - Getting Started",
                    UserId          = null
                }
            };

            modelBuilder.Entity <HelpfulLink>().HasData(helpfulLinks);
        }
Пример #22
0
        public void Create(Principle domain)
        {
            _modelServiceTools.InitialiseNewItem(domain);

            _lifeManagerRepository.SaveEntity(_principleMapper.ToEntity(domain));
        }
 public ClassRooms(Principle principleOffice)
 {
     ClassId = counter++;
     principleOffice.RaiseAlarmEvent += principleOffice_RaiseAlarmEvent;
 }
Пример #24
0
        public void Update(Principle domain)
        {
            _modelServiceTools.UpdateProcessing <PrincipleEntity>(domain);

            _lifeManagerRepository.SaveEntity(_principleMapper.ToEntity(domain));
        }
 public ClassRooms(Principle principleOffice)
 {
     ClassId = counter++;
     principleOffice.RaiseAlarmEvent += principleOffice_RaiseAlarmEvent;
 }
Пример #26
0
 public void TearDown()
 {
     principle = null;
     mockAutheticationManager = null;
     authenticationManager    = null;
 }