private string _title;            // titula

        public employeeINDEFINITEContract(string name, string surname, DateTime dateOfBirth, string IDnumber, int employeeID, employmentPosition_indefinitePeriod employeePosition, double norm, string jobQualification, string title) : base(name, surname, dateOfBirth, IDnumber, employeeID)
        {
            EmployeePosition = employeePosition;
            Norm             = norm;
            JobQualification = jobQualification;
            Title            = title;

            if (employeePosition == employmentPosition_indefinitePeriod.asistent)
            {
                Salary = norm * 1100;
            }
            else if (employeePosition == employmentPosition_indefinitePeriod.visiAsistent)
            {
                Salary = norm * 1300;
            }
            else if (employeePosition == employmentPosition_indefinitePeriod.docent)
            {
                Salary = (norm + 0.1) * 1300;
            }
            else if (employeePosition == employmentPosition_indefinitePeriod.vanredniProfesor)
            {
                Salary = (norm + 0.2) * 1300 + 150;
            }
            else if (employeePosition == employmentPosition_indefinitePeriod.redovniProfesor)
            {
                Salary = (norm + 0.3) * 1500;
            }
            else if (employeePosition == employmentPosition_indefinitePeriod.akademik)
            {
                Salary = (norm + 0.3) * 2000;
            }
        }
示例#2
0
        public void TestMethod_indefiniteEmp_ValidityOfChangedData()
        {
            Faculty testFax = new Faculty("ETF");

            testFax.AddIndefiniteEmployee("name", "surname", new DateTime(1970, 1, 1), "5555555555555", employmentPosition_indefinitePeriod.asistent, 0.5, "jobQual", "title");

            testFax.ListOfIndefiniteContractEmployees[0].Name = "changedName";
            string name = testFax.ListOfIndefiniteContractEmployees[0].Name;

            Assert.AreEqual(name, "changedName");

            testFax.ListOfIndefiniteContractEmployees[0].Surname = "changedSurname";
            string surname = testFax.ListOfIndefiniteContractEmployees[0].Surname;

            Assert.AreEqual(surname, "changedSurname");

            testFax.ListOfIndefiniteContractEmployees[0].DateOfBirth = new DateTime(1971, 1, 1);
            ;            DateTime birth = testFax.ListOfIndefiniteContractEmployees[0].DateOfBirth;
            Assert.AreEqual(birth, new DateTime(1971, 1, 1));

            testFax.ListOfIndefiniteContractEmployees[0].IDnumber = "6666666666666";
            string ID = testFax.ListOfIndefiniteContractEmployees[0].IDnumber;

            Assert.AreEqual(ID, "6666666666666");

            testFax.ListOfIndefiniteContractEmployees[0].EmployeePosition = employmentPosition_indefinitePeriod.visiAsistent;
            employmentPosition_indefinitePeriod position = testFax.ListOfIndefiniteContractEmployees[0].EmployeePosition;

            Assert.AreEqual(position, employmentPosition_indefinitePeriod.visiAsistent);

            testFax.ListOfIndefiniteContractEmployees[0].Title = "changedTitle";
            string title = testFax.ListOfIndefiniteContractEmployees[0].Title;

            Assert.AreEqual(title, "changedTitle");

            testFax.ListOfIndefiniteContractEmployees[0].Title = "changedJob";
            string qual = testFax.ListOfIndefiniteContractEmployees[0].Title;

            Assert.AreEqual(qual, "changedJob");
        }
示例#3
0
        public void TestMethod_indefiniteEmp_ValidityOfInputData()
        {
            Faculty testFax = new Faculty("ETF");

            testFax.AddIndefiniteEmployee("name", "surname", new DateTime(1970, 1, 1), "5555555555555", employmentPosition_indefinitePeriod.asistent, 0.5, "jobQual", "title");

            string name = testFax.ListOfIndefiniteContractEmployees[0].Name;

            Assert.AreEqual(name, "name");

            string surname = testFax.ListOfIndefiniteContractEmployees[0].Surname;

            Assert.AreEqual(surname, "surname");

            DateTime birth = testFax.ListOfIndefiniteContractEmployees[0].DateOfBirth;

            Assert.AreEqual(birth, new DateTime(1970, 1, 1));

            string ID = testFax.ListOfIndefiniteContractEmployees[0].IDnumber;

            Assert.AreEqual(ID, "5555555555555");

            employmentPosition_indefinitePeriod position = testFax.ListOfIndefiniteContractEmployees[0].EmployeePosition;

            Assert.AreEqual(position, employmentPosition_indefinitePeriod.asistent);

            string title = testFax.ListOfIndefiniteContractEmployees[0].Title;

            Assert.AreEqual(title, "title");

            string qual = testFax.ListOfIndefiniteContractEmployees[0].JobQualification;

            Assert.AreEqual(qual, "jobQual");

            double norm = testFax.ListOfIndefiniteContractEmployees[0].Norm;

            Assert.AreEqual(norm, 0.5);
        }
        public void AddIndefiniteEmployee(string name, string surname, DateTime dateOfBirth, string IDnumber, employmentPosition_indefinitePeriod employeePosition, double norm, string jobQualification, string title)
        {
            foreach (Employee x in _listOfAllEmployees)
            {
                if (x.IDnumber == IDnumber)
                {
                    throw new ArgumentException("There is already person with the same ID number in the system");
                }
            }

            int employeeID = employee_ID_start;

            employee_ID_start += 1;

            employeeINDEFINITEContract input = new employeeINDEFINITEContract(name, surname, dateOfBirth, IDnumber, employeeID, employeePosition, norm, jobQualification, title);

            _listOfIndefiniteContractEmployees.Add(input);
            _listOfAllEmployees.Add(input);
            _expenditure += input.Salary;
            balanceRefresh();
            if (_balance < 0)
            {
                _flag = accountBalance.negative;
            }
            else
            {
                _flag = accountBalance.pozitive;
            }
        }