Ejemplo n.º 1
0
 public void Load(PeriodDTO periodDTOParam, UnitInPeriodDTO unitInPeriodParam)
 {
     Period       = periodDTOParam;
     UnitInPeriod = unitInPeriodParam;
     load();
     getAllEmployee();
 }
Ejemplo n.º 2
0
        //public void Load(UnitInPrdField unitInPrdFieldParam, ActionType actionTypeParam)
        public void Load(long periodId, UnitInPeriodDTO unitInPeriod, ActionType actionTypeParam)
        {
            if (unitInPeriod == null)
            {
                return;
            }

            actionType = actionTypeParam;
            preLoad(periodId);
            ShowBusyIndicator("در حال دریافت اطلاعات...");
            unitService.GetUnit((res, exp) => appController.BeginInvokeOnDispatcher(() =>
            {
                HideBusyIndicator();
                if (exp == null)
                {
                    Unit = res;
                    UnitCustomFieldDescriptionList = new List <AbstractCustomFieldDescriptionDTO>(Unit.CustomFields
                                                                                                  .Select(f => new AbstractCustomFieldDescriptionDTO()
                    {
                        Name = f.Name, Id = f.Id
                    }).ToList());

                    unitCustomFieldDescriptionList.Where(allFields => unitInPeriod.CustomFields.Select(f => f.Id).Contains(allFields.Id))
                    .ToList()
                    .ForEach(field => field.IsChecked = true);
                }
                else
                {
                    appController.HandleException(exp);
                }
            }), unitInPeriod.UnitId);
        }
Ejemplo n.º 3
0
        public void ShowUnitInPeriodUnitIndicesManageView(long periodId, UnitInPeriodDTO unitInPeriodDto, ActionType modifyUnitInPrdField)
        {
            var view = ServiceLocator.Current.GetInstance <IUnitInPeriodUnitIndicesView>();

            ((UnitInPeriodUnitIndicesVM)view.ViewModel).Load(periodId, unitInPeriodDto, modifyUnitInPrdField);
            viewManager.ShowInDialog(view);
        }
Ejemplo n.º 4
0
        public void ShowUnitInPeriodVerifierView(PeriodDTO period, UnitInPeriodDTO unitInPeriodDto, ActionType action)
        {
            var view = viewManager.ShowInTabControl <IUnitInPeriodVerifierView>(v => ((UnitInPeriodVerifierVM)v).Period.Id == period.Id &&
                                                                                ((UnitInPeriodVerifierVM)v).UnitInPeriod.Id == unitInPeriodDto.Id);

            ((UnitInPeriodVerifierVM)view.ViewModel).Load(period, unitInPeriodDto);
        }
Ejemplo n.º 5
0
        public UnitInPeriodDTO UpdateUnit(long periodId, UnitInPeriodDTO unitInPeriod)
        {
            var unit = unitService.UpdateUnit(new UnitId(new PeriodId(periodId), new SharedUnitId(unitInPeriod.UnitId)),
                                              unitInPeriod.CustomFields.Select(c => new SharedUnitCustomFieldId(c.Id)).ToList(),
                                              unitInPeriod.UnitIndices.Select(c => new UnitIndexForUnit(new AbstractUnitIndexId(c.Id), c.ShowforTopLevel, c.ShowforSameLevel, c.ShowforLowLevel)).ToList()
                                              );

            return(unitInPeriodDTOMapper.MapToModel(unit, new string[] { }));
        }
Ejemplo n.º 6
0
 public void Load(PeriodDTO periodDTOParam, UnitInPeriodDTO unitInPeriodParam)
 {
     Period       = periodDTOParam;
     UnitInPeriod = unitInPeriodParam;
     Load();
     DisplayName = PeriodMgtAppLocalizedResources.UnitInPeriodInquiryView + " " +
                   unitInPeriodParam.Name;
     getSubjectsInquirers();
 }
Ejemplo n.º 7
0
        public void Load(long periodId, UnitInPeriodDTO unitInPeriodParam, ActionType actionTypeParam)
        {
            if (unitInPeriodParam == null)
            {
                return;
            }
            UnitInPeriod = unitInPeriodParam;
            actionType   = actionTypeParam;
            preLoad(periodId);

            unitIndexInPeriodService.GetAllPeriodUnitIndexes((res, exp) => appController.BeginInvokeOnDispatcher(() =>
            {
                if (exp == null)
                {
                    foreach (var unitIndex in res)
                    {
                        var unitInPeriodUnitIndex = UnitInPeriod.UnitIndices.SingleOrDefault(j => j.Id == unitIndex.Id);
                        if (unitInPeriodUnitIndex != null)
                        {
                            unitInPeriodUnitIndex.IsChecked = true;
                            UnitIndexInPeriodList.Add(unitInPeriodUnitIndex);
                        }
                        else
                        {
                            UnitIndexInPeriodList.Add(new UnitInPeriodUnitIndexDTO
                            {
                                Id               = unitIndex.Id,
                                Name             = unitIndex.Name,
                                IsInquireable    = unitIndex.IsInquireable,
                                ShowforLowLevel  = true,
                                ShowforSameLevel = true,
                                ShowforTopLevel  = true
                            });
                        }
                    }
                    HideBusyIndicator();
                }
                else
                {
                    HideBusyIndicator();
                    appController.HandleException(exp);
                }
            }), periodId);
        }
Ejemplo n.º 8
0
        private UnitInPeriodDTO createDestinationUnitInPeriod(UnitDTO unit, long?parentId)
        {
            var res = new UnitInPeriodDTO
            {
                Name         = unit.Name,
                CustomFields = new List <CustomFieldDTO>(),
                UnitId       = unit.Id,
                ParentId     = parentId,
                UnitIndices  = unitIndexInperiodList.Select(c => new UnitInPeriodUnitIndexDTO
                {
                    Id               = c.Id,
                    Name             = c.Name,
                    IsInquireable    = c.IsInquireable,
                    ShowforLowLevel  = true,
                    ShowforSameLevel = true,
                    ShowforTopLevel  = true
                }).ToList()
            };

            return(res);
        }
Ejemplo n.º 9
0
 public UnitInPeriodDTO PostUnit(long periodId, UnitInPeriodDTO unitInPeriod)
 {
     return(periodUnitService.AssignUnit(periodId, unitInPeriod));
 }
Ejemplo n.º 10
0
 public UnitInPeriodDTO PutUnit(long periodId, UnitInPeriodDTO unitInPeriod)
 {
     //update customFields
     return(periodUnitService.UpdateUnit(periodId, unitInPeriod));
 }
Ejemplo n.º 11
0
 public UnitInPeriodDTO AddUnitInPeriod(long periodId, UnitInPeriodDTO unitInPeriodDto)
 {
     return(IntegrationHttpClient.Post <UnitInPeriodDTO, UnitInPeriodDTO>(apiUri, makeEndPoint(periodId), unitInPeriodDto));
     //var url = string.Format(baseAddress + makeApiAdress(periodId));
     //IntegrationWebClient.Post(new Uri(url, PMSClientConfig.UriKind), action, unitInPeriodDto, PMSClientConfig.MsgFormat, PMSClientConfig.CreateHeaderDic(userProvider.Token));
 }
Ejemplo n.º 12
0
        public void UpdateUnitInPeriod(Action <UnitInPeriodDTO, Exception> action, long periodId, UnitInPeriodDTO unitInPeriodDto)
        {
            var url = string.Format(baseAddress + makeApiAdress(periodId));

            WebClientHelper.Put(new Uri(url, PMSClientConfig.UriKind), action, unitInPeriodDto, PMSClientConfig.MsgFormat, PMSClientConfig.CreateHeaderDic(userProvider.Token));
        }