Пример #1
0
        public void SetTranslation(TranslationDetailModel p_translation)
        {
            if (p_translation == null)
            {
                isEditMode    = false;
                p_translation = new MES_2.Modules.SystemModule.Translation.TranslationDetailModel();
                EntityAll     = new ObservableCollection <EntityModel>(EntitiesRepository.Instance.Retrieve());
                _stateAll     = new List <StateModel>(StatesRepository.Instance.Retrieve());
            }
            else
            {
                _stateAll = new List <StateModel>(StatesRepository.Instance.RetrieveByEntityId(p_translation.ENT_Entity.ID_ENT));
                Entity    = new EntityModel();
                Entity    = MapperEntity.MapENTToMapperEntity(p_translation.ENT_Entity);
                StateFrom = new StateModel();
                StateFrom = MapperState.MapSTAToState(p_translation.STATE_FROM);
                StateTo   = new StateModel();
                StateTo   = MapperState.MapSTAToState(p_translation.STATE_TO);
            }

            EdditingTranslation = p_translation;
            if (Translation != null)
            {
                Translation.ErrorsChanged -= RaiseCanExecuteChanged;
            }
            Translation = new TranslationFullEditable();
            Translation.ErrorsChanged += RaiseCanExecuteChanged;
            CopyTranslation(EdditingTranslation, Translation);
        }
Пример #2
0
 private void UpdateCustomer(TranslationFullEditable source,
                             TranslationDetailModel target)
 {
     target.ID_ENT           = Entity.ID_ENT;
     target.ID_STA_PICA_FROM = StateFrom.ID_STA;
     target.ID_STA_PICA_TO   = StateTo.ID_STA;
     target.Description      = source.Description;
     target.L_BLOCK          = source.L_BLOCK;
     target.L_VALID          = source.L_VALID;
 }
Пример #3
0
        private void CopyTranslation(TranslationDetailModel source,
                                     TranslationFullEditable target)
        {
            if (isEditMode)
            {
                target.ID_ENT   = target.ID_ENT;
                target.NAME_ENT = source.ENT_Entity.NAME_ENT;

                target.ID_STA_FROM = source.ID_STA_PICA_FROM;

                target.ID_STA_TO   = source.ID_STA_PICA_TO;
                target.Description = source.Description;
                target.L_BLOCK     = source.L_BLOCK;
                target.L_VALID     = source.L_VALID;
            }
        }