Пример #1
0
        private static string GetEmploymentText(EmploymentData employmentData)
        {
            if (employmentData.IsUnemployed)
            {
                return "Unemployed";
            }

            return string.Format(
                "{0} at {1} from {2}, {3}",
                ValueOrUnknown(employmentData.Position),
                ValueOrUnknown(employmentData.Company),
                ValueOrUnknown(employmentData.HireDate),
                ValueOrUnknown(employmentData.Salary));
        }
        public void Save(EmploymentData employment)
        {
            Contract.Requires<ArgumentNullException>(employment.IsNotNull());
            if (employment.IsUnemployed)
            {
                employment.Company = null;
                employment.HireDate = null;
                employment.Position = null;
                employment.Salary = null;
            }

            this.gangsterBankUnitOfWork.EmploymentDataRepository.CreateOrUpdate(employment);
        }