Beispiel #1
0
 private static string GetDetailsString(Transaction transaction)
 {
     if (transaction.IsInbound) {
         return transaction.Sender.ToString();
     } else {
         return transaction.Receiver.ToString ();
     }
 }
Beispiel #2
0
 public static int AddOrUpdate(Transaction transaction)
 {
     if (transaction.Id == 0) {
         return DB.Insert (transaction);
     } else {
         return DB.Update (transaction);
     }
 }
Beispiel #3
0
        public void UpdateCell(Transaction transaction)
        {
            if (transaction == null) {
                return;
            }

            this.DirectionImage.Image = GetDirectionImage(transaction);
            this.DescriptionLabel.Text = transaction.Description;
            this.AmountLabel.Text = transaction.Amount.ToString ("0.00") + " лв.";
            this.AmountLabel.TextColor = GetAmountColor (transaction);
            this.DetailsLabel.Text = GetDetailsString (transaction);
        }
Beispiel #4
0
 private static UIImage GetDirectionImage(Transaction transaction)
 {
     return null;
 }
Beispiel #5
0
 private static UIColor GetAmountColor(Transaction transaction)
 {
     return transaction.IsInbound ? Sys.GreenColor : Sys.RedColor;
 }
Beispiel #6
0
        private void SetupTableView()
        {
            if (this.Person == null) {
                return;
            }

            this.transactions = FinancerModel.GetTransactions ().Where (t => t.ReceiverId == this.Person.Id || t.SenderId == this.Person.Id).ToTransactionDictionary ();
            this.transactionsSource = new TransactionsSource (this.transactions);
            this.transactionsSource.Callback = (transaction) => {
                this.selectedTransaction = transaction as Transaction;
                this.PerformSegue(App.OldSegueIdentifier, this);
            };
            this.TransactionsTableView.Source = this.transactionsSource;
        }
Beispiel #7
0
 public static int Delete(Transaction transaction)
 {
     return DB.Delete (transaction);
 }