예제 #1
0
 private static string GetDetailsString(Transaction transaction)
 {
     if (transaction.IsInbound) {
         return transaction.Sender.ToString();
     } else {
         return transaction.Receiver.ToString ();
     }
 }
예제 #2
0
 public static int AddOrUpdate(Transaction transaction)
 {
     if (transaction.Id == 0) {
         return DB.Insert (transaction);
     } else {
         return DB.Update (transaction);
     }
 }
예제 #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);
        }
예제 #4
0
 private static UIImage GetDirectionImage(Transaction transaction)
 {
     return null;
 }
예제 #5
0
 private static UIColor GetAmountColor(Transaction transaction)
 {
     return transaction.IsInbound ? Sys.GreenColor : Sys.RedColor;
 }
예제 #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;
        }
예제 #7
0
 public static int Delete(Transaction transaction)
 {
     return DB.Delete (transaction);
 }