public void SendData()
 {
     _eventAggregator.PublishOnUIThread(new AddManyPaystubsEventModel(PaystubDataList.ToList(), AddToSelection.Code));
     ClearInputFields();
     PaystubDataList = new BindableCollection <Paystub>();
     this.TryClose(null);
 }
        public void Add()
        {
            Paystub temp = new Paystub()
            {
                Index = (uint)PaystubDataList.Count + 1
            };

            if (NameInput != null)
            {
                temp.Name = NameInput;
            }

            if (GrossInput != null)
            {
                temp.Gross = (decimal)GrossInput;
            }

            if (NetInput != null)
            {
                temp.Net = (decimal)NetInput;
            }

            PaystubDataList.Add(temp);
            ClearInputFields();
        }
Beispiel #3
0
        public void Handle(AddManyPaystubsEventModel message)
        {
            // Add New
            if (message.AddCode == 0)
            {
                PaystubDataList = new BindableCollection <Paystub>(message.PaystubDataList);
            }
            // Add To Front
            else if (message.AddCode == 1)
            {
                BindableCollection <Paystub> temp = new BindableCollection <Paystub>(message.PaystubDataList);
                temp.AddRange(this.PaystubDataList);

                PaystubDataList = temp;
            }
            else if (message.AddCode == 2)
            {
                PaystubDataList.AddRange(message.PaystubDataList);
            }
        }
Beispiel #4
0
        public void CalculatePaystubs()
        {
            Tuple <List <Paystub>, Tuple <decimal, decimal, decimal>, Tuple <decimal, decimal> > calcOut =
                PaystubCalculator.BeginCalc(
                    MessageManager.DisplayMessage,
                    ConvertWarning,
                    PaystubDataList.ToList(),
                    (decimal)AccuracyInput
                    );

            Decision = PaystubCalculator.Decision;

            //Tuple 1
            PaystubDataList = new BindableCollection <Paystub>(calcOut.Item1);

            // Tuple 2
            AverageGross   = calcOut.Item2.Item1;
            AverageNet     = calcOut.Item2.Item2;
            AveragePercent = calcOut.Item2.Item3;

            // Tuple 3
            PercentDifference  = calcOut.Item3.Item1;
            CompletePaystubOut = calcOut.Item3.Item2;
        }
Beispiel #5
0
 public void CalculatePercentages()
 {
     PaystubDataList = new BindableCollection <Paystub>(Paystub.GetPercentages(PaystubDataList.ToList()));
 }
Beispiel #6
0
 public void RemovePaystub()
 {
     PaystubDataList.Remove(SelectedPaystub);
 }
Beispiel #7
0
 public void AddPaystub()
 {
     PaystubDataList.Add(Paystub.Default((uint)PaystubDataList.Count));
 }