Пример #1
0
		private void detach_Employments(Employment entity)
		{
			this.SendPropertyChanging();
			entity.Applicant = null;
		}
Пример #2
0
 partial void DeleteEmployment(Employment instance);
Пример #3
0
 partial void UpdateEmployment(Employment instance);
Пример #4
0
 partial void InsertEmployment(Employment instance);
Пример #5
0
		private void attach_Employments(Employment entity)
		{
			this.SendPropertyChanging();
			entity.Employer = this;
		}
        public bool CreateEmployment(EmploymentDAO emp)
        {
            Employment employment = new Employment
            {
                Applicant_ID = emp.ApplicantID,
                Employer_ID = emp.EmployerID,
                MayWeContactCurrentEmployer = emp.MayWeContactCurrentEmployer,
                EmployedFrom = emp.EmployedFrom,
                EmployedTo = emp.EmployedTo,
                Supervisor = emp.Supervisor,
                Position = emp.Position,
                StartingSalary = emp.StartingSalary,
                EndingSalary = emp.EndingSalary,
                ReasonForLeaving = emp.ReasonForLeaving,
                Responsibilities = emp.Responsibilities
            };

            using (AESDatabaseDataContext db = new AESDatabaseDataContext())
            {
                db.Employments.InsertOnSubmit(employment);
                try
                {
                    db.SubmitChanges();
                }
                catch (Exception e)
                {
                    throw new FaultException<KaskServiceException>(new KaskServiceException(), new FaultReason(e.Message));
                }
            }

            return true;
        }