Package edu.asu.securebanking.model

Examples of edu.asu.securebanking.model.InternalAccount


  @RequestMapping(value="/transferuser", method = RequestMethod.POST)
  public synchronized ModelAndView transferuser(@ModelAttribute("user") InternalAccount user,
      BindingResult result, Principal principal) throws InternalException {
   
    String name = principal.getName();
    InternalAccount currentuser = intBo.findUserByusername(name);
   
    if(currentuser.getEmployeeId() == user.getEmployeeId()){
      String message = "A Manager cannot transfer himself to another department!";
      ModelAndView modelAndView = new ModelAndView("internalmgmtsuccessmsg");
      modelAndView.addObject("message", message);
      return modelAndView;
    } else{
View Full Code Here


   
  @RequestMapping(method = RequestMethod.GET)
  public String initForm(ModelMap model, HttpSession session){
    if(session.getAttribute("passkeycheck") == "true"){
    InternalAccount user = new InternalAccount();

    //command object
    model.addAttribute("user", user);
    user.setPosition("NOTSET");
    user.setDeptid(6);
    //return form view
    return "createInternalAccount";
    }
    else{
View Full Code Here

  }

  @Override
  public InternalAccount findAccountByNameInternal(String username) {
    // TODO Auto-generated method stub
    InternalAccount ia = LoginAttemptDao.findAccountByNameInternal(username);
    if(ia != null){
      return ia;
    }
    return null;
  }
View Full Code Here

    ValidationUtils.rejectIfEmptyOrWhitespace(errors, "securityquestion", "required.securityquestion", "Field name is required.");
    ValidationUtils.rejectIfEmptyOrWhitespace(errors, "securityanswer", "required.securityanswer","Field name is required.");
    ValidationUtils.rejectIfEmptyOrWhitespace(errors, "deptid", "required.deptid","Field name is required.");
    ValidationUtils.rejectIfEmptyOrWhitespace(errors, "position", "required.position","Field name is required.");
   
    InternalAccount user = (InternalAccount)target;
   
    Boolean result;
   
    result = StringValidator.inputvalidation(user.getUsername(), "username");
    if(!result){
      errors.rejectValue("username","regex.username");
    }
   
    result = StringValidator.inputvalidation(user.getPassword(), "password");
    if(!result){
      errors.rejectValue("password","regex.password");
    }
   
    result = StringValidator.inputvalidation(user.getFirstname(), "general");
    if(!result){
      errors.rejectValue("firstname","regex.general");
    }
   
    result = StringValidator.inputvalidation(user.getLastname(), "general");
    if(!result){
      errors.rejectValue("lastname","regex.general");
    }
   
    result = StringValidator.inputvalidation(user.getDob(), "date");
    if(!result){
      errors.rejectValue("dob","regex.date");
    }
   
    result = StringValidator.inputvalidation(user.getSecurityanswer(), "general");
    if(!result){
      errors.rejectValue("securityanswer","regex.general");
    }
   
    result = StringValidator.inputvalidation(user.getAddress(), "address");
    if(!result){
      errors.rejectValue("address","regex.address");
    }
   
    result = StringValidator.inputvalidation(user.getPosition(), "general");
    if(!result){
      errors.rejectValue("position","regex.general");
    }
   
    result = StringValidator.inputvalidation(Integer.toString(user.getDeptid()), "dept");
    if(!result){
      errors.rejectValue("deptid","regex.dept");
    }
   
    result = StringValidator.inputvalidation(user.getSsn(), "number");
    if(!result){
      errors.rejectValue("ssn","regex.number");
    }
   
    result = StringValidator.inputvalidation(user.getTelephone(), "number");
    if(!result){
      errors.rejectValue("telephone","regex.number");
    }
   
    result = StringValidator.inputvalidation(user.getEmail(), "email");
    if(!result){
      errors.rejectValue("email","regex.email");
    }
    if(!(user.getPassword().equals(user.getVpassword()))){
      errors.rejectValue("password", "notmatch.password");
    }

    if("NONE".equals(user.getSecurityquestion())){
      errors.rejectValue("securityquestion", "required.securityquestion");
    }
  }
View Full Code Here

  }

  @RequestMapping("/CompanyManagementTransaction")
  public ModelAndView showInternalUserTransactionForm(Principal principal) {
    String name = principal.getName();
    InternalAccount currentuser = intBo.findUserByusername(name);

    if(currentuser.getDeptid() == 5){
      ModelAndView modelAndView = new ModelAndView("CompanyManagementTransactionCreation");

      InternalUserTransaction trans = new InternalUserTransaction();
      modelAndView.addObject("trans", trans);
      modelAndView.addObject("currentuser", currentuser);
View Full Code Here


  @RequestMapping(value = "/addCompanyManagementTransaction", method = RequestMethod.POST)
  public synchronized ModelAndView create(@ModelAttribute("trans") InternalUserTransaction trans, Principal principal) {
    String name = principal.getName();
    InternalAccount currentuser = intBo.findUserByusername(name);

    if(currentuser.getDeptid() == 5){
      boolean result;
      String errors = "";


      result = StringValidator.inputvalidation(trans.getTransType(), "genpattern");
View Full Code Here

  @RequestMapping(value="/displayMeetings")

  public synchronized ModelAndView listOfUTransactions(Principal principal) {
    String name = principal.getName();
    InternalAccount currentuser = intBo.findUserByusername(name);

    if(currentuser.getDeptid() == 5){
      ModelAndView modelAndView = new ModelAndView("CompanyManagementListMeetings");
      List<InternalUserTransaction> transactions = transactionBO.getDeptInternalUserTransactions(5); //5:Company Management
      System.out.println(transactions.listIterator());
      InternalUserTransaction trans = new InternalUserTransaction();
      modelAndView.addObject("transactions", transactions);
View Full Code Here

  @RequestMapping(value="/updateMeeting")
  public synchronized ModelAndView displayUpdatePage(@ModelAttribute("command") InternalUserTransaction transaction, Principal principal) {

    String name = principal.getName();
    InternalAccount currentuser = intBo.findUserByusername(name);

    if(currentuser.getDeptid() == 5){

      InternalUserTransaction internalTransaction = transactionBO.findTransactionById(transaction.getTransId());
      ModelAndView modelAndView = new ModelAndView("CompanyManagementMeetingUpdate");

     
View Full Code Here

  @RequestMapping(value="/updateCompanyMeeting")
  public synchronized ModelAndView updateCompanyMeeting(@ModelAttribute("trans") InternalUserTransaction transaction,
      BindingResult result,Principal principal) {
    String name = principal.getName();
    InternalAccount currentuser = intBo.findUserByusername(name);

    if(currentuser.getDeptid() == 5){
      boolean res;
      String errors = "";

      res = StringValidator.inputvalidation(transaction.getDescription(), "genpattern");
      if(!res){
View Full Code Here

  @RequestMapping(value="/deleteMeeting")
  public synchronized ModelAndView deletetransactionbyid(@ModelAttribute("trans") InternalUserTransaction transaction,Principal principal) {

    String name = principal.getName();
    InternalAccount currentuser = intBo.findUserByusername(name);

    if(currentuser.getDeptid() == 5){
      ModelAndView modelAndView = new ModelAndView("CompanyManagementMeetingDeleted");

      transactionBO.delete(transaction.getTransId());

      return modelAndView;
View Full Code Here

TOP

Related Classes of edu.asu.securebanking.model.InternalAccount

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.