コード例 #1
0
 private void LoadIdentityFrom(EmployeeEntity employee)
 {
     if (employee != null)
     {
         _employeeid = employee.Id;
         Name = employee.Email;
         IsAuthenticated = true;
         AuthenticationType = "Membership";
         Roles = new MobileList<string>(GetRoles(employee.Roles));
     }
     else
     {
         _employeeid = 0;
         Name = string.Empty;
         IsAuthenticated = false;
         AuthenticationType = string.Empty;
         Roles = new MobileList<string>();
     }
 }
コード例 #2
0
        public static List<EmployeeEntity> BuildEmployees()
        {
            var cornelBrody = new EmployeeEntity
            {
                Firstname = "Cornel",
                LastName = "Brody",
                BirthDate = The.Year(1956).On.May.The10th,
                HireDate = The.Year(1999).On.February.The15th,
                Roles = EmployeeRoles.Manager,
                Email = "*****@*****.**",
                Manager = null
            };
            var mihaiBarabas = new EmployeeEntity
            {
                Firstname = "Mihai",
                LastName = "Barabas",
                BirthDate = The.Year(1978).On.July.The7th,
                HireDate = The.Year(2004).On.August.The21st,
                Roles = EmployeeRoles.Manager | EmployeeRoles.Executive,
                Email = "*****@*****.**",
                Manager = cornelBrody
            };
            var cosminMolnar = new EmployeeEntity
            {
                Firstname = "Cosmin",
                LastName = "Molnar",
                BirthDate = The.Year(1975).On.January.The24th,
                HireDate = The.Year(2012).On.May.The13th,
                Roles = EmployeeRoles.Manager | EmployeeRoles.Executive,
                Email = "*****@*****.**",
                Manager = cornelBrody
            };

            return new List<EmployeeEntity>
            {
                cornelBrody, mihaiBarabas, cosminMolnar,
                new EmployeeEntity
                {
                    Firstname = "Hr",
                    LastName = "Generic",
                    BirthDate = The.Year(1900).On.January.The1st,
                    HireDate = The.Year(2012).On.May.The13th,
                    Roles = EmployeeRoles.Hr,
                    Email = "*****@*****.**",
                    Manager = null,
                },
                new EmployeeEntity
                {
                    Firstname = "Daniel",
                    LastName = "Savu",
                    BirthDate = The.Year(1980).On.December.The12th,
                    HireDate = The.Year(2012).On.May.The13th,
                    Roles = EmployeeRoles.Executive,
                    Email = "*****@*****.**",
                    Manager = mihaiBarabas,
                },
                new EmployeeEntity
                {
                    Firstname = "Costin",
                    LastName = "Morariu",
                    BirthDate = The.Year(1977).On.July.The4th,
                    HireDate = The.Year(2012).On.May.The13th,
                    Roles = EmployeeRoles.Executive,
                    Email = "*****@*****.**",
                    Manager = mihaiBarabas,
                },
                new EmployeeEntity
                {
                    Firstname = "Ioana",
                    LastName = "Sandu",
                    BirthDate = The.Year(1983).On.March.The20th,
                    HireDate = The.Year(2012).On.May.The13th,
                    Roles = EmployeeRoles.Hr | EmployeeRoles.Executive,
                    Email = "*****@*****.**",
                    Manager = cosminMolnar,
                },
            };
        }
コード例 #3
0
 private static VacationRequestEntity BuildVacationRequest(EmployeeEntity employee)
 {
     return Builder<VacationRequestEntity>
         .CreateNew()
             .With(x => x.Id = 0)
             .And(x => x.Employee = employee)
         .Build();
 }
コード例 #4
0
 private static EmployeeSituationEntity BuildEmployeeSituation(EmployeeEntity employee)
 {
     return Builder<EmployeeSituationEntity>
         .CreateNew()
             .With(x => x.Id = 0)
             .And(x => x.Employee = employee)
         .Build();
 }
コード例 #5
0
 private static EmployeeEntity BuildEmployee(
     EmployeeRoles roles = EmployeeRoles.Executive, EmployeeEntity manager = null)
 {
     return Builder<EmployeeEntity>
         .CreateNew()
             .With(x => x.Id = 0)
             .And(x => x.Roles = roles)
             .And(x => x.Manager = manager)
         .Build();
 }