Exemplo n.º 1
0
 partial void UpdateEmployee(Employee instance);
Exemplo n.º 2
0
 partial void DeleteEmployee(Employee instance);
Exemplo n.º 3
0
		private void detach_Employee(Employee entity)
		{
			this.SendPropertyChanging();
			entity.Schedule = null;
		}
Exemplo n.º 4
0
 partial void InsertEmployee(Employee instance);
Exemplo n.º 5
0
		private void attach_Employee(Employee entity)
		{
			this.SendPropertyChanging();
			entity.Schedule = this;
		}
Exemplo n.º 6
0
		private void detach_Employee(Employee entity)
		{
			this.SendPropertyChanging();
			entity.Position = null;
		}
Exemplo n.º 7
0
		private void attach_Employee(Employee entity)
		{
			this.SendPropertyChanging();
			entity.Position = this;
		}
Exemplo n.º 8
0
		private void detach_Employee2(Employee entity)
		{
			this.SendPropertyChanging();
			entity.Department2 = null;
		}
Exemplo n.º 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;
        }