예제 #1
0
 partial void UpdateEmployee(Employee instance);
예제 #2
0
 partial void DeleteEmployee(Employee instance);
예제 #3
0
		private void detach_Employee(Employee entity)
		{
			this.SendPropertyChanging();
			entity.Schedule = null;
		}
예제 #4
0
 partial void InsertEmployee(Employee instance);
예제 #5
0
		private void attach_Employee(Employee entity)
		{
			this.SendPropertyChanging();
			entity.Schedule = this;
		}
예제 #6
0
		private void detach_Employee(Employee entity)
		{
			this.SendPropertyChanging();
			entity.Position = null;
		}
예제 #7
0
		private void attach_Employee(Employee entity)
		{
			this.SendPropertyChanging();
			entity.Position = this;
		}
예제 #8
0
		private void detach_Employee2(Employee entity)
		{
			this.SendPropertyChanging();
			entity.Department2 = null;
		}
예제 #9
0
        //public FiresecAPI.Models.Skud.EmployeeReplacement Translate(EmployeeReplacement employeeReplacement)
        //{
        //    if (employeeReplacement == null)
        //        return null;
        //    return new FiresecAPI.Models.Skud.EmployeeReplacement
        //    {
        //        Uid = employeeReplacement.Uid,
        //        BeginDate = employeeReplacement.BeginDate,
        //        EndDate = employeeReplacement.EndDate,
        //        Department = Translate(employeeReplacement.Department),
        //        Schedule = Translate(employeeReplacement.Schedule)
        //    };
        //}

        public static FiresecAPI.Models.Skud.Employee Translate(Employee employee)
        {
            if (employee == null)
                return null;
            var additionalColumnUids = new List<Guid>();
            employee.AdditionalColumn.Where(x => x.EmployeeUid == employee.Uid).ToList().ForEach(x => additionalColumnUids.Add(x.Uid));
            Guid? replacementUid = null;
            if (employee.EmployeeReplacement != null)
                replacementUid = employee.EmployeeReplacement.Uid;
            var resultEmployee = new FiresecAPI.Models.Skud.Employee
            {
                Uid = employee.Uid,
                FirstName = employee.FirstName,
                SecondName = employee.SecondName,
                LastName = employee.LastName,
                Appointed = employee.Appointed,
                Dismissed = employee.Dismissed,
                PositionUid = employee.PositionUid,
                ReplacementUid = replacementUid,
                DepartmentUid = employee.DepartmentUid,
                ScheduleUid = employee.ScheduleUid,
                AdditionalColumnUids = additionalColumnUids 
            };
            return resultEmployee;
        }