Package org.sab.invsys.web.model.payments

Examples of org.sab.invsys.web.model.payments.UserPaymentUI


public class UserPaymentMapper {

  Logger logger = Logger.getLogger(UserPaymentMapper.class);

  public UserPaymentUI toUIBean(UserPayment data) {
    UserPaymentUI uiBean = null;

    if (data != null) {
      uiBean = new UserPaymentUI();
      uiBean.setAmount(data.getAmount());
      uiBean.setId(data.getId());
      uiBean.setNotes(data.getNotes());
      uiBean.setPaymentDate(data.getPaymentDate());
      uiBean.setPaymentType(data.getPaymentType());
      if (data.getUser() != null) {
        uiBean.setUserName(data.getUser().getUsername());
      }
    }

    logger.debug("Payment is :: " + uiBean);
View Full Code Here


  }

  @RequestMapping(value = "/view/{paymentId}")
  public String getCustomerView(@PathVariable String paymentId, Model model)
      throws Exception {
    UserPaymentUI payment = service.find(new Long(paymentId)
        .longValue());

    model.addAttribute("paymentBean", payment);
    model.addAttribute("operationName", "update");
View Full Code Here

  @RequestMapping(value = "/update")
  public @ResponseBody
  Map<String, ? extends Object> update(UserPaymentUI data)
      throws Exception {
    try {
      UserPaymentUI payment = service.update(data);

      if (payment != null) {
        return extJS.mapOK(payment, "Payment Updated Succesfully");
      } else {
        return extJS.mapError("Error trying to update payment.");
View Full Code Here

    }
  }

  @RequestMapping(value = "/add", method = RequestMethod.GET)
  public String addProduct(Model model) throws Exception {
    UserPaymentUI payment = new UserPaymentUI();
    model.addAttribute("paymentBean", payment);
    model.addAttribute("operationName", "add");

    return "payments/payment";
  }
View Full Code Here

    try {
      if (data.getId() != null) {
        return extJS.mapError("Payment Id already exists");
      }

      UserPaymentUI saved = service.create(data);
      if (saved != null) {
        return extJS.mapOK(saved, "Payment Created Succesfully");
      } else {
        return extJS.mapError("Error trying to create Payment.");
      }
View Full Code Here

      List<UserPaymentUI> deletedPayments = new ArrayList<UserPaymentUI>();

      for (String paymentId : name.substring(1, name.length() - 1)
          .replaceAll("\"", "").split(",")) {
        UserPaymentUI payment = service.find(new Long(paymentId)
            .longValue());

        if (payment != null) {
          service.delete(payment);
          deletedPayments.add(payment);
View Full Code Here

TOP

Related Classes of org.sab.invsys.web.model.payments.UserPaymentUI

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.