Exemplo n.º 1
0
 partial void UpdateDepartment(Department instance);
Exemplo n.º 2
0
 partial void DeleteDepartment(Department instance);
Exemplo n.º 3
0
 partial void InsertDepartment(Department instance);
Exemplo n.º 4
0
		private void detach_Department1(Department entity)
		{
			this.SendPropertyChanging();
			entity.Employee1 = null;
		}
Exemplo n.º 5
0
		private void attach_Department(Department entity)
		{
			this.SendPropertyChanging();
			entity.Employee = this;
		}
Exemplo n.º 6
0
		private void attach_Department2(Department entity)
		{
			this.SendPropertyChanging();
			entity.Department1 = this;
		}
Exemplo 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;
        }