Guest User

Untitled

a guest
Oct 16th, 2019
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Swift 2.31 KB | None | 0 0
  1. //
  2. //  NewBidCardViewController.swift
  3. //  UOnLoad
  4. //
  5. //  Created by Ivan Lupenkov on 10/12/19.
  6. //  Copyright © 2019 UOnLoad. All rights reserved.
  7. //
  8.  
  9. import UIKit
  10.  
  11. class NewBidCardViewController: UIViewController {
  12.    
  13.     let loadsDetailsViewController = LoadsDetailsViewController()
  14.    
  15.     var loadId: Int = 0
  16.     var amount: String = ""
  17.    
  18.     @IBOutlet weak var handleArea: UIView!
  19.     @IBOutlet weak var handleLabel: UILabel!
  20.     @IBOutlet weak var handleArrowImage: UIImageView!
  21.     @IBOutlet weak var amountLabel: UILabel!
  22.     @IBAction func confirmBidButton(_ sender: UIButton) {
  23.         let floatAmount = (amount as NSString).floatValue
  24.         sendBid(amount: floatAmount, load_id: self.loadId)
  25.     }
  26.     @IBAction func NumPad_1(_ sender: Any) {
  27.         amount += "1"
  28.         amountLabel.text = "$\(amount)"
  29.     }
  30.     @IBAction func NumPad_2(_ sender: Any) {
  31.         amount += "2"
  32.         amountLabel.text = "$\(amount)"
  33.     }
  34.     @IBAction func NumPad_3(_ sender: Any) {
  35.         amount += "3"
  36.         amountLabel.text = "$\(amount)"
  37.     }
  38.     @IBAction func NumPad_4(_ sender: Any) {
  39.         amount += "4"
  40.         amountLabel.text = "$\(amount)"
  41.     }
  42.     @IBAction func NumPad_5(_ sender: Any) {
  43.         amount += "5"
  44.         amountLabel.text = "$\(amount)"
  45.     }
  46.     @IBAction func NumPad_6(_ sender: Any) {
  47.         amount += "6"
  48.         amountLabel.text = "$\(amount)"
  49.     }
  50.     @IBAction func NumPad_7(_ sender: Any) {
  51.         amount += "7"
  52.         amountLabel.text = "$\(amount)"
  53.     }
  54.     @IBAction func NumPad_8(_ sender: Any) {
  55.         amount += "8"
  56.         amountLabel.text = "$\(amount)"
  57.     }
  58.     @IBAction func NumPad_9(_ sender: Any) {
  59.         amount += "9"
  60.         amountLabel.text = "$\(amount)"
  61.     }
  62.     @IBAction func NumPad_confirm(_ sender: Any) {
  63.         let floatAmount = (amount as NSString).floatValue
  64.         sendBid(amount: floatAmount, load_id: self.loadId)
  65.     }
  66.     @IBAction func NumPad_0(_ sender: Any) {
  67.         amount += "0"
  68.         amountLabel.text = "$\(amount)"
  69.     }
  70.     @IBAction func NumPad_del(_ sender: Any) {
  71.         amount = String(amount.dropLast())
  72.         amountLabel.text = "$\(amount)"
  73.     }
  74.     func sendBid(amount: Float?, load_id: Int?){
  75.         loadsDetailsViewController.saveBid(bid: amount, loadId: load_id)
  76.     }
  77. }
Advertisement
Add Comment
Please, Sign In to add comment