示例#1
0
    def test_account__get_account_all(self):

        service = AccountService()
        data = service.get_account_all()
        # #Print test data
        # ServiceTestCase.Entity.print_ValueListEntityClass(data)

        self.assertIsNotNone(data, '###Error Message: No data')
示例#2
0
    def test_account__combination(self):

        service = AccountService()
        data = service.get_account_all()
        # #Print test data
        # ServiceTestCase.Entity.print_ValueListEntityClass(data)

        accountId = '19C715AB-AE97-4A67-B142-CDA388D9F76B'
        data2 = service.get_account_byId(accountId)
        # print('#'*10 + 'AccountId: ' + accountId + '#'*10)
        # ServiceTestCase.Entity.print_ValueEntityClass(data2)

        self.assertIsNotNone(data, '###Error Message: No data')
        self.assertIsNotNone(data2, '###Error Message: No data')
示例#3
0
    def initControls(self):

        self.btnSave = wx.Button(self, label="Lưu")

        self.lbAccountId = wx.StaticText(self, label="Mã Tài Khoản KH")
        self.txtAccountId = wx.TextCtrl(self, style=wx.TE_READONLY)

        # self.lbIndexNo = wx.StaticText(self, label="So Thu Tu")
        # self.txtIndexNo = wx.TextCtrl(self, style=wx.TE_READONLY)

        self.lbUsername = wx.StaticText(self, label="Tên Đăng Nhập")
        self.txtUsername = wx.TextCtrl(self, value="")

        self.chkIsBooker = wx.CheckBox(
            self, label="Tài khoản này của Người Đại Diện?")

        self.chkIsClientAvailable = wx.CheckBox(
            self, label="Xác nhận Khách Hàng hợp lệ")

        ###Region: Grid DATA
        service = AccountService()
        data = service.get_account_all()

        totalrows = len(data) + 1 or 20
        totalcolumns = 2

        self.tblData = gridlib.Grid(self)
        self.tblData.CreateGrid(totalrows, totalcolumns)
        self.tblData.SetCellValue(
            0,
            0,
            "Mã TK",
        )
        self.tblData.SetCellValue(0, 1, "Tên Đăng Nhập")
        # Set Style for Header Column
        for index in range(0, 2):
            self.tblData.SetCellBackgroundColour(0, index, wx.BLACK)
            self.tblData.SetCellTextColour(0, index, wx.WHITE)

        for idx, item in enumerate(data):
            self.tblData.SetCellValue(idx + 1, 0, item.AccountId)
            self.tblData.SetCellValue(idx + 1, 1, item.Username)

        self.tblData.SetSelectionMode(wx.grid.Grid.SelectRows)