Example #1
0
        public void ShowUnitIndexGroupInPeriodView(UnitIndexGroupInPeriodDTO unitIndexGroupInPeriodDto, ActionType action)
        {
            var view = ServiceLocator.Current.GetInstance <IUnitIndexGroupInPeriodView>();

            ((UnitIndexGroupInPeriodVM)view.ViewModel).Load(unitIndexGroupInPeriodDto, action);
            viewManager.ShowInDialog(view);
        }
Example #2
0
 public override AbstractUnitIndexInPeriodDTO MapToModel(AbstractUnitIndex entity)
 {
     if (entity is UnitIndex)
     {
         var res = new UnitIndexInPeriodDTO()
         {
             Id               = entity.Id.Id,
             PeriodId         = entity.PeriodId.Id,
             Name             = ((UnitIndex)entity).Name,
             DictionaryName   = ((UnitIndex)entity).DictionaryName,
             ParentId         = ((UnitIndex)entity).Group.Id.Id,
             UnitIndexId      = ((UnitIndex)entity).SharedUnitIndexId.Id,
             IsInquireable    = ((UnitIndex)entity).IsInquireable,
             CalculationLevel = ((UnitIndex)entity).CalculationLevel,
             CalculationOrder = ((UnitIndex)entity).CalculationOrder
         };
         return(res);
     }
     else
     {
         var res = new UnitIndexGroupInPeriodDTO()
         {
             Id             = entity.Id.Id,
             PeriodId       = entity.PeriodId.Id,
             Name           = ((UnitIndexGroup)entity).Name,
             DictionaryName = ((UnitIndexGroup)entity).DictionaryName,
         };
         if (((UnitIndexGroup)entity).Parent != null)
         {
             res.ParentId = ((UnitIndexGroup)entity).Parent.Id.Id;
         }
         return(res);
     }
 }
        public AbstractUnitIndexInPeriodDTO AddUnitIndexGroup(UnitIndexGroupInPeriodDTO abstractIndex)
        {
            var UnitIndexGroup = UnitIndexService.AddUnitIndexGroup(new PeriodId(abstractIndex.PeriodId),
                                                                    (abstractIndex.ParentId == null) ? null : new AbstractUnitIndexId(abstractIndex.ParentId.Value),
                                                                    abstractIndex.Name, abstractIndex.DictionaryName);

            return(UnitIndexMapper.MapToModel(UnitIndexGroup));
        }
        public AbstractUnitIndexInPeriodDTO UpdateUnitIndexGroup(UnitIndexGroupInPeriodDTO abstractIndex)
        {
            var UnitIndexGroup = UnitIndexService.UpdateUnitIndexGroup(new AbstractUnitIndexId(abstractIndex.Id)
                                                                       , (abstractIndex.ParentId.HasValue) ? new AbstractUnitIndexId(abstractIndex.ParentId.Value) : null
                                                                       , abstractIndex.Name, abstractIndex.DictionaryName);

            return(UnitIndexMapper.MapToModel(UnitIndexGroup));
        }
Example #5
0
 public UnitIndexGroupInPeriodVM()
 {
     PeriodMgtAppLocalizedResources = new PeriodMgtAppLocalizedResources();
     init();
     UnitIndexGroupInPeriod = new UnitIndexGroupInPeriodDTO {
         Name = "دوره اول"
     };
 }
Example #6
0
 public void Load(UnitIndexGroupInPeriodDTO unitIndexGroupInPeriodParam, ActionType actionTypeParam)
 {
     actionType             = actionTypeParam;
     UnitIndexGroupInPeriod = unitIndexGroupInPeriodParam;
     //if (actionType == ActionType.ModifyPeriod)
     //{
     //    ShowBusyIndicator();
     //    unitIndexService.GetPeriod((res, exp) =>
     //        {
     //            HideBusyIndicator();
     //            if (exp == null)
     //                UnitIndexGroupInPeriod = res;
     //            else
     //                appController.HandleException(exp);
     //        },
     //                            periodParam.Id);
     //}
 }
        public void DoAction(UnitIndexInPeriodTreeVM vm)
        {
            var unitIndexGroupInPeriod = new UnitIndexGroupInPeriodDTO
            {
                PeriodId = vm.Period.Id
            };

            if (vm.SelectedAbstractIndexInPeriod == null)
            {
                unitIndexGroupInPeriod.ParentId = null;
            }
            else
            {
                unitIndexGroupInPeriod.ParentId = vm.SelectedAbstractIndexInPeriod.Data.Id;
            }


            periodController.ShowUnitIndexGroupInPeriodView(unitIndexGroupInPeriod, ActionType.AddUnitIndexGroupInPeriod);
        }
        public void UpdateUnitIndexGroupInPeriod(Action <UnitIndexGroupInPeriodDTO, Exception> action, UnitIndexGroupInPeriodDTO unitIndexGroupInPeriod)
        {
            var url = string.Format(baseAddress + makeApiAdress(unitIndexGroupInPeriod.PeriodId));

            WebClientHelper.Put(new Uri(url, PMSClientConfig.UriKind), action, unitIndexGroupInPeriod, PMSClientConfig.MsgFormat, PMSClientConfig.CreateHeaderDic(userProvider.Token));
        }
Example #9
0
 private void init()
 {
     UnitIndexGroupInPeriod = new UnitIndexGroupInPeriodDTO();
     DisplayName            = PeriodMgtAppLocalizedResources.UnitIndexGroupInPeriodViewTitle;
 }