19 package org.turro.crm.zul.sector;
21 import java.util.Collection;
22 import java.util.Iterator;
23 import java.util.logging.Level;
24 import java.util.logging.Logger;
25 import org.turro.command.Command;
26 import org.turro.command.Context;
27 import org.turro.crm.db.CrmPU;
28 import org.turro.crm.entity.Customer;
29 import org.turro.crm.entity.Technology;
30 import org.turro.elephant.context.ElephantContext;
31 import org.turro.elephant.util.Images;
32 import org.turro.elephant.util.Messages;
33 import org.turro.zkoss.input.MultiLabelBox;
44 this.customer = customer;
84 return new CrmPU().getResultList(
"select distinct a.name from Technology a");
88 protected void addChoice(
final String choice,
final Command command) {
90 if(asl.getName().equalsIgnoreCase(choice)) {
95 "select a from Technology a where a.name = ?",
96 new Object[] { choice });
101 nas =
new CrmPU().saveObject(nas);
103 if(command !=
null) command.execute(
null);
107 if(command !=
null)
try {
108 command.execute(
null);
109 }
catch (Exception ex) {
116 protected void changeChoice(
final String oldChoice, String choice,
final Command command) {
119 public Object execute(Context context) {
121 if(command !=
null) command.execute(
null);
130 while(it.hasNext()) {
131 if(it.next().getName().equals(oldChoice)) {
133 if(command !=
null)
try {
134 command.execute(
null);
135 }
catch (Exception ex) {
Set< Technology > getTechnologies()
void setName(String name)
void deleteChoice(String oldChoice, Command command)
void setCustomer(Customer customer)
void addChoice(final String choice, final Command command)
void changeChoice(final String oldChoice, String choice, final Command command)
Collection< Technology > getCollection()
Collection< String > getLabelChoices()
String convertToString(Technology label)
static String logMsg(String msg)
static String getImage(String image)
static Messages confirmAcceptation()
Messages add(String word)
Object getSingleResultOrNull(SqlClause sc)