package com.restmatic.restautomation.vc.sc;

import com.acme.model.domain.sc.entity.CustomerDeliveryAddress;
import com.acme.model.domain.sc.entity.CustomerUser;
import com.acme.model.domain.sc.sessionbean.SCManager;
import com.acme.structure.GridData;
import com.acme.structure.ServiceLocator;

import com.acme.structure.SuperEntity;

import java.util.Currency;
import java.util.Vector;

import javax.ejb.EJB;

import javax.faces.event.ActionEvent;

import javax.naming.NamingException;

public class MemberShipMBean
{
    @EJB
    private GridData data = new GridData();
    private SuperEntity customer;
    private String confirmPassword=null;
    @EJB
    SCManager managerBean;
    private Vector baseRowCollection = new Vector();
    public MemberShipMBean()
    {
        try
        {
            managerBean = (SCManager)ServiceLocator.getInstance().getResource("ejb/SCManager/remote", SCManager.class);
        }
        catch (NamingException e)
        {
            e.printStackTrace();
        }
    }
    public void init()
    {
        customer=new CustomerUser();
        //countries
        //citiesforcountry
    }

    public void setData(GridData data)
    {
        this.data = data;
    }

    public GridData getData()
    {
        return data;
    }

    public void setBaseRowCollection(Vector baseRowCollection)
    {
        this.baseRowCollection = baseRowCollection;
    }

    public Vector getBaseRowCollection()
    {
        return baseRowCollection;
    }

    public void setCustomer(SuperEntity customer)
    {
        this.customer = customer;
    }

    public SuperEntity getCustomer()
    {
        return customer;
    }

    public void setConfirmPassword(String confirmPassword)
    {
        this.confirmPassword = confirmPassword;
    }

    public String getConfirmPassword()
    {
        return confirmPassword;
    }

    public void addAddressOfMemberShip(ActionEvent actionEvent)
    {
        CustomerDeliveryAddress custDelivery=new CustomerDeliveryAddress();
        ((CustomerUser)customer).getDeliveryAddresses().add(custDelivery);
    }
}
