static void Main(string[] args)
        {
            //temat8/zadanie1,2,3
            var employee = EmployeeFactory.CreateEmployee(1, "RandomName", "RandomLastName", 18);

            Console.WriteLine($"Before changes: {employee.FirstName} {employee.LastName}");
            Action <string, string> changeName = employee.ChangeEmployeeName;

            employee.AddCallback(CallbackInfo);
            changeName("DelegateName", "DelegateLastName");
            Console.WriteLine($"After changes:  {employee.FirstName} {employee.LastName}");
            Console.ReadKey();
            Console.ReadKey();

            //temat9/zadanie1
            var employee2 = new Employee
            {
                Id        = 2,
                FirstName = "EventSalaryTest",
                Salary    = 5000
            };

            employee2.SalaryChange(7000);
            Console.ReadLine();
        }
Exemplo n.º 2
0
        public void SeedDB()
        {
            using (var db = new LiteDatabase(Constants.DB_NAME))
            {
                //clean up
                IEnumerable <string> collectionNames = db.GetCollectionNames().ToList();
                foreach (string collectionName in collectionNames)
                {
                    db.DropCollection(collectionName);
                }
            }

            //setup test data
            Employee nextMgr = new Employee()
            {
                Id = Guid.Empty
            };

            for (int i = 0; i < 99; i++)
            {
                FakeName fname                = GetAName();
                DateTime onboardDate          = DateTime.Now.AddMonths(random.Next(-100, -12));
                DateTime recentPerfReviewDate = new DateTime(DateTime.Now.Year - 1, onboardDate.Month, 1);
                Employee theNextMgr           = EmployeeFactory.CreateEmployee(fname.FirstName, fname.LastName, (Gender)GetValue(genders), fname.Email, nextMgr, (Title)GetValue(titles), (Level)GetValue(levels), random.Next(50000, 200000), random.Next(0, 10000), onboardDate);
                HistoryFactory.CreateHistory(theNextMgr, nextMgr, (Title)GetValue(titles), (Level)GetValue(levels), random.Next(50000, 200000), random.Next(0, 10000), ActionType.ANNUAL_PERFORMANCE_REVIEW, recentPerfReviewDate);
                nextMgr = theNextMgr;
            }
        }
Exemplo n.º 3
0
    // Update is called once per frame
    void Update()
    {
        if (Input.GetKeyDown(KeyCode.Space))
        {
            Vector3    fwd = centerAnchorTransform.TransformDirection(Vector3.forward);
            RaycastHit hit;
            Physics.Raycast(centerAnchorTransform.position, fwd, out hit, 30);
            Debug.DrawLine(centerAnchorTransform.position, hit.point);

            if (hit.transform.tag == "Office")
            {
                Office office = hit.transform.GetComponent <Office>();
                if (office.IsEmpty())
                {
                    if (GameManagerScript.playerMoney > 200)
                    {
                        employeeFactory.CreateEmployee(hit.transform.GetComponent <Office>());
                    }
                }
                else
                {
                    office.FireEmployee();
                }
            }
        }
    }
Exemplo n.º 4
0
        private void AddNewEmployee(string[] args)
        {
            string typeOfEmployee = args[0];
            string name           = args[1];

            newEmployee.Add(employeeFactory.CreateEmployee(typeOfEmployee, name));
        }
Exemplo n.º 5
0
        public EmployeeDC CreateEmployee(Guid managerId, string firstName, string lastName, Gender gender, string email, Title title, Level level, decimal salary, decimal bonus, DateTime onboardDate)
        {
            var manager = managerId == Guid.Empty ? new Employee()
            {
                Id = Guid.Empty
            } : PersistenceStore.Current.GetEmployeeStore().FindById(managerId);

            return(EmployeeFactory.CreateEmployee(firstName, lastName, gender, email, manager, title, level, salary, bonus, onboardDate).ConvertToDataContract(this));
        }
        public void CanCreateHourlyEmployeeObject()
        {
            //Arrange
            var employeeFactory = new EmployeeFactory();

            //Act
            var hourlyEmployee = employeeFactory.CreateEmployee(EmployeeContractType.HourlySalaryEmployee);

            //Assert
            hourlyEmployee.Should().BeOfType <HourlyEmployee>();
        }
Exemplo n.º 7
0
        public async Task <List <IEmployeeDto> > GetEmployees()
        {
            var listEmployees = await _employeeServiceClient.GetEmployees();

            var listEmployesDto = new List <IEmployeeDto>();
            var employeeFactory = new EmployeeFactory();

            foreach (var itemEmployee in listEmployees)
            {
                listEmployesDto.Add(employeeFactory.CreateEmployee(itemEmployee));
            }

            return(listEmployesDto);
        }
Exemplo n.º 8
0
        public ActionResult CreateEmployee(EmployeeModel newcontractor)
        {
            if (ModelState.IsValid)
            {
                var company  = CompanyRepository.GetItemById <Company>(newcontractor.CompanyId);
                var address  = new Address(newcontractor.Street, newcontractor.City);
                var skill    = new Dictionary <string, int>();
                var salary   = new Salary(newcontractor.Salary, 0.0);
                var employee = EmployeeFactory.CreateEmployee(newcontractor.Firstname, newcontractor.Lastname,
                                                              newcontractor.BirthDate,
                                                              skill, address, company, newcontractor.WorkExp, salary, newcontractor.Department, newcontractor.Role);
                PersonRepository.AddPerson(employee);

                var pers = PersonRepository.GetAllFirstAndLastNames();
                return(PartialView("WorkerList", pers));
            }
            return(PartialView(newcontractor));
        }
        private Employee ProcessSave(Employee employeeData)
        {
            var empObj = _employeeFactory.CreateEmployee(52000, 26);

            empObj.FirstName  = employeeData.FirstName;
            empObj.LastName   = employeeData.LastName;
            empObj.EmployeeId = string.IsNullOrWhiteSpace(employeeData.EmployeeId) ?
                                Guid.NewGuid().ToString() :
                                employeeData.EmployeeId;

            foreach (var d in employeeData.Dependents)
            {
                empObj.Dependents.Add(_dependentFactory.CreateDependent(d.FirstName, d.LastName));
            }

            _paycheckCalculatorService.Calculate(empObj);

            return(_employeeRepository.Save(empObj));
        }
Exemplo n.º 10
0
        static void CreateNewEmployee(string name, string surname, TypeOfContract typeOfContract, int wage)
        {
            BaseEmployee employee;
            var          id = ListOfEmployees.Select(e => e.EmployeeId).DefaultIfEmpty(-1).Max() + 1;

            //if(typeOfContract == TypeOfContract.EmploymentContrat)
            //{
            //    employee = new Employee(name, surname, wage, id);
            //} else
            //{
            //    employee = new SpecificEmployee(name, surname, wage,id);
            //}
            employee = EmployeeFactory.CreateEmployee(new RequestEmployee()
            {
                Name           = name,
                Surname        = surname,
                TypeOfContract = typeOfContract,
                Wage           = wage,
                EmployeeId     = id,
            });
            ListOfEmployees.Add(employee);
        }
        public IEmployee SelectEmployeeDetails(int employeeID, string password)
        {
            SqlConnection conn = DBUtility.GetConnection();

            employee = null;

            SqlConnection myConnection = DBUtility.GetConnection();
            SqlCommand    cmd          = new SqlCommand();

            cmd.Connection  = conn;
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.CommandText = "sp_employeeinfo_667015";   //employe stored procedure
            cmd.Parameters.AddWithValue("@employee_id", employeeID);
            cmd.Parameters.AddWithValue("@password", password);
            conn.Open();
            //int i = 0;
            SqlDataReader reader = cmd.ExecuteReader();

            while (reader.Read())
            {
                //i = 1;
                int    empID  = reader.GetInt32(0);
                string name   = reader.GetString(1);
                string domain = reader.GetString(4);
                bool   isHR   = false;
                if (!reader.IsDBNull(3))
                {
                    isHR = reader.GetBoolean(3);
                }
                int unitHeadID = 0;
                if (!reader.IsDBNull(2))
                {
                    unitHeadID = reader.GetInt32(2);
                }
                employee = EmployeeFactory.CreateEmployee(name, empID, isHR, unitHeadID, domain);
            }

            return(employee);
        }
Exemplo n.º 12
0
        internal void RegisterEmployee(string input)
        {
            IEmployee newEmployee = employeeFactory.CreateEmployee(input);

            employees.Add(newEmployee);
        }
Exemplo n.º 13
0
        public void AddEmployee(int firmId)
        {
            Employee employee = _employeeFactory.CreateEmployee(firmId, Title, Name, Surname, Phone, Email);

            RepositoryManager.EmployeeRepository.AddEmployee(employee);
        }
        private void btnCreate_Click(object sender, EventArgs e)
        {
            try{
                String  errorMsg = "";
                Boolean isValid  = true;
                if (txtSIN.Text.Length <= 0 || txtBiWeeklyPayRate.Text.Length <= 0 || txtCellPhoneNumber.Text.Length <= 0 || txtWorkPhoneNumber.Text.Length <= 0 || txtEmailAddress.Text.Length <= 0 || txtFirstName.Text.Length <= 0 || txtLastName.Text.Length <= 0 || txtStreetAddress.Text.Length <= 0 || txtCity.Text.Length <= 0 || txtPostalCode.Text.Length <= 0)
                {
                    isValid  = false;
                    errorMsg = "Error Missing fields.";
                }
                else
                {
                    if (!BusinessLayer.Validate.IsValidSIN(txtSIN.Text))
                    {
                        isValid   = false;
                        errorMsg += "Invalid SIN. \n";
                    }
                    if (dtpSeniorityDate.Value.Date > dtpJobStartDate.Value.Date)
                    {
                        isValid   = false;
                        errorMsg += "Seniority Date must be sooner than or equal to Job Start Date. \n";
                    }
                    if (!BusinessLayer.Validate.IsValidBiweeklyPay(txtBiWeeklyPayRate.Text))
                    {
                        isValid   = false;
                        errorMsg += "Bi-Weekly Payrate must be a numeric value greater than 0. \n";
                    }
                    if (!BusinessLayer.Validate.ValidatePhoneNumber(txtCellPhoneNumber.Text))
                    {
                        isValid   = false;
                        errorMsg += "Invalid Cell Phone Number. \n";
                    }
                    if (!BusinessLayer.Validate.ValidatePhoneNumber(txtWorkPhoneNumber.Text))
                    {
                        isValid   = false;
                        errorMsg += "Invalid Work Phone Number. \n";
                    }
                    if (!BusinessLayer.Validate.ValidateEmail(txtEmailAddress.Text))
                    {
                        isValid   = false;
                        errorMsg += "Invalid Email Address. \n";
                    }
                    if (!BusinessLayer.Validate.ValidateLength(txtFirstName.Text, 20))
                    {
                        isValid   = false;
                        errorMsg += "First Name cannot be longer than 20 characters. \n";
                    }

                    if (!BusinessLayer.Validate.ValidateLength(txtMiddleInitial.Text, 1))
                    {
                        isValid   = false;
                        errorMsg += "Middle Initial cannot be longer than 1 character. \n";
                    }

                    if (!BusinessLayer.Validate.ValidateLength(txtLastName.Text, 30))
                    {
                        isValid   = false;
                        errorMsg += "Last Name cannot be longer than 30 characters. \n";
                    }
                    if (!BusinessLayer.Validate.IsValidPostalCode(txtPostalCode.Text))
                    {
                        isValid   = false;
                        errorMsg += "Invalid Postal Code \n";
                    }
                }

                if (isValid)
                {
                    Employee emp = EmployeeFactory.CreateEmployee();
                    emp.FirstName         = txtFirstName.Text;
                    emp.MiddleInitial     = txtMiddleInitial.Text;
                    emp.LastName          = txtLastName.Text;
                    emp.DateOfBirth       = dtpDateOfBirth.Value;
                    emp.StreetAddress     = txtStreetAddress.Text;
                    emp.City              = txtCity.Text;
                    emp.PostalCode        = txtPostalCode.Text;
                    emp.SIN               = Convert.ToInt32(txtSIN.Text);
                    emp.CellPhoneNumber   = txtCellPhoneNumber.Text;
                    emp.WorkPhoneNumber   = txtWorkPhoneNumber.Text;
                    emp.EmailAddress      = txtEmailAddress.Text;
                    emp.HireDate          = dtpSeniorityDate.Value;
                    emp.JobStartDate      = dtpJobStartDate.Value;
                    emp.EmailNotification = chkPayrollEmailNotification.Checked;
                    emp.JobID             = Convert.ToInt32(cmbJobAssignment.SelectedValue);
                    emp.DepartmentID      = Convert.ToInt32(cmbDepartment.SelectedValue);
                    emp.BiWeeklyRate      = Convert.ToDouble(txtBiWeeklyPayRate.Text);


                    int newEmpID = CUDMethods.CreateEmp(emp);

                    MessageBox.Show("New Employee Created With ID of: " + newEmpID);

                    //MessageBox.Show("Worked");
                }
                else
                {
                    MessageBox.Show(errorMsg);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error: " + ex.Message);
            }
        }
        private void btnSave_Click(object sender, EventArgs e)
        {
            try
            {
                String   errorMsg  = "";
                Boolean  isValid   = true;
                DateTime now       = DateTime.Today;
                int      listIndex = listBoxResults.SelectedIndex;

                if (txtSINModify.Text.Length <= 0 || txtBiWeeklyRateModify.Text.Length <= 0 || txtCellPhoneNumberModify.Text.Length <= 0 || txtWorkPhoneNumberModify.Text.Length <= 0 || txtEmailAddressModify.Text.Length <= 0 || txtFirstNameModify.Text.Length <= 0 || txtLastNameModify.Text.Length <= 0 || txtStreetAddressModify.Text.Length <= 0 || txtCityModify.Text.Length <= 0 || txtPostalCodeModify.Text.Length <= 0)
                {
                    isValid  = false;
                    errorMsg = "Error Missing fields.";
                }
                else if ((cmbEmpStatusModify.SelectedValue.ToString() == "Retired") && ((now.Year - emp[listBoxResults.SelectedIndex].DateOfBirth.Year) < 55))
                {
                    isValid  = false;
                    errorMsg = "Cannot retire if you're less than 55. \n";
                }
                else if (emp[listBoxResults.SelectedIndex].EmpStatus == 2 && cmbEmpStatusModify.SelectedValue.ToString() != "Retired")
                {
                    isValid  = false;
                    errorMsg = "Once an employee retires they cannot be reinstated. \n";
                }
                else
                {
                    if (!BusinessLayer.Validate.IsValidSIN(txtSINModify.Text))
                    {
                        isValid   = false;
                        errorMsg += "Invalid SIN. \n";
                    }
                    if (dtpSeniorityDateModify.Value.Date > dtpJobStartDateModify.Value.Date)
                    {
                        isValid   = false;
                        errorMsg += "Seniority Date must be sooner than or equal to Job Start Date. \n";
                    }
                    if (!BusinessLayer.Validate.IsValidBiweeklyPay(txtBiWeeklyRateModify.Text))
                    {
                        isValid   = false;
                        errorMsg += "Bi-Weekly Payrate must be a numeric value greater than 0. \n";
                    }
                    if (!BusinessLayer.Validate.ValidatePhoneNumber(txtCellPhoneNumberModify.Text))
                    {
                        isValid   = false;
                        errorMsg += "Invalid Cell Phone Number. \n";
                    }
                    if (!BusinessLayer.Validate.ValidatePhoneNumber(txtWorkPhoneNumberModify.Text))
                    {
                        isValid   = false;
                        errorMsg += "Invalid Work Phone Number. \n";
                    }
                    if (!BusinessLayer.Validate.ValidateEmail(txtEmailAddressModify.Text))
                    {
                        isValid   = false;
                        errorMsg += "Invalid Email Address. \n";
                    }
                    if (!BusinessLayer.Validate.ValidateLength(txtFirstNameModify.Text, 20))
                    {
                        isValid   = false;
                        errorMsg += "First Name cannot be longer than 20 characters. \n";
                    }

                    if (!BusinessLayer.Validate.ValidateLength(txtMiddleInitialModify.Text, 1))
                    {
                        isValid   = false;
                        errorMsg += "Middle Initial cannot be longer than 1 character. \n";
                    }

                    if (!BusinessLayer.Validate.ValidateLength(txtLastNameModify.Text, 30))
                    {
                        isValid   = false;
                        errorMsg += "Last Name cannot be longer than 30 characters. \n";
                    }
                    if (!BusinessLayer.Validate.IsValidPostalCode(txtPostalCodeModify.Text))
                    {
                        isValid   = false;
                        errorMsg += "Invalid Postal Code \n";
                    }
                }

                if (isValid)
                {
                    Employee modifiedEmp = EmployeeFactory.CreateEmployee();

                    modifiedEmp.EmpID = emp[listBoxResults.SelectedIndex].EmpID;

                    modifiedEmp.FirstName         = txtFirstNameModify.Text;
                    modifiedEmp.MiddleInitial     = txtMiddleInitialModify.Text;
                    modifiedEmp.LastName          = txtLastNameModify.Text;
                    modifiedEmp.DateOfBirth       = dtpDateOfBirthModify.Value;
                    modifiedEmp.StreetAddress     = txtStreetAddressModify.Text;
                    modifiedEmp.City              = txtCityModify.Text;
                    modifiedEmp.PostalCode        = txtPostalCodeModify.Text;
                    modifiedEmp.SIN               = Convert.ToInt32(txtSINModify.Text);
                    modifiedEmp.CellPhoneNumber   = txtCellPhoneNumberModify.Text;
                    modifiedEmp.WorkPhoneNumber   = txtWorkPhoneNumberModify.Text;
                    modifiedEmp.EmailAddress      = txtEmailAddressModify.Text;
                    modifiedEmp.HireDate          = dtpSeniorityDateModify.Value;
                    modifiedEmp.JobStartDate      = dtpJobStartDateModify.Value;
                    modifiedEmp.EmailNotification = chkPayrollEmailModify.Checked;
                    modifiedEmp.JobID             = Convert.ToInt32(cmbJobAssignmentModify.SelectedValue);
                    modifiedEmp.DepartmentID      = Convert.ToInt32(cmbDepartmentModify.SelectedValue);
                    modifiedEmp.BiWeeklyRate      = Convert.ToDouble(txtBiWeeklyRateModify.Text);
                    modifiedEmp.lastTouched       = emp[listBoxResults.SelectedIndex].lastTouched;

                    modifiedEmp.EmpStatus       = Convert.ToInt32(cmbEmpStatusModify.SelectedValue);
                    modifiedEmp.DateOfDeparture = dtpEmpEndModify.Value;

                    if (CUDMethods.ModifyEmployee(modifiedEmp))
                    {
                        MessageBox.Show("Employee Succesfully Modified!");
                        emp[listBoxResults.SelectedIndex] = modifiedEmp;
                        cancelButton();
                        searchEmployee();
                        listBoxResults.SelectedIndex = listIndex;
                    }
                }
                else
                {
                    MessageBox.Show(errorMsg);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error: " + ex.Message);
            }
        }
Exemplo n.º 16
0
        protected void btnUpdatePersonalInfo_Click(object sender, EventArgs e)
        {
            lblError.Text   = "";
            lblSuccess.Text = "";
            Boolean IsValid  = true;
            String  errorMsg = "\n";

            if (!BusinessLayer.Validate.ValidatePhoneNumber(txtWorkPhone.Text))
            {
                errorMsg += "Invalid Work Number. <br/>";
                IsValid   = false;
            }
            if (!BusinessLayer.Validate.ValidatePhoneNumber(txtCellPhone.Text))
            {
                errorMsg += "Invalid Cell Number. <br/>";
                IsValid   = false;
            }
            if (txtHomeAddress.Text == String.Empty)
            {
                errorMsg += "Invalid Address.<br/>";
                IsValid   = false;
            }
            if (txtCity.Text == String.Empty)
            {
                errorMsg += "Invalid City. <br/>";
                IsValid   = false;
            }
            if (!BusinessLayer.Validate.IsValidPostalCode(txtPostalCode.Text))
            {
                errorMsg += "Invalid Postal Code. <br/>";
                IsValid   = false;
            }

            if (IsValid)
            {
                byte[] lastChecked = (byte[])Session["lastTouched"];

                Employee tmpEmp = EmployeeFactory.CreateEmployee();

                tmpEmp.EmpID           = empID;
                tmpEmp.WorkPhoneNumber = txtWorkPhone.Text;
                tmpEmp.CellPhoneNumber = txtCellPhone.Text;
                tmpEmp.StreetAddress   = txtHomeAddress.Text;
                tmpEmp.City            = txtCity.Text;
                tmpEmp.PostalCode      = txtPostalCode.Text;

                tmpEmp.lastTouched = lastChecked;

                try
                {
                    CUDMethods.UpdateEmployeeEmp(tmpEmp);
                    lblSuccess.Text = "Information Updated!";

                    List <Employee> emp = EmployeeFactory.RetrieveEmployeesByID(empID);
                    Session["lastTouched"] = emp[0].lastTouched;
                }
                catch (Exception ex)
                {
                    lblError.Text = ex.Message;
                }
            }
            else
            {
                lblError.Text = "Some fields were not valid: <br/>" + errorMsg;
            }
        }
Exemplo n.º 17
0
        private static void PopulatingDb()
        {
            var personsList = new List <Person>();
            var companylist = new List <Company>();

            var salary   = new Salary(1500, 0.0);
            var salary2  = new Salary(1600, 0.0);
            var salary3  = new Salary(1700, 0.0);
            var salary4  = new Salary(1520, 0.0);
            var salary5  = new Salary(1300, 0.0);
            var salary6  = new Salary(1540, 0.0);
            var salary7  = new Salary(1550, 0.0);
            var salary8  = new Salary(1570, 0.0);
            var salary9  = new Salary(1680, 0.0);
            var salary10 = new Salary(1520, 0.0);

            var newAddress   = new Address("Monumentul Stefan cel Mare", "Chisinau");
            var newAddress2  = new Address("Aleco Ruso", "Chisinau");
            var newAddress3  = new Address("bd Decebal", "Chisinau");
            var newAddress4  = new Address("bd Miorita", "Chisinau");
            var newAddress5  = new Address("bd Renasterii", "Chisinau");
            var newAddress6  = new Address("Monumentul Stefan cel Mare", "Chisinau");
            var newAddress7  = new Address("Aleco Ruso", "Chisinau");
            var newAddress8  = new Address("bd Decebal", "Chisinau");
            var newAddress9  = new Address("bd Miorita", "Chisinau");
            var newAddress10 = new Address("bd Renasterii", "Chisinau");
            var newAddress11 = new Address("Monumentul Stefan cel Mare", "Chisinau");
            var newAddress12 = new Address("Aleco Ruso", "Chisinau");
            var newAddress13 = new Address("bd Decebal", "Chisinau");
            var newAddress14 = new Address("bd Miorita", "Chisinau");
            var newAddress15 = new Address("bd Renasterii", "Chisinau");
            var newAddress16 = new Address("Monumentul Stefan cel Mare", "Chisinau");
            var newAddress17 = new Address("Aleco Ruso", "Chisinau");
            var newAddress18 = new Address("bd Decebal", "Chisinau");
            var newAddress19 = new Address("bd Miorita", "Chisinau");
            var newAddress20 = new Address("bd Renasterii", "Chisinau");

            var skills = new Dictionary <string, int> {
                { "C#", 80 }, { "SQL", 90 }
            };
            var skills2 = new Dictionary <string, int> {
                { "CSS", 80 }, { "PHP", 90 }, { "HTML", 90 }
            };
            var skills3 = new Dictionary <string, int> {
                { "JavaScript", 80 }, { "HTML", 90 }
            };
            var skills4 = new Dictionary <string, int> {
                { "C++", 80 }
            };
            var skills5 = new Dictionary <string, int> {
                { "C#", 80 }, { "SQL", 90 }, { "CSS", 80 }, { "PHP", 90 }, { "HTML", 90 }
            };

            var comp  = CompanyFactory.CreateCompany("Imea", FieldOfActivity.IT, newAddress);
            var comp2 = CompanyFactory.CreateCompany("WIKER", FieldOfActivity.IT, newAddress2);
            var comp3 = CompanyFactory.CreateCompany("Bones", FieldOfActivity.IT, newAddress3);
            var comp4 = CompanyFactory.CreateCompany("XQT", FieldOfActivity.IT, newAddress4);
            var comp5 = CompanyFactory.CreateCompany("Akigor", FieldOfActivity.IT, newAddress5);

            companylist.Add(comp);
            companylist.Add(comp2);
            companylist.Add(comp3);
            companylist.Add(comp4);
            companylist.Add(comp5);

            var proj  = ProjectFactory.CreateProject(comp, "Nima", "Project nr 1");
            var proj2 = ProjectFactory.CreateProject(comp, "BJH", "Project nr 2");
            var proj3 = ProjectFactory.CreateProject(comp, "XAF", "Project nr 3");

            comp.AddProject(proj);
            comp.AddProject(proj2);
            comp.AddProject(proj3);
            comp5.AddProject(proj2);

            var proj4 = ProjectFactory.CreateProject(comp2, "P1", "Project nr 1");
            var proj5 = ProjectFactory.CreateProject(comp2, "P2", "Project nr 2");
            var proj6 = ProjectFactory.CreateProject(comp2, "P3", "Project nr 3");
            var proj7 = ProjectFactory.CreateProject(comp2, "P4", "Project nr 4");
            var proj8 = ProjectFactory.CreateProject(comp2, "P5", "Project nr 5");

            comp2.AddProject(proj4);
            comp2.AddProject(proj5);
            comp2.AddProject(proj6);
            comp2.AddProject(proj7);
            comp2.AddProject(proj8);
            comp5.AddProject(proj7);

            var proj9  = ProjectFactory.CreateProject(comp3, "1Pr", "Project nr 1");
            var proj10 = ProjectFactory.CreateProject(comp3, "2Pr", "Project nr 2");
            var proj11 = ProjectFactory.CreateProject(comp3, "3Pr", "Project nr 3");
            var proj12 = ProjectFactory.CreateProject(comp3, "4Pr", "Project nr 4");
            var proj13 = ProjectFactory.CreateProject(comp3, "5Pr", "Project nr 5");
            var proj14 = ProjectFactory.CreateProject(comp3, "6Pr", "Project nr 6");

            comp3.AddProject(proj9);
            comp3.AddProject(proj10);
            comp3.AddProject(proj11);
            comp3.AddProject(proj12);
            comp3.AddProject(proj13);
            comp3.AddProject(proj14);
            comp5.AddProject(proj11);


            var task1  = TaskFactory.CreateTask(proj, "Task1", "Description", "12.12.2016");
            var task2  = TaskFactory.CreateTask(proj2, "Task1", "Description", "12.12.2016");
            var task3  = TaskFactory.CreateTask(proj3, "Task1", "Description", "12.12.2016");
            var task4  = TaskFactory.CreateTask(proj4, "Task1", "Description", "12.12.2016");
            var task5  = TaskFactory.CreateTask(proj5, "Task1", "Description", "12.12.2016");
            var task6  = TaskFactory.CreateTask(proj6, "Task1", "Description", "12.12.2016");
            var task7  = TaskFactory.CreateTask(proj7, "Task1", "Description", "12.12.2016");
            var task8  = TaskFactory.CreateTask(proj8, "Task1", "Description", "12.12.2016");
            var task9  = TaskFactory.CreateTask(proj9, "Task1", "Description", "12.12.2016");
            var task10 = TaskFactory.CreateTask(proj10, "Task1", "Description", "12.12.2016");
            var task11 = TaskFactory.CreateTask(proj11, "Task1", "Description", "12.12.2016");
            var task12 = TaskFactory.CreateTask(proj12, "Task1", "Description", "12.12.2016");
            var task13 = TaskFactory.CreateTask(proj13, "Task1", "Description", "12.12.2016");
            var task14 = TaskFactory.CreateTask(proj14, "Task1", "Description", "12.12.2016");
            var task15 = TaskFactory.CreateTask(proj, "Task2", "Description", "12.12.2016");
            var task16 = TaskFactory.CreateTask(proj2, "Task2", "Description", "12.12.2016");
            var task17 = TaskFactory.CreateTask(proj3, "Task2", "Description", "12.12.2016");
            var task18 = TaskFactory.CreateTask(proj4, "Task2", "Description", "12.12.2016");
            var task19 = TaskFactory.CreateTask(proj, "Task3", "Description", "12.12.2016");
            var task20 = TaskFactory.CreateTask(proj2, "Task3", "Description", "12.12.2016");

            proj.AddTask(task1);
            proj.AddTask(task15);
            proj.AddTask(task19);
            proj2.AddTask(task2);
            proj2.AddTask(task16);
            proj2.AddTask(task20);
            proj3.AddTask(task3);
            proj3.AddTask(task17);
            proj4.AddTask(task4);
            proj4.AddTask(task18);
            proj5.AddTask(task5);
            proj6.AddTask(task6);
            proj7.AddTask(task7);
            proj8.AddTask(task8);
            proj9.AddTask(task9);
            proj10.AddTask(task10);
            proj11.AddTask(task11);
            proj12.AddTask(task12);
            proj13.AddTask(task13);
            proj14.AddTask(task14);

            var intern  = InternFactory.CreateIntern("Vasile", "Ion", DateTime.Parse("1990-12-13"), skills, newAddress6, comp, 80);
            var intern2 = InternFactory.CreateIntern("Artur", "Rusnac", DateTime.Parse("1990-12-13"), skills2, newAddress7, comp2, 80);
            var intern3 = InternFactory.CreateIntern("Alex", "Maioco", DateTime.Parse("1990-12-13"), skills3, newAddress8, comp3, 80);
            var intern4 = InternFactory.CreateIntern("Max", "Josan", DateTime.Parse("1990-12-13"), skills4, newAddress9, comp4, 80);
            var intern5 = InternFactory.CreateIntern("Rumulus", "Remus", DateTime.Parse("1990-12-13"), skills5, newAddress10, comp5, 80);

            personsList.Add(intern);
            personsList.Add(intern2);
            personsList.Add(intern3);
            personsList.Add(intern4);
            personsList.Add(intern5);

            var contr1 = ContractorFactory.CreateContractor("Iulius", "Cezar", DateTime.Parse("1980-05-01"), skills3, newAddress11, comp,
                                                            11, salary);
            var contr2 = ContractorFactory.CreateContractor("Junior", "Vamp", DateTime.Parse("1980-05-01"), skills2, newAddress12, comp2,
                                                            12, salary2);
            var contr3 = ContractorFactory.CreateContractor("Hugo", "Boss", DateTime.Parse("1980-05-01"), skills, newAddress13, comp3, 13,
                                                            salary3);
            var contr4 = ContractorFactory.CreateContractor("Jason", "Statham", DateTime.Parse("1980-05-01"), skills4, newAddress14,
                                                            comp4, 14, salary4);
            var contr5 = ContractorFactory.CreateContractor("Guy", "Rich", DateTime.Parse("1980-05-01"), skills3, newAddress15, comp2, 15,
                                                            salary5);

            personsList.Add(contr1);
            personsList.Add(contr2);
            personsList.Add(contr3);
            personsList.Add(contr4);
            personsList.Add(contr5);

            var emp = EmployeeFactory.CreateEmployee("John", "Doe", DateTime.Parse("1980-04-01"), skills2, newAddress16, comp, 20, salary6,
                                                     "Test",
                                                     "Testing Ingineer");
            var emp2 = EmployeeFactory.CreateEmployee("Jim", "Dole", DateTime.Parse("1990-05-10"), skills, newAddress17, comp2, 30, salary7,
                                                      "Softwer Development",
                                                      "Software developer");
            var emp3 = EmployeeFactory.CreateEmployee("Anne", "Fireman", DateTime.Parse("1995-12-12"), skills3, newAddress18, comp3, 60,
                                                      salary8, "Test", "Testing Ingineer");
            var emp4 = EmployeeFactory.CreateEmployee("Vanessa", "Ginger", DateTime.Parse("1996-11-01"), skills4, newAddress19, comp4, 70,
                                                      salary9, "Softwer Development", "Software developer");
            var emp5 = EmployeeFactory.CreateEmployee("Will", "Smith", DateTime.Parse("1990-11-01"), skills4, newAddress20, comp4, 70,
                                                      salary10, "Softwer Development", "Software developer");

            personsList.Add(emp);
            personsList.Add(emp2);
            personsList.Add(emp3);
            personsList.Add(emp4);
            personsList.Add(emp5);


            CompanyRepository.AddCompany(companylist[0]);
            CompanyRepository.AddCompany(companylist[1]);
            CompanyRepository.AddCompany(companylist[2]);
            CompanyRepository.AddCompany(companylist[3]);
            CompanyRepository.AddCompany(companylist[4]);
            PersonRepository.AddPerson(personsList[0]);
            PersonRepository.AddPerson(personsList[1]);
            PersonRepository.AddPerson(personsList[2]);
            PersonRepository.AddPerson(personsList[3]);
            PersonRepository.AddPerson(personsList[4]);
            PersonRepository.AddPerson(personsList[5]);
            PersonRepository.AddPerson(personsList[6]);
            PersonRepository.AddPerson(personsList[7]);
            PersonRepository.AddPerson(personsList[8]);
            PersonRepository.AddPerson(personsList[9]);
            PersonRepository.AddPerson(personsList[10]);
            PersonRepository.AddPerson(personsList[11]);
            PersonRepository.AddPerson(personsList[12]);
            PersonRepository.AddPerson(personsList[13]);
            PersonRepository.AddPerson(personsList[14]);
            PersonRepository.AddPerson(personsList[15]);
        }