Exemplo n.º 1
0
        private void LoadInitialData()
        {
            var tempCollection = new ObservableCollection <CheckpointModel>();
            //ProfitAccountingCheckpoint testCP = WsdlRepository.GetProfitAccountingReport(Int32.Parse(StationRepository.GetUid(ChangeTracker.CurrentUser).location_id.ToString()), StationRepository.StationNumber, null, null);

            ProfitAccountingCheckpoint testCP = new ProfitAccountingCheckpoint();

            testCP.location = new ProfitAccounting();
            testCP.station  = new ProfitAccounting();

            tempCollection.Add(new CheckpointModel {
                ProfitAccountingCheckpoint = testCP
            });
            _Checkpoints = new ObservableCollection <CheckpointModel>(tempCollection);
            OnPropertyChanged("Checkpoints");
        }
Exemplo n.º 2
0
        private void AddReportFromLastCheckpoint()
        {
            ProfitAccountingCheckpoint testCP = WsdlRepository.GetProfitAccountingReport(Int32.Parse(StationRepository.GetUid(ChangeTracker.CurrentUser).location_id.ToString()), StationRepository.StationNumber, null, null);

            if (testCP != null)
            {
                testCP.general.endDate = DateTime.Now;
                Checkpoints.Insert(0, new CheckpointModel {
                    ProfitAccountingCheckpoint = testCP, IsLastCheckpoint = true
                });

                AccountingModel = testCP.location.model;
            }

            if (Checkpoints.Count > 0)
            {
                SelectedCheckpoint = Checkpoints.ElementAt(0);
            }
        }
Exemplo n.º 3
0
        private void LoadProperties(ProfitAccountingCheckpoint checkpoint)
        {
            if (checkpoint.location.totalCashIn != null)
            {
                totalCashIn = checkpoint.location.totalCashIn.Value.ToString();
            }
            else
            {
                totalCashIn = "";
            }

            if (checkpoint.location.totalCashOut != null)
            {
                totalCashOut = checkpoint.location.totalCashOut.Value.ToString();
            }
            else
            {
                totalCashOut = "";
            }

            if (checkpoint.location.totalStake != null)
            {
                totalStake = checkpoint.location.totalStake.Value.ToString();
            }
            else
            {
                totalStake = "";
            }

            if (checkpoint.location.totalWinnings != null)
            {
                totalWinning = checkpoint.location.totalWinnings.Value.ToString();
            }
            else
            {
                totalWinning = "";
            }

            if (checkpoint.location.tax != null)
            {
                tax = checkpoint.location.tax.Value.ToString();
            }
            else
            {
                tax = "";
            }

            if (checkpoint.location.basis != null)
            {
                basisForProfitSharing = checkpoint.location.basis.Value.ToString();
            }
            else
            {
                basisForProfitSharing = "";
            }

            if (checkpoint.location.fixStakeCommission != null)
            {
                fixStakeCommission = checkpoint.location.fixStakeCommission.Value.ToString();
            }
            else
            {
                fixStakeCommission = "";
            }

            if (checkpoint.location.flexCommission != null)
            {
                flexCommission = checkpoint.location.flexCommission.Value.ToString();
            }
            else
            {
                flexCommission = "";
            }

            if (checkpoint.location.shopOwnerShare != null)
            {
                shopOwnerShare = checkpoint.location.shopOwnerShare.Value.ToString();
            }
            else
            {
                shopOwnerShare = "";
            }

            if (checkpoint.location.subFranchisorShare != null && !ChangeTracker.CurrentUser.ShopPaymentsReadLocationOwner)
            {
                subFranchisorShare = checkpoint.location.subFranchisorShare.Value.ToString();
            }
            else
            {
                subFranchisorShare = "";
            }

            if (checkpoint.location.franchisorShare != null && !ChangeTracker.CurrentUser.ShopPaymentsReadLocationOwner)
            {
                franchisorShare = checkpoint.location.franchisorShare.Value.ToString();
            }
            else
            {
                franchisorShare = "";
            }

            if (checkpoint.location.mainOwnerShare != null && !ChangeTracker.CurrentUser.ShopPaymentsReadLocationOwner)
            {
                mainOwnerShare = checkpoint.location.mainOwnerShare.Value.ToString();
            }
            else
            {
                mainOwnerShare = "";
            }

            /**/

            if (checkpoint.location.totalCreditToShop != null)
            {
                creditToShop = checkpoint.location.totalCreditToShop.Value.ToString();
            }
            else
            {
                creditToShop = "";
            }

            if (checkpoint.location.totalPaymentToShop != null)
            {
                paymentFromShop = checkpoint.location.totalPaymentToShop.Value.ToString();
            }
            else
            {
                paymentFromShop = "";
            }

            if (checkpoint.location.cashTransfer != null)
            {
                cashTransfer = checkpoint.location.cashTransfer.Value.ToString();
            }
            else
            {
                cashTransfer = "";
            }



            //station part

            if (checkpoint.station.totalCashIn != null)
            {
                stationTotalCashIn = checkpoint.station.totalCashIn.Value.ToString();
            }
            else
            {
                stationTotalCashIn = "";
            }

            if (checkpoint.station.totalCashOut != null)
            {
                stationTotalCashOut = checkpoint.station.totalCashOut.Value.ToString();
            }
            else
            {
                stationTotalCashOut = "";
            }

            if (checkpoint.station.totalStake != null)
            {
                stationTotalStake = checkpoint.station.totalStake.Value.ToString();
            }
            else
            {
                stationTotalStake = "";
            }

            if (checkpoint.station.totalWinnings != null)
            {
                stationTotalWinning = checkpoint.station.totalWinnings.Value.ToString();
            }
            else
            {
                stationTotalWinning = "";
            }

            if (checkpoint.station.tax != null)
            {
                stationTax = checkpoint.station.tax.Value.ToString();
            }
            else
            {
                stationTax = "";
            }

            if (checkpoint.station.basis != null)
            {
                stationBasisForProfitSharing = checkpoint.station.basis.Value.ToString();
            }
            else
            {
                stationBasisForProfitSharing = "";
            }

            if (checkpoint.station.fixStakeCommission != null)
            {
                stationFixStakeCommission = checkpoint.station.fixStakeCommission.Value.ToString();
            }
            else
            {
                stationFixStakeCommission = "";
            }

            if (checkpoint.station.flexCommission != null)
            {
                stationFlexCommission = checkpoint.station.flexCommission.Value.ToString();
            }
            else
            {
                stationFlexCommission = "";
            }

            if (checkpoint.station.shopOwnerShare != null)
            {
                stationShopOwnerShare = checkpoint.station.shopOwnerShare.Value.ToString();
            }
            else
            {
                stationShopOwnerShare = "";
            }

            if (checkpoint.station.subFranchisorShare != null && !ChangeTracker.CurrentUser.ShopPaymentsReadLocationOwner)
            {
                stationSubFranchisorShare = checkpoint.station.subFranchisorShare.Value.ToString();
            }
            else
            {
                stationSubFranchisorShare = "";
            }

            if (checkpoint.station.franchisorShare != null && !ChangeTracker.CurrentUser.ShopPaymentsReadLocationOwner)
            {
                stationFranchisorShare = checkpoint.station.franchisorShare.Value.ToString();
            }
            else
            {
                stationFranchisorShare = "";
            }

            if (checkpoint.station.mainOwnerShare != null && !ChangeTracker.CurrentUser.ShopPaymentsReadLocationOwner)
            {
                stationMainOwnerShare = checkpoint.station.mainOwnerShare.Value.ToString();
            }
            else
            {
                stationMainOwnerShare = "";
            }

            /**/

            if (checkpoint.station.totalCreditToShop != null)
            {
                stationCreditToShop = checkpoint.station.totalCreditToShop.Value.ToString();
            }
            else
            {
                stationCreditToShop = "";
            }

            if (checkpoint.station.totalPaymentToShop != null)
            {
                stationPaymentFromShop = checkpoint.station.totalPaymentToShop.Value.ToString();
            }
            else
            {
                stationPaymentFromShop = "";
            }

            if (checkpoint.station.cashTransfer != null)
            {
                stationCashTransfer = checkpoint.station.cashTransfer.Value.ToString();
            }
            else
            {
                stationCashTransfer = "";
            }

            if (checkpoint.location.model != null)
            {
                DisplayComissions = !checkpoint.location.model.Equals("A");
                AccountingModel   = checkpoint.location.model;
            }
            else
            {
                AccountingModel = string.Empty;
            }

            OnPropertyChanged("totalCashIn");
            OnPropertyChanged("totalCashOut");
            OnPropertyChanged("totalStake");
            OnPropertyChanged("totalWinning");
            OnPropertyChanged("tax");
            OnPropertyChanged("basisForProfitSharing");
            OnPropertyChanged("fixStakeCommission");
            OnPropertyChanged("flexCommission");
            OnPropertyChanged("shopOwnerShare");
            OnPropertyChanged("subFranchisorShare");
            OnPropertyChanged("franchisorShare");
            OnPropertyChanged("mainOwnerShare");
            OnPropertyChanged("creditToShop");
            OnPropertyChanged("paymentFromShop");
            OnPropertyChanged("cashTransfer");

            //station part
            OnPropertyChanged("stationTotalCashIn");
            OnPropertyChanged("stationTotalCashOut");
            OnPropertyChanged("stationTotalStake");
            OnPropertyChanged("stationTotalWinning");
            OnPropertyChanged("stationTax");
            OnPropertyChanged("stationBasisForProfitSharing");
            OnPropertyChanged("stationFixStakeCommission");
            OnPropertyChanged("stationFlexCommission");
            OnPropertyChanged("stationShopOwnerShare");
            OnPropertyChanged("stationSubFranchisorShare");
            OnPropertyChanged("stationFranchisorShare");
            OnPropertyChanged("stationMainOwnerShare");
            OnPropertyChanged("stationCreditToShop");
            OnPropertyChanged("stationPaymentFromShop");
            OnPropertyChanged("stationCashTransfer");
            OnPropertyChanged("stationModel");
            OnPropertyChanged("DisplayComissions");
            OnPropertyChanged("AccountingModel");
        }