public PartyForm(final String mode){
		contentPanel.setLayout(new GridBagLayout());
		btnAddParty = new JButton(mode + " Party");
		GridBagConstraints gbc = new GridBagConstraints();
		gbc.gridx = 0;
		gbc.gridy = 0;
		gbc.anchor = GridBagConstraints.LINE_START;
		contentPanel.add(lblPartyType, gbc);
		gbc.gridx = 5;
		contentPanel.add(comboPartyType, gbc);
		if(mode.equalsIgnoreCase(Config.OperationMode.UPDATE)){
			comboPartyType.addActionListener(new ActionListener() {
				
				@Override
				public void actionPerformed(ActionEvent e) {
					comboParty.removeAllItems();
					List<Party> sourceParties = DAOProvider.getPartyDAO().getByType(comboPartyType.getSelectedItem().toString());
					for(Party party: sourceParties){
						comboParty.addItem(new Item(party.getPartyId(), party.getName()));
					}
					
				}
			});
		}
		gbc.gridx = 0;
		gbc.gridy = 1;
		contentPanel.add(lblName, gbc);
		gbc.gridx = 5;
		if(mode.equalsIgnoreCase(Config.OperationMode.CREATE)){
			contentPanel.add(txtName, gbc);
		}else{
			contentPanel.add(comboParty, gbc);
			comboParty.addActionListener(new ActionListener() {
				
				@Override
				public void actionPerformed(ActionEvent e) {
					if(comboParty.getSelectedIndex() > -1){
					Party party = DAOProvider.getPartyDAO().get(((Item)comboParty.getSelectedItem()).getId());
					txtName.setText(party.getName());
					txtPhone1.setText(party.getPhone1());
					txtPhone2.setText(party.getPhone2());
					txtAddress.setText(party.getAddress());
					txtAdditionalInformation.setText(party.getAddtionInformation());
					}
				}
			});
		}
		gbc.gridx = 0;
		gbc.gridy = 2;
		contentPanel.add(lblPhone1, gbc);
		gbc.gridx = 5;
		contentPanel.add(txtPhone1, gbc);
		gbc.gridx = 0;
		gbc.gridy = 3;
		contentPanel.add(lblPhone2, gbc);
		gbc.gridx = 5;
		contentPanel.add(txtPhone2, gbc);
		gbc.gridx = 0;
		gbc.gridy = 4;
		contentPanel.add(lblAddress, gbc);
		gbc.gridx = 5;
		contentPanel.add(txtAddress, gbc);
		gbc.gridx = 0;
		gbc.gridy = 8;
		contentPanel.add(lblAdditionalInformation, gbc);
		gbc.gridx = 5;
		txtAdditionalInformation.setBackground(Color.YELLOW);
		contentPanel.add(txtAdditionalInformation, gbc);
		gbc.gridx = 0;
		gbc.gridy = 9;
		contentPanel.add(btnAddParty, gbc);
		
		btnAddParty.addActionListener(new ActionListener() {
			
			@Override
			public void actionPerformed(ActionEvent e) {
				if(hasNullValue(comboPartyType, txtName)){
					JOptionPane.showMessageDialog(contentPanel,
						    "Party Type or Name not provied.",
						    "Data Error",
						    JOptionPane.ERROR_MESSAGE);
				}else{
					Party party = new Party();
					if(mode.equalsIgnoreCase(OperationMode.UPDATE)){
						party.setPartyId(((Item)comboParty.getSelectedItem()).getId());
					}
					party.setName(getTextValue(txtName));
					party.setPartyType(comboPartyType.getSelectedItem().toString());
					party.setPhone1(getTextValue(txtPhone1));
					party.setPhone2(getTextValue(txtPhone2));
					party.setAddress(getTextValue(txtAddress));
					party.setAddtionInformation(getTextValue(txtAdditionalInformation));
					if(mode.equalsIgnoreCase(OperationMode.UPDATE)){
						if(DAOProvider.getPartyDAO().update(party)){
							JOptionPane.showMessageDialog(contentPanel,
								    "Party Type: " +  txtName.getText().trim() + " updated successfully.",
								    "Success",
								    JOptionPane.INFORMATION_MESSAGE);
						}else{
							JOptionPane.showMessageDialog(contentPanel,
								    "Error occured while updating Party Type: " +  txtName.getText().trim(),
								    "Failure",
								    JOptionPane.ERROR_MESSAGE);
							}
					}else{
						if(DAOProvider.getPartyDAO().add(party)){
							JOptionPane.showMessageDialog(contentPanel,
								    "Party: " +  txtName.getText().trim() + " added successfully.",
								    "Success",
								    JOptionPane.INFORMATION_MESSAGE);
						}else{
							JOptionPane.showMessageDialog(contentPanel,
								    "Error occured while adding Party: " +  txtName.getText().trim(),
								    "Failure",
								    JOptionPane.ERROR_MESSAGE);
						}
					}
					
					
				}
			}
		});
		
		
		getContentPane().add(contentPanel);
		getContentPane().setMinimumSize(new Dimension(50, 20));
		setVisible(true);
		//setExtendedState(JFrame.MAXIMIZED_BOTH);
		Insets insets = getInsets();
		setSize(new Dimension(insets.left + insets.right + 571,
	             insets.top + insets.bottom + 613));
	}