예제 #1
0
        static void Main(string[] args)
        {
            FullTimeEmployee ft = new FullTimeEmployee();

            ft.FullTimeId = 1001;
            ft.FirstName  = "Mary";
            ft.LastName   = "Mitchel";
            ft.PrintFullName();

            Console.WriteLine("*****************");

            PartTimeEmployee pt = new PartTimeEmployee();

            pt.PartTimeID = 3025;
            pt.FirstName  = "Peter";
            pt.LastName   = "Parker";
            pt.PrintFullName();

            Console.WriteLine("*****************");

            HumanResources hr = new HumanResources();

            hr.FirstName = "Andi";
            hr.LastName  = "Mason";
            hr.PrintFullName();


            Console.ReadLine();
        }
예제 #2
0
        public static void Main(string[] args)
        {
            FullTimeEmployee ft = new FullTimeEmployee();

            ft.FullTimeId = 1001;
            ft.FirstName  = "Mary";
            ft.LastName   = "Mithchel";
            ft.PrintFullName();

            Console.WriteLine("");

            PartTimeEmployee pt = new PartTimeEmployee();

            pt.PartTimeID = 3005;
            pt.FirstName  = "Peter";
            pt.LastName   = "Parker";
            pt.PrintFullName();

            Console.WriteLine("Boss B status");

            HumanResources hr = new HumanResources();

            hr.FirstName  = "Taylor";
            hr.LastName   = "Johnson";
            hr.FullTimeId = 2001;

            SeasonalWorkers sw = new SeasonalWorkers();

            sw.FullTimeId = 7001;
            sw.FirstName  = "Janet";

            Console.WriteLine("");

            Console.ReadLine();
        }
예제 #3
0
        static void Main(string[] args)
        {
            double baseBudget = 75000.00;

            var myHR = new HumanResources("Inhuman Resources", "3rd", 100, "4 year");

            myHR.AddPolicy("Lorem Ipsum Policy", "Leverage agile frameworks to provide a robust synopsis for high level overviews. Iterative approaches to corporate strategy foster collaborative thinking to further the overall value proposition.");

            var myQA = new QualityAssurance("Key-Bashers", "4th", 10, "36 month");

            myQA.AddProductToTest("Happy AI", "Is angsty, listening to Emmure all the time, and refusing to believe in, quote: 'your imposed fallacy of happiness' end quote.");

            var myFrontEnd = new FrontEndDevs("Code Monkeys", "basement", 5, "2 year");

            myFrontEnd.AddNewFramework("fooVue", "SUCH a cool new framework. It does it all and then some! Oh I built it myself, obviously, since no other framework does what I NEED.");

            var myCompany = new List <Department>
            {
                myHR, myQA, myFrontEnd
            };

            foreach (Department d in myCompany)
            {
                Console.WriteLine(d.SetBudget(baseBudget));
            }

            Console.WriteLine($"myCompary is comprised of {myCompany.Count} departments");

            Console.ReadKey();
        }
예제 #4
0
        public void IfLeaveDaysIsLessThanOrEqualTo10()
        {
            LeaveRequest request = new LeaveRequest
            {
                Employee  = "Mike",
                LeaveDays = 9
            };

            ILeaveRequestHandler teamLeader     = new TeamLeader();
            ILeaveRequestHandler projectManager = new ProjectManager();
            ILeaveRequestHandler humanResources = new HumanResources();

            teamLeader.NextHandler     = projectManager;
            projectManager.NextHandler = humanResources;

            var actual = teamLeader.HandleRequest(request);

            Assert.AreEqual("Leave request approved by team leader", actual);
        }
예제 #5
0
        static void Main(string[] args)
        {
            HumanResources hr = new HumanResources();
            var            e1 = new Employee(); e1.Name = "mircea dobreanu";
            var            e2 = new Employee(); e2.Name = "vladimir lenin";
            var            e3 = new Employee(); e3.Name = "anna pauker";
            var            e4 = new Employee(); e4.Name = "benito";

            hr.AddEmployee(null, e2);
            hr.AddManager(e2);
            hr.AddEmployee(e2, e1);
            hr.AddEmployee(e2, e3);

            Console.WriteLine("employees of {0}", e2.Name);
            foreach (var emp in hr.GetEmployeesOf(e2))
            {
                Console.WriteLine(emp.Name);
            }

            Console.WriteLine("Manager of {0} is {1}", e3.Name, hr.GetManagerOf(e3).Name);
        }
예제 #6
0
        static void Main(string[] args)
        {
            var departments = new List <DepartmentBase>();

            var hr    = new HumanResources("Human Resources", "Amy Shumer", 42);
            var sales = new Sales("Sales", "Frank Ocean", 42);

            hr.AddPolicy("Attendance", "You better come to work!");
            hr.AddTraining("How to Sell Stuff & Things", "Do it...Do it.");
            departments.Add(hr);
            sales.Travel("Santa Monica", "get a tan");
            departments.Add(sales);


            foreach (var d in departments)
            {
                Console.WriteLine($"{d.ToString()}");
            }


            Console.ReadLine();
        }
예제 #7
0
        static void Main(string[] args)
        {
            HumanResources Staff = new HumanResources();

            Staff.StartMenu();
        }
예제 #8
0
            public async Task <Result <TokenInfo> > Handle(Contract request, CancellationToken cancellationToken)
            {
                string config = _configuration[$"Permissions:AllowSignUp"];
                string autoGenerateRegistrationId = _configuration[$"Permissions:AutoGenerateRegistrationId"];

                if (config == "True" || request.UserRole == "Admin")
                {
                    var emailResult = Email.Create(request.Email);
                    if (emailResult.IsFailure)
                    {
                        return(Result.Fail <TokenInfo>(emailResult.Error));
                    }
                    if (request.UserRole != "Admin")
                    {
                        request.Role = "Student";
                    }

                    User user = null;
                    switch (request.Role)
                    {
                    case "Admin":
                        user = new Admin(request.Username, request.Name, request.Email, request.Username.ToUpper(), false);
                        break;

                    case "HumanResources":
                        user = new HumanResources(request.Username, request.Name, request.Email, request.Username.ToUpper(), false);
                        break;

                    case "Author":
                        user = new Author(request.Username, request.Name, request.Email, request.Username.ToUpper(), false);
                        break;

                    case "Secretary":
                        user = new Secretary(request.Username, request.Name, request.Email, request.Username.ToUpper(), false);
                        break;

                    case "Student":
                        user = new Student(request.Username, request.Name, request.Email, request.Username.ToUpper(), false);
                        break;

                    default:
                        return(Result.Fail <TokenInfo>("Role nao existe"));
                    }
                    user.FirstAccess   = false;
                    user.EmailVerified = false;
                    user.Cpf           = request.Cpf;
                    user.Info          = request.Info;
                    user.Phone         = request.Phone;
                    user.ImageUrl      = request.ImageUrl;

                    if (autoGenerateRegistrationId == "True")
                    {
                        user.RegistrationId = await GetNextRegistrationId(cancellationToken);
                    }

                    var result = await _userManager.CreateAsync(user, request.Password);

                    if (!result.Succeeded)
                    {
                        var error = result.Errors.FirstOrDefault();
                        return(error != null?Result.Fail <TokenInfo>(error.Description) : Result.Fail <TokenInfo>("Erro interno ao criar usuário"));
                    }

                    var tokenResource = await _tokenGenerator.GenerateUserToken(user);

                    await SaveRefreshToken(user.Id, tokenResource.RefreshToken, cancellationToken);

                    return(Result.Ok(tokenResource));
                }
                return(Result.Fail <TokenInfo>("Acesso Negado"));
            }
예제 #9
0
    private void setupKey()
    {
        var departmentOptions = new int[] { 0, 1, 2, 3, 4 };

        departmentOptions.Shuffle(rnd);
        goalFrom = departmentOptions[0]; //Goal from

        var possGoal = new int[] { 0, 1, 2, 3, 4 };

        possGoal.Shuffle(rnd);
        if (possGoal[0] != goalFrom)
        {
            goalTo = possGoal[0]; //Goal to
        }
        else
        {
            goalTo = possGoal[1];
        }

        Debug.LogFormat("[Bureaucratic Maze #{0}] To solve: Go from {1} to {2}.", _moduleId, departments[goalFrom].getName(), departments[goalTo].getName());

        //HR
        var hr = new int[] { 1, 2, 3, 4 }; //1,2,1,2,1,2,1,2,3,4

        hr.Shuffle(rnd);
        connectingLines[0] = hr[0]; //S
        connectingLines[1] = hr[1]; //S
        connectingLines[2] = hr[0]; //IM
        connectingLines[3] = hr[1]; //IM
        connectingLines[4] = hr[0]; //M
        connectingLines[5] = hr[1]; //M
        connectingLines[6] = hr[0]; //CC
        connectingLines[7] = hr[1]; //CC
        connectingLines[8] = hr[2]; //EB
        connectingLines[9] = hr[3]; //EB

        //IM
        var im = new int[] { 0, 2, 3, 4 }; //4,2,4,0,3,4,0,0

        im.Shuffle(rnd);
        connectingLines[10] = im[3]; //HR
        connectingLines[11] = im[1]; //HR
        connectingLines[12] = im[3]; //CC
        connectingLines[13] = im[0]; //CC
        connectingLines[14] = im[2]; //M
        connectingLines[15] = im[3]; //M
        connectingLines[16] = im[0]; //EB
        connectingLines[17] = im[2]; //EB

        //M
        var m = new int[] { 0, 1, 3, 4 }; //3,4,3,1,4,0,3,0

        m.Shuffle(rnd);
        connectingLines[18] = m[2]; //IM
        connectingLines[19] = m[3]; //IM
        connectingLines[20] = m[2]; //HR
        connectingLines[21] = m[1]; //HR
        connectingLines[22] = m[3]; //CC
        connectingLines[23] = m[0]; //CC
        connectingLines[24] = m[2]; //EB
        connectingLines[25] = m[0]; //EB

        //CC
        var cc = new int[] { 0, 1, 2, 4 }; //1,2,1,2,1,0,1,4

        cc.Shuffle(rnd);
        connectingLines[26] = cc[1]; //HR
        connectingLines[27] = cc[2]; //HR
        connectingLines[28] = cc[1]; //IM
        connectingLines[29] = cc[2]; //IM
        connectingLines[30] = cc[1]; //M
        connectingLines[31] = cc[0]; //M
        connectingLines[32] = cc[1]; //EB
        connectingLines[33] = cc[3]; //EB

        //HB
        var eb = new int[] { 0, 1, 2, 3 }; //1,2,3,2,3,0,3,0

        eb.Shuffle(rnd);
        connectingLines[34] = eb[1]; //CC
        connectingLines[35] = eb[2]; //CC
        connectingLines[36] = eb[3]; //HR
        connectingLines[37] = eb[2]; //HR
        connectingLines[38] = eb[3]; //M
        connectingLines[39] = eb[0]; //M
        connectingLines[40] = eb[3]; //IM
        connectingLines[41] = eb[0]; //IM

        HumanResources.addRoute(1, hr[0], hr[1]);
        HumanResources.addRoute(2, hr[0], hr[1]);
        HumanResources.addRoute(3, hr[0], hr[1]);
        HumanResources.addRoute(4, hr[2], hr[3]);
        HumanResources.addRoute(5, hr[0], hr[1]);

        InformationManagement.addRoute(0, im[3], im[1]);
        InformationManagement.addRoute(2, im[2], im[3]);
        InformationManagement.addRoute(3, im[3], im[0]);
        InformationManagement.addRoute(4, im[0], im[2]);

        Marketing.addRoute(0, m[2], m[1]);
        Marketing.addRoute(1, m[2], m[3]);
        Marketing.addRoute(3, m[3], m[0]);
        Marketing.addRoute(4, m[2], m[0]);

        CorporateCompliance.addRoute(0, cc[1], cc[2]);
        CorporateCompliance.addRoute(1, cc[1], cc[2]);
        CorporateCompliance.addRoute(2, cc[1], cc[0]);
        CorporateCompliance.addRoute(4, cc[1], cc[3]);

        EmployeeBenefits.addRoute(0, eb[3], eb[2]);
        EmployeeBenefits.addRoute(1, eb[3], eb[0]);
        EmployeeBenefits.addRoute(2, eb[3], eb[0]);
        EmployeeBenefits.addRoute(3, eb[1], eb[2]);
    }
예제 #10
0
        static void Main(string[] args)
        {
            const double baseBudget = 75000.00;

            // Create some instances
            HumanResources hr01 = new HumanResources("HR 1", "Toby Flenderson", 2, "Dunder Mifflin");
            HumanResources hr02 = new HumanResources("HR 2", "Jack Frost", 13, "South Pole");
            Accounting     ac01 = new Accounting("Accounting", "Angela Martin", 10, "Dunder Mifflin");
            Sales          sa01 = new Sales("Sales 1", "Michael Scott", 50, "Dunder Mifflin");

            hr01.printDetails();
            hr02.printDetails();
            ac01.printDetails();
            sa01.printDetails();


            hr01.AddPolicy("Terminating Employees", "How to give people the shaft.");
            hr01.AddPolicy("Selling Out People", "How to screw people over.");
            hr01.AddPolicy("Bankrupting the System", "How to steal like a politician.");
            hr01.printPolicies();

            sa01.AddSale("Dwight Schrute", 58975);
            sa01.AddSale("Phyllis Lapin", 48502);
            sa01.AddSale("Stanley Hudson", 1254871);
            sa01.printSalesStats();

            ac01.AddBudget("Kevin Malone", -13);
            ac01.AddBudget("Oscar Gutierrez", 4858502);
            ac01.AddBudget("Angela Martin", 101254871);
            ac01.printBudgetStats();


            // Add derived departments to the list
            List <Department> departmentsList = new List <Department>();

            departmentsList.Add(hr01);
            departmentsList.Add(hr02);
            departmentsList.Add(ac01);
            departmentsList.Add(sa01);

            foreach (Department d in departmentsList)
            {
                d.SetBudget(baseBudget);
            }

            Console.WriteLine("\nToString() method on each list object:");
            foreach (Department d in departmentsList)
            {
                Console.WriteLine($"{d.ToString()}");
            }

            // Employee E01 = new Employee("Ken", "Lewis");
            // Console.WriteLine("\n");
            // E01.printEmployee();
            // Console.WriteLine("\n");

            // Console.WriteLine("\n------------------------------------");
            // Console.WriteLine("\n------------------------------------");

            // HumanResourcesEmployee E02 = new HumanResourcesEmployee("Ted", "Nugent", "fT", 24.50);

            // E02.printEmployee();
            // Console.WriteLine("\n");
            // HumanResourcesEmployee E03 = new HumanResourcesEmployee();
            // E03.printEmployee();

            // Console.WriteLine("\n------------------------------------");
            // Console.WriteLine("\n------------------------------------");

            // SalesEmployee E04 = new SalesEmployee("Teddy", "Nugenty", "pt", 24.50);
            // E04.printEmployee();
            // Console.WriteLine("\n");
            // SalesEmployee E05 = new SalesEmployee();
            // E05.printEmployee();

            // Console.WriteLine("\n------------------------------------");
            // Console.WriteLine("\n------------------------------------");

            // AccountingEmployee E06 = new AccountingEmployee("Teddyyy", "Nugent", "FT", 2400.50);
            // E06.printEmployee();
            // Console.WriteLine("\n");
            // AccountingEmployee E07 = new AccountingEmployee();
            // E07.printEmployee();

            Console.WriteLine("\n------------------------------------");
            Console.WriteLine("------------------------------------");

            Employee hre01 = new Employee("Ted", "Nugent");
            Employee hre02 = new Employee("Eddy", "Van Halen");
            Employee hre03 = new Employee("Alice", "Cooper");

            Employee sae01 = new Employee("Johnny", "Appleseed");
            Employee sae02 = new Employee("Jack", "Ripper");
            Employee sae03 = new Employee("George", "Washington");

            Employee ace01 = new Employee("Theodore", "huxtable");
            Employee ace02 = new Employee("Peter", "Griffin");
            Employee ace03 = new Employee("Glen", "Quigmire");

            hr01.AddEmployee(hre01);
            hr01.AddEmployee(hre02);
            hr01.AddEmployee(hre03);

            sa01.AddEmployee(sae01);
            sa01.AddEmployee(sae02);
            sa01.AddEmployee(sae03);

            ac01.AddEmployee(ace01);
            ac01.AddEmployee(ace02);
            ac01.AddEmployee(ace03);


            hr01.printEmployeeList();
            sa01.printEmployeeList();
            ac01.printEmployeeList();
        }
예제 #11
0
        public List <HumanResources> GetResource(string begin, string end, int uid, string selTeam)
        {
            var teamList  = _team.Query().Get();
            var sheetList = _sheet.Query().Get();
            var oaList    = _employee.Query().Get();
            var depList   = _dep.Query().Get();
            var proList   = _pro.Query().Get();
            //var teamListArray = _team.Query().Get().ToList();
            // var humans = oaList.Where(u=>teamListArray.Any(k=>k.ResourceUid==u.UserId&k.RoleId!=1)).Select(u => new { u.UserId, u.EmployeeName }).ToList();
            var humans = new List <int>();
            var res    = new List <int>();

            if (string.IsNullOrEmpty(selTeam))
            {
                res = _ITResourceTeamService.GetCurrentUInts(uid);
            }
            //else
            //{
            //    res = _ITResourceTeamService.GetUserInts(Convert.ToInt32(selTeam));
            //}

            humans = res;
            var dates = GetDates(begin, end);
            List <HumanResources> mList = new List <HumanResources>();

            foreach (var i in dates)
            {
                foreach (var h in humans)
                {
                    List <int>     PIDList = new List <int>();
                    HumanResources hu      = new HumanResources();
                    hu.uid   = (int)h;
                    hu.dates = i;
                    var dt    = DateTime.Parse(i);
                    var proID = sheetList.Where(u => u.ResourceUid == h && u.Day == dt);
                    if (proID.Count() > 0)
                    {
                        var proIDList = proID.Select(u => u.ProjectId).ToList();
                        foreach (var item in proIDList)
                        {
                            if (!proList.Any(u => u.ProjectId == item))
                            {
                                continue;
                            }
                            else
                            {
                                hu.proID = item;
                                PIDList.Add(item);
                                // break;
                            }
                        }
                    }
                    else
                    {
                        hu.proID = -9999;
                    }

                    var hours = sheetList.Where(u => u.ResourceUid == h && u.Day == dt && PIDList.Contains(u.ProjectId));
                    if (hours.Count() > 0)
                    {
                        hu.totalHours = 0;
                        //*************************************//
                        //var pCode = (proList.Where(p => p.ProjectId == hu.proID));
                        var pCode = (proList.Where(p => PIDList.Contains(p.ProjectId)));
                        if (pCode.Count() > 0)
                        {
                            foreach (var hh in hours.ToList())
                            {
                                hu.pCode =
                                    proList.Where(p => p.ProjectId == hh.ProjectId).FirstOrDefault().ProjectName;
                                hu.hours = hh.NumOfHours.ToString();
                                string content = hu.pCode + "(" + hu.hours + ")" + "<br>";
                                hu.content    += content;
                                hu.totalHours += hh.NumOfHours;
                                var status = proList.Where(u => u.ProjectId == hh.ProjectId);
                                if (status.Count() > 0)
                                {
                                    hu.status = proList.FirstOrDefault(u => u.ProjectId == hh.ProjectId).State;
                                }
                                else
                                {
                                    hu.status = "";
                                }
                            }
                            if (hu.status == DataStatus.ProjectState.pendingByTeamLeaderEnd || hu.status == DataStatus.ProjectState.closed)
                            {
                                hu.content = hu.content.Substring(0, hu.content.Length - 4);
                            }
                            else
                            {
                                hu.content    = "";
                                hu.totalHours = -9999;
                            }
                        }
                        else
                        {
                            hu.pCode      = "";
                            hu.content    = "";
                            hu.totalHours = -9999;
                        }
                    }
                    else
                    {
                        hu.hours      = "0";
                        hu.content    = "";
                        hu.totalHours = -9999;
                    }


                    var deps = oaList.Where(u => u.UserId == h);
                    if (deps.Count() > 0)
                    {
                        int depID     = (int)deps.FirstOrDefault().DepartmentId;
                        var deptModel = depList.Where(u => u.DepartmentId == depID).FirstOrDefault();
                        if (deptModel != null)
                        {
                            hu.dep = deptModel.DepartmentName;
                        }
                        else
                        {
                            hu.dep = "";
                        }
                    }
                    else
                    {
                        hu.dep = "";
                    }


                    //hu.names = i.EmployeeName;
                    mList.Add(hu);
                }
            }
            var zx = (from u in mList
                      from d in teamList
                      where u.uid == d.ResourceUid
                      select new HumanResources()
            {
                teamID = d.TeamId, uid = u.uid, dates = u.dates, hours = u.hours, dep = u.dep, content = u.content, totalHours = u.totalHours, status = u.status
            }).ToList();

            return(zx);
        }
예제 #12
0
 public TablesManager(DataSet dataSet, string tableName)
 {
     _humanResources = new HumanResources();
     _humanResources.Load(dataSet, tableName);
 }
예제 #13
0
 public DepartmentFacade()
 {
     _humanResources = new HumanResources();
     _finance        = new Finance();
 }
    private IEnumerator LoadHumanResourceJobLimits()
    {
        UnityWebRequest www = UnityWebRequest.Get("http://18.223.239.177/hello/gethr/" + DB.GameCode);

        yield return(www.SendWebRequest());

        if (www.isNetworkError || www.isHttpError)
        {
            Debug.Log(www.error);
        }
        else
        {
            JsonData       = www.downloadHandler.text;
            humanResources = JsonUtility.FromJson <HumanResources>(JsonData);
            {
                int max = -1;
                if (humanResources.CHRO > max)
                {
                    max = humanResources.CHRO;
                }
                if (humanResources.PR.executive > max)
                {
                    max = humanResources.PR.executive;
                }
                if (humanResources.PR.manager > max)
                {
                    max = humanResources.PR.manager;
                }
                if (humanResources.PR.head > max)
                {
                    max = humanResources.PR.head;
                }
                if (humanResources.TA.executive > max)
                {
                    max = humanResources.TA.executive;
                }
                if (humanResources.TA.manager > max)
                {
                    max = humanResources.TA.manager;
                }
                if (humanResources.TA.head > max)
                {
                    max = humanResources.TA.head;
                }
                if (humanResources.EER.executive > max)
                {
                    max = humanResources.EER.executive;
                }
                if (humanResources.EER.manager > max)
                {
                    max = humanResources.EER.manager;
                }
                if (humanResources.EER.head > max)
                {
                    max = humanResources.EER.head;
                }
                humanResources.total_upper = max;
                // sending data here...
                StartCoroutine(SendHumanResourceJobLimits());
            }
        }
    }