You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

50 lines
1.7 KiB

6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
  1. //
  2. // ResendTableViewCell.swift
  3. // GME Remit
  4. //
  5. // Created by gme_2 on 19/03/2019.
  6. // Copyright © 2019 Gobal Money Express Co. Ltd. All rights reserved.
  7. //
  8. import UIKit
  9. class ResendTableViewCell: UITableViewCell {
  10. enum Status: String {
  11. case paid = "paid"
  12. case unpaid = "unpaid"
  13. }
  14. @IBOutlet weak var bgView: UIView!
  15. @IBOutlet weak var dateLabel: UILabel!
  16. @IBOutlet weak var amountLabel: UILabel!
  17. @IBOutlet weak var paymentMethodLabel: UILabel!
  18. @IBOutlet weak var nameLabel: UILabel!
  19. @IBOutlet weak var transactionNumberLabel: UILabel!
  20. @IBOutlet weak var controlNumberLabel: UILabel!
  21. @IBOutlet weak var bankDetailLabel: UILabel!
  22. var model: ResendTransactionModel?
  23. override func awakeFromNib() {
  24. super.awakeFromNib()
  25. // Initialization code
  26. }
  27. func setup() {
  28. self.dateLabel.text = model?.sendDate
  29. self.amountLabel.text = (model?.pAmt ?? "") + " " + (model?.pCurrency ?? "")
  30. self.paymentMethodLabel.text = model?.payOutMode
  31. self.nameLabel.text = model?.recieverName
  32. let paystatus = model?.payStatus ?? ""
  33. self.transactionNumberLabel.text = paystatus.uppercased() // show pay status, paid or unpaid
  34. self.transactionNumberLabel.textColor = .white
  35. self.transactionNumberLabel.layer.cornerRadius = 5
  36. self.controlNumberLabel.text = self.model?.controlNumber
  37. let status = Status.init(rawValue: paystatus.lowercased()) ?? .unpaid
  38. self.transactionNumberLabel.backgroundColor = status == .paid ? AppConstants.themeBlueColor : AppConstants.themeRedColor
  39. self.bankDetailLabel.text = model?.bankName
  40. }
  41. }