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