Beispiel #1
0
 def __init__(self):
     super(UserProxy, self).__init__(UserProxy.NAME, [])
     self.data = []
     self.addItem(
         vo.UserVO('lstooge', 'Larry', 'Stooge', "*****@*****.**",
                   'ijk456', ApplicationConstants.DEPT_ACCT))
     self.addItem(
         vo.UserVO('cstooge', 'Curly', 'Stooge', "*****@*****.**",
                   'xyz987', ApplicationConstants.DEPT_SALES))
     self.addItem(
         vo.UserVO('mstooge', 'Moe', 'Stooge', "*****@*****.**", 'abc123',
                   ApplicationConstants.DEPT_PLANT))
 def onAdd(self, evt):
     user = vo.UserVO(self.viewComponent.usernameInput.GetValue(),
                      self.viewComponent.firstInput.GetValue(),
                      self.viewComponent.lastInput.GetValue(),
                      self.viewComponent.emailInput.GetValue(),
                      self.viewComponent.passwordInput.GetValue(),
                      self.viewComponent.departmentCombo.GetValue())
     self.viewComponent.user = user
     self.userProxy.addItem(user)
     self.sendNotification(main.AppFacade.USER_ADDED, user)
     self.clearForm()
Beispiel #3
0
 def updateUser(self):
     l = self.viewComponent.departmentCombo.getSelectedItemText(True)
     l = l and l[0] or None
     user = vo.UserVO(self.viewComponent.usernameInput.getText(),
                      self.viewComponent.firstInput.getText(),
                      self.viewComponent.lastInput.getText(),
                      self.viewComponent.emailInput.getText(),
                      self.viewComponent.passwordInput.getText(), l)
     self.viewComponent.user = user
     self.userProxy.updateItem(user)
     self.sendNotification(Notification.USER_UPDATED, user)
     self.clearForm()
 def onNew(self, evt):
     user = vo.UserVO()
     self.sendNotification(main.AppFacade.NEW_USER, user)