Blame view

App/listCtruong/VCListCtruong.swift 2.06 KB
d774f0637   Trịnh Văn Quân   fisrt comit
1
  import UIKit
1341bf603   Trịnh Văn Quân   version 1.1
2
  import GeneralUtils
d774f0637   Trịnh Văn Quân   fisrt comit
3
4
5
6
  
  class VCListCtruong: UIViewController, IVCLoadDataTableViewUIThread {
      @IBOutlet weak var tableView: UITableViewLoadDataFromUIThread!
      @IBOutlet weak var vTopLogo: VTopLogo!
1341bf603   Trịnh Văn Quân   version 1.1
7
      static func openController(_ viewController: UIViewController) {
d774f0637   Trịnh Văn Quân   fisrt comit
8
9
          let storyboard: UIStoryboard = UIStoryboard(name: "Main", bundle: nil)
          let vcOpen = storyboard.instantiateViewController(withIdentifier: "VCListCtruong") as! VCListCtruong
1341bf603   Trịnh Văn Quân   version 1.1
10
          viewController.present(vcOpen, animated: true, completion: nil)
d774f0637   Trịnh Văn Quân   fisrt comit
11
12
13
14
15
16
17
      }
  
      override func viewDidLoad() {
          super.viewDidLoad()
          self.tableView.separatorStyle = UITableViewCellSeparatorStyle.none
          self.tableView.rowHeight = 95//UITableViewAutomaticDimension
          self.tableView.estimatedRowHeight = 95
454c1bb6f   Trịnh Văn Quân   version 1.2.1
18
          tableView.emptyText = LocalizedString("list_empty")
d774f0637   Trịnh Văn Quân   fisrt comit
19
20
21
          tableView.initAndLoadData(self)
          vTopLogo.leftBtnClick = { self.dismiss(animated: true) }
      }
1341bf603   Trịnh Văn Quân   version 1.1
22
23
      override var prefersStatusBarHidden: Bool {
          return true
d774f0637   Trịnh Văn Quân   fisrt comit
24
      }
d774f0637   Trịnh Văn Quân   fisrt comit
25
26
      //region TableView ========
      func loadDataOnUI(complete: @escaping ([Any]?) -> ()) {
defd9642e   Trịnh Văn Quân   version 1.2
27
28
29
30
  //        complete(AppUtils.getListCtruong())
          NetWorkUtils.excuteHttpGet(urlStr: Constants.PathManager.ROOT_SERVER + "api/regulations/get/" + getIDWork(), completeArray: { (result: [CongTruong]?, errorText: String?) in
              complete(result)
          })
d774f0637   Trịnh Văn Quân   fisrt comit
31
32
33
34
35
36
37
38
39
40
41
42
43
      }
  
      func getAllCell() -> [BaseCell] {
          var baseCells: [BaseCell] = [BaseCell]();
          baseCells.append(BaseCell(type: 0, identifier: "Cell"))
          return baseCells
      }
  
      func getTypeOfData(baseobj: Any) -> Int {
          return 0
      }
  
      func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
1341bf603   Trịnh Văn Quân   version 1.1
44
          if let cTruong = self.tableView.getItem(indexPath) as? CongTruong {
fbd62afcf   Trịnh Văn Quân   version 1.2.2
45
              VCShootItemList.openController(self, cTruong: cTruong, tableViewListCtruong: self.tableView)
1341bf603   Trịnh Văn Quân   version 1.1
46
47
48
49
50
          }
      }
      //endregion
      override open var supportedInterfaceOrientations: UIInterfaceOrientationMask {
          return UIInterfaceOrientationMask.portrait
d774f0637   Trịnh Văn Quân   fisrt comit
51
      }
d774f0637   Trịnh Văn Quân   fisrt comit
52
  }