Ejemplo n.º 1
0
        public ContractJobOffer CreateJobOffer(CreateContractJobOfferParams parameters)
        {
            var jobOffer = CreateJobOffer(parameters as CreateJobOfferParams);

            var contract = new ContractJobOffer()
            {
                Length    = parameters.Length,
                MinHP     = parameters.MinimumHP,
                MinSalary = (decimal)parameters.MinimumSalary,
                SigneeID  = parameters.SigneeID
            };

            jobOffer.ContractJobOffer = contract;

            if (parameters.Cost > 0 && parameters.CountryID.HasValue)
            {
                var country = countryRepository.GetById(parameters.CountryID.Value);
                var company = companyRepository.GetById(parameters.CompanyID);

                PayJobOfferFee(company, country, JobOfferTypeEnum.Contract, parameters.Amount, parameters.CurrencyID, parameters.Cost);
            }

            jobOfferRepository.Add(jobOffer);
            jobOfferRepository.SaveChanges();

            return(jobOffer.ContractJobOffer);
        }
Ejemplo n.º 2
0
        public ContractDetailsViewModel(ContractJobOffer contract, int jobOfferID)
        {
            MinSkill  = (double)contract.JobOffer.MinSkill;
            MinSalary = (double)contract.MinSalary;
            MinHP     = contract.MinHP;
            Length    = contract.Length;

            JobOfferID = jobOfferID;
        }
Ejemplo n.º 3
0
        public CompanyEmployee EmployCitizen(Company company, Citizen citizen, ContractJobOffer contract)
        {
            CompanyEmployee employee = new CompanyEmployee()
            {
                CitizenID = citizen.ID,
                MinHP     = contract.MinHP,
                Salary    = contract.MinSalary
            };

            employee.JobContract = new JobContract()
            {
                Length    = contract.Length,
                MinHP     = contract.MinHP,
                MinSalary = contract.MinSalary
            };

            company.CompanyEmployees.Add(employee);
            jobOfferService.TakeJobOffer(contract.JobOffer.ID);

            companyRepository.SaveChanges();

            return(employee);
        }
 public ShortContractJobOfferViewModel(ContractJobOffer contractOffer, CompanyRights companyRights)
     : base(contractOffer.JobOffer, companyRights)
 {
     MinSalary = (double)contractOffer.MinSalary;
 }