Esempio n. 1
0
 partial void UpdateDepartment(Department instance);
Esempio n. 2
0
 partial void DeleteDepartment(Department instance);
Esempio n. 3
0
 partial void InsertDepartment(Department instance);
Esempio n. 4
0
		private void detach_Department1(Department entity)
		{
			this.SendPropertyChanging();
			entity.Employee1 = null;
		}
Esempio n. 5
0
		private void attach_Department(Department entity)
		{
			this.SendPropertyChanging();
			entity.Employee = this;
		}
Esempio n. 6
0
		private void attach_Department2(Department entity)
		{
			this.SendPropertyChanging();
			entity.Department1 = this;
		}
Esempio n. 7
0
        //public FiresecAPI.Models.Skud.AdditionalColumn Translate(AdditionalColumn additionalColumn)
        //{
        //    if (additionalColumn == null)
        //        return null;
        //    FiresecAPI.Models.Skud.AdditionalColumnType type;
        //    switch (additionalColumn.Type)
        //    {
        //        case "Graphics":
        //            type = FiresecAPI.Models.Skud.AdditionalColumnType.Graphics;
        //            break;
        //        case "Mixed":
        //            type = FiresecAPI.Models.Skud.AdditionalColumnType.Mixed;
        //            break;
        //        default:
        //            type = FiresecAPI.Models.Skud.AdditionalColumnType.Text;
        //            break;
        //    }
        //    return new FiresecAPI.Models.Skud.AdditionalColumn
        //    {
        //        Uid = additionalColumn.Uid,
        //        Name = additionalColumn.Name,
        //        Description = additionalColumn.Description,
        //        TextData = additionalColumn.TextData,
        //        GraphicsData = additionalColumn.GraphicsData.ToArray(),
        //        Type = type
        //    };
        //}

        //public FiresecAPI.Models.Skud.Phone Translate(Phone phone)
        //{
        //    if (phone == null)
        //        return null;
        //    return new FiresecAPI.Models.Skud.Phone
        //    {
        //        Uid = phone.Uid,
        //        Name = phone.Name,
        //        NumberString = phone.NumberString
        //    };
        //}

        public static FiresecAPI.Models.Skud.Department Translate(Department department)
        {
            if (department == null)
                return null;
            var phoneUids = new List<Guid>();
            department.Phone.ToList().ForEach(x => phoneUids.Add(x.Uid));
            var childDepartmentUids = new List<Guid>();
            department.Department2.ToList().ForEach(x => childDepartmentUids.Add(x.Uid));
            var resultDepartment = new FiresecAPI.Models.Skud.Department
            {
                Uid = department.Uid,
                Name = department.Name,
                Description = department.Description,
                ParentDepartmentUid = department.ParentDepartmentUid,
                ChildDepartmentUids = childDepartmentUids,
                ContactEmployeeUid = department.ContactEmployeeUid,
                AttendantEmployeeUId = department.AttendantUid,
                PhoneUids = phoneUids
            };
            return resultDepartment;
        }