Ejemplo n.º 1
0
        //================================================================================
        private void submitActionCallback(ScrapDto result, Exception exception)
        {
            this.fuelMainController.BeginInvokeOnDispatcher(() =>
            {
                this.HideBusyIndicator();

                if (exception == null)
                {
                    this.fuelMainController.Publish(new ScrapListChangedArg());

                    this.fuelMainController.ShowMessage(SUCCESSFUL_OPERATION_MESSAGE);

                    this.fuelMainController.Close(this);
                }
                else
                {
                    this.fuelMainController.HandleException(exception);
                }
            });
        }
Ejemplo n.º 2
0
 //================================================================================
 public void Edit(ScrapDto scrapDto)
 {
     this.isInEditMode = true;
     initialize(scrapDto);
 }
Ejemplo n.º 3
0
        //================================================================================
        private void initialize(ScrapDto scrapDto)
        {
            loadOwningCompanies();

            loadSecondPartyCompanies();

            this.Entity = scrapDto;
        }
Ejemplo n.º 4
0
        //================================================================================
        private void setEditProperties(Scrap scrap, ScrapDto scrapDto)
        {
            scrapDto.IsScrapEditPermitted = scrapDomainService.IsScrapEditPermitted(scrap);
            scrapDto.IsScrapDeletePermitted = scrapDomainService.IsScrapDeletePermitted(scrap);

            scrapDto.IsScrapAddDetailPermitted = scrapDomainService.IsScrapDetailAddPermitted(scrap);
            scrapDto.IsScrapEditDetailPermitted = scrapDomainService.IsScrapDetailEditPermitted(scrap);
            scrapDto.IsScrapDeleteDetailPermitted = scrapDomainService.IsScrapDetailDeletePermitted(scrap);

            scrapDto.IsGoodEditable = scrapDomainService.IsGoodEditable(scrap);
            scrapDto.IsTankEditable = scrapDomainService.IsTankEditable(scrap);
        }
Ejemplo n.º 5
0
        //================================================================================
        public void AddScrap(Action<ScrapDto, Exception> action, ScrapDto dto)
        {
            var url = string.Format(this.scrapAddressFormatString, string.Empty);

            WebClientHelper.Post(ApiServiceAddressHelper.BuildUri(url), action, dto, WebClientHelper.MessageFormat.Json,ApiConfig.Headers);
        }
Ejemplo n.º 6
0
        //================================================================================
        //private PageResultDto<FuelReportInventoryOperationDto> mapPageResult(PageResult<InventoryOperation> pageResult, GoodDto good)
        //{
        //    var result = new PageResultDto<FuelReportInventoryOperationDto>()
        //    {
        //        CurrentPage = pageResult.CurrentPage,
        //        PageSize = pageResult.PageSize,
        //        TotalCount = pageResult.TotalCount,
        //        TotalPages = pageResult.TotalPages,
        //        Result = inventoryOperationDtoMapper.MapToModel(pageResult.Result).ToList()
        //    };
        //    result.Result.ToList().ForEach(invDto => invDto.Good = good);
        //    return result;
        //}
        //================================================================================
        private PageResultDto<FuelReportInventoryOperationDto> mapPageResult(PageResult<InventoryOperation> pageResult, ScrapDto scrap)
        {
            var invOperationDtos = new List<FuelReportInventoryOperationDto>();

            foreach (var invOpr in pageResult.Result)
            {
                foreach (var detailDto in scrap.ScrapDetails)
                {
                    var invOprDto = inventoryOperationDtoMapper.MapToModel(invOpr);

                    invOprDto.Good = detailDto.Good;

                    invOperationDtos.Add(invOprDto);
                }
            }

            var result = new PageResultDto<FuelReportInventoryOperationDto>()
            {
                CurrentPage = pageResult.CurrentPage,
                PageSize = pageResult.PageSize,
                TotalCount = pageResult.TotalCount * scrap.ScrapDetails.Count,
                Result = invOperationDtos
            };

            return result;
        }
Ejemplo n.º 7
0
        //================================================================================
        public ScrapDto Update(ScrapDto dto)
        {
            var result = scrapApplicationService.UpdateScrap(dto.Id, dto.Vessel.Id, dto.SecondParty.Id, dto.ScrapDate);

            return scrapDtoMapper.MapToModel(result, this.setEditProperties);
        }
Ejemplo n.º 8
0
 public void EditScrapDetail(ScrapDto scrapDto, ScrapDetailDto scrapDetailDto)
 {
     var view = this.ViewManager.ShowInDialog<IScrapDetailView>();
     (view.ViewModel as ScrapDetailVM).Edit(scrapDto, scrapDetailDto);
 }
Ejemplo n.º 9
0
 public void Edit(ScrapDto scrapDto)
 {
     var view = this.ViewManager.ShowInDialog<IScrapView>();
     (view.ViewModel as ScrapVM).Edit(scrapDto);
 }
Ejemplo n.º 10
0
 public void AddScrapDetail(ScrapDto scrapDto)
 {
     var view = this.ViewManager.ShowInDialog<IScrapDetailView>();
     (view.ViewModel as ScrapDetailVM).Load(scrapDto);
 }