public Control MapToOrm(DalControl entity)
 {
     return new Control
     {
         id = entity.Id,
         additionally = entity.Additionally,
         controlMethodDocumentationLib_id = entity.ControlMethodDocumentationLib_id,
         controlMethodsLib_id = entity.Lib_id,
         controlName_id = entity.ControlName_id,
         isControlled = entity.IsControlled,
         employeeLib_id = entity.EmployeeLib_id,
         equipmentLib_id = entity.EquipmentLib_id,
         imageLib_id = entity.ImageLib_id,
         light = entity.Light,
         number = entity.Number,
         protocolNumber = entity.ProtocolNumber,
         requirementDocumentationLib_id = entity.RequirementDocumentationLib_id,
         resultLib_id = entity.ResultLib_id,
         temperature = entity.Temperature,
         chiefEmployee_id = entity.ChiefEmployee_id
     };
 }
        public BllControl MapToBll(DalControl entity)
        {
            BllControl bllEntity = new BllControl
            {
                Id          = entity.Id,
                ControlName = entity.ControlName_id != null?controlNameService.Get((int)entity.ControlName_id) : null,
                                  EmployeeLib = entity.EmployeeLib_id != null?employeeLibService.Get((int)entity.EmployeeLib_id) : null,
                                                    ControlMethodDocumentationLib = entity.ControlMethodDocumentationLib_id != null?controlMethodDocumentationLibService.Get((int)entity.ControlMethodDocumentationLib_id) : null,
                                                                                        EquipmentLib = entity.EquipmentLib_id != null?equipmentLibService.Get((int)entity.EquipmentLib_id) : null,
                                                                                                           ImageLib = entity.ImageLib_id != null?imageLibService.Get((int)entity.ImageLib_id) : null,
                                                                                                                          RequirementDocumentationLib = entity.RequirementDocumentationLib_id != null?requirementDocumentationLibService.Get((int)entity.RequirementDocumentationLib_id) : null,
                                                                                                                                                            ResultLib = entity.ResultLib_id != null?resultLibService.Get((int)entity.ResultLib_id) : null,
                                                                                                                                                                            Additionally   = entity.Additionally,
                                                                                                                                                                            IsControlled   = entity.IsControlled,
                                                                                                                                                                            Light          = entity.Light,
                                                                                                                                                                            Number         = entity.Number,
                                                                                                                                                                            ProtocolNumber = entity.ProtocolNumber,
                                                                                                                                                                            Temperature    = entity.Temperature,
                                                                                                                                                                            ChiefEmployee  = entity.ChiefEmployee_id != null?employeeService.Get((int)entity.ChiefEmployee_id) : null,
            };

            return(bllEntity);
        }
        public DalControl MapToDal(BllControl entity)
        {
            DalControl dalEntity = new DalControl
            {
                Id              = entity.Id,
                Additionally    = entity.Additionally,
                IsControlled    = entity.IsControlled,
                Light           = entity.Light,
                Number          = entity.Number,
                ProtocolNumber  = entity.ProtocolNumber,
                EmployeeLib_id  = entity.EmployeeLib != null ? entity.EmployeeLib.Id : (int?)null,
                EquipmentLib_id = entity.EquipmentLib != null ? entity.EquipmentLib.Id : (int?)null,
                ControlMethodDocumentationLib_id = entity.ControlMethodDocumentationLib != null ? entity.ControlMethodDocumentationLib.Id : (int?)null,
                ImageLib_id = entity.ImageLib != null ? entity.ImageLib.Id : (int?)null,
                RequirementDocumentationLib_id = entity.RequirementDocumentationLib != null ? entity.RequirementDocumentationLib.Id : (int?)null,
                ResultLib_id     = entity.ResultLib != null ? entity.ResultLib.Id : (int?)null,
                ControlName_id   = entity.ControlName != null ? entity.ControlName.Id : (int?)null,
                Temperature      = entity.Temperature,
                ChiefEmployee_id = entity.ChiefEmployee != null ? entity.ChiefEmployee.Id : (int?)null
            };

            return(dalEntity);
        }