Exemple #1
0
  BaseFormPanel createbcode_Spouse_Form() {
    form = new BaseFormPanel(get_bcode_Spouse_Store());
    TableLayout tl = new TableLayout(6);

    TableData td = new TableData();
    td.setRowspan(1);
    td.setHorizontalAlign(HorizontalAlignment.LEFT);
    td.setVerticalAlign(VerticalAlignment.MIDDLE);
    td.setPadding(2);
    form.setLayout(tl);
    form.setHeaderVisible(false);
    form.setBodyBorder(false);
    form.setPadding(1);

    form.add(new Label("配偶中文名称:"), td);
    TextField<String> C_num3 = new TextField<String>();
    C_num3.setName("Spouse_cnname");
    form.add(C_num3, td);
    form.add(new Label("配偶英文名称:"), td);
    TextField<String> C_num4 = new TextField<String>();
    C_num4.setName("Spouse_enname");
    form.add(C_num4, td);
    form.add(new Label("身份证号:"), td);
    TextField<String> C_num5 = new TextField<String>();
    C_num5.setName("idcard");
    form.add(C_num5, td);
    form.add(new Label("国籍:"), td);
    BaseComboBoxX C_num6 = new BaseComboBoxX("name", "dictionary", "where type='hr_Country'");
    C_num6.setName("Nationality");
    form.add(C_num6, td);
    form.add(new Label("护照编码:"), td);
    TextField<String> C_num7 = new TextField<String>();
    C_num7.setName("PassportNo");
    form.add(C_num7, td);
    form.add(new Label("护照签发国家:"), td);
    BaseComboBoxX C_num8 = new BaseComboBoxX("name", "dictionary", "where type='hr_Country'");
    C_num8.setName("PassportIssueCountry");
    form.add(C_num8, td);
    form.add(new Label("护照签发日期:"), td);
    DateField C_data9 = new DateField();
    C_data9.getPropertyEditor().setFormat(DateTimeFormat.getFormat("yyyy-M-d"));
    C_data9.setName("PassportIssueDate");
    form.add(C_data9, td);
    form.add(new Label("职业:"), td);
    TextField<String> C_num10 = new TextField<String>();
    C_num10.setName("Occupation");
    form.add(C_num10, td);

    form.add(new Label("公司:"), td);
    TextField<String> C_num11 = new TextField<String>();
    C_num11.setName("Company");
    form.add(C_num11, td);

    form.add(new Label("工作职位:"), td);
    TextField<String> C_num14 = new TextField<String>();
    C_num14.setName("JobPosition");
    form.add(C_num14, td);
    form.inited(126);
    return form;
  };
  private Widget createDateField() {
    dateField = new DateField();
    dateField.setFieldLabel("Date");
    dateField.setAllowBlank(false);

    return dateField;
  }
Exemple #3
0
  BaseGrid<BusiObject> create_bcode_famify_Grid() {
    CheckBoxSelectionModel<BusiObject> cbs = new CheckBoxSelectionModel<BusiObject>();
    List<ColumnConfig> columns = new ArrayList<ColumnConfig>();
    columns.add(cbs.getColumn());
    ColumnConfig C3 = new ColumnConfig("ChineseName", "中文名", 80);
    C3.setEditor(new CellEditor(new TextField<String>()));
    columns.add(C3);
    ColumnConfig C4 = new ColumnConfig("englishname", "英文名称", 80);
    C4.setEditor(new CellEditor(new TextField<String>()));
    columns.add(C4);
    ColumnConfig C5 = new ColumnConfig("Relationship", "关系", 80);
    BaseComboBoxX bc5 = new BaseComboBoxX("name", "dictionary", "where type='hr_relationship'");
    C5.setEditor(bc5.getCellEditor());

    columns.add(C5);
    ColumnConfig C6 = new ColumnConfig("Birthday", "生日", 80);
    DateField dateField6 = new DateField();
    dateField6.getPropertyEditor().setFormat(DateTimeFormat.getFormat("yyyy-MM-dd"));
    C6.setEditor(new CellEditor(dateField6));
    C6.setDateTimeFormat(DateTimeFormat.getFormat("yyyy-MM-dd"));
    columns.add(C6);
    ColumnConfig C7 = new ColumnConfig("sex", "性别", 80);
    BaseComboBoxX bc7 = new BaseComboBoxX("name", "dictionary", "where type='hr_sex'");
    C7.setEditor(bc7.getCellEditor());
    columns.add(C7);
    ColumnConfig C8 = new ColumnConfig("Nationality", "国籍", 80);
    BaseComboBoxX bc8 = new BaseComboBoxX("name", "dictionary", "where type='hr_Country'");
    C8.setEditor(bc8.getCellEditor());
    columns.add(C8);
    ColumnConfig C9 = new ColumnConfig("PassportNo", "护照编码", 80);
    C9.setEditor(new CellEditor(new TextField<String>()));
    columns.add(C9);
    ColumnConfig C10 = new ColumnConfig("PassportIssueCountry", "护照发出地", 80);
    C10.setEditor(new CellEditor(new TextField<String>()));
    columns.add(C10);
    ColumnConfig C11 = new ColumnConfig("PassportIssueDate", "护照发出日期", 80);
    DateField dateField11 = new DateField();
    dateField11.getPropertyEditor().setFormat(DateTimeFormat.getFormat("yyyy-MM-dd"));
    C11.setEditor(new CellEditor(dateField11));
    C11.setDateTimeFormat(DateTimeFormat.getFormat("yyyy-MM-dd"));
    columns.add(C11);
    ColumnConfig C12 = new ColumnConfig("Occupation", "职业", 80);
    C12.setEditor(new CellEditor(new TextField<String>()));
    columns.add(C12);
    ColumnConfig C13 = new ColumnConfig("Company", "公司", 80);
    C13.setEditor(new CellEditor(new TextField<String>()));
    columns.add(C13);
    ColumnConfig C14 = new ColumnConfig("JobPosition", "职位", 80);
    C14.setEditor(new CellEditor(new TextField<String>()));
    columns.add(C14);

    ColumnModel cm = new ColumnModel(columns);
    bcode_famify_grid = new BaseGrid<BusiObject>(get_bcode_famify_Store(), cm, true, true);
    cbs.setSelectionMode(SelectionMode.SINGLE);
    bcode_famify_grid.setSelectionModel(cbs);
    bcode_famify_grid.setHeight(400);
    return bcode_famify_grid;
  }
    protected void reloadFoglioOre() {

      setHeight(480);
      setWidth(680);

      dtfldGiorno.setValue(giornoRiferimento.getValue());

      cmbxDipendente.setFieldLabel("Dipendente");
      cmbxDipendente.setEnabled(true);
      cmbxDipendente.setEmptyText("Selezionare il dipendente..");
      cmbxDipendente.setEditable(false);
      cmbxDipendente.setVisible(true);
      cmbxDipendente.setTriggerAction(TriggerAction.ALL);
      cmbxDipendente.setAllowBlank(false);
      cmbxDipendente.setDisplayField("nomeCompleto");
      cmbxDipendente.addListener(
          Events.OnClick,
          new Listener<BaseEvent>() {
            @Override
            public void handleEvent(BaseEvent be) {
              getAllDipendenti();
            }
          });

      ButtonBar buttonBarTop = new ButtonBar();
      buttonBarTop.setAlignment(HorizontalAlignment.CENTER);
      buttonBarTop.setStyleAttribute("padding-bottom", "5px");
      buttonBarTop.setBorders(false);
      buttonBarTop.setWidth(570);
      buttonBarTop.setItemId("buttonBar");

      buttonBarTop.add(giornoRiferimento);
      buttonBarTop.add(cmbxDipendente);
      buttonBarTop.add(btnSend);

      ButtonBar btnBarOperazioni = new ButtonBar();
      btnBarOperazioni.setAlignment(HorizontalAlignment.LEFT);
      btnBarOperazioni.setBorders(false);
      btnBarOperazioni.add(btnRiepilogoCommesse);
      btnBarOperazioni.add(btnInviaCommenti);
      btnBarOperazioni.add(btnConferma);

      left.removeAll();
      right.removeAll();

      left.add(btnBarOperazioni);
      left.add(buttonBarTop);
      // left.add(new FldsetIntervalliIU());
      left.add(new FldsetIntervalliCommesse());

      // right.add(new FldsetGiustificativi());
      // right.add(new FldsetRiepilogo());

      main.removeAll();
      main.add(left);
      main.add(right);
      main.layout(true);

      frm.layout(true);
    }
 public boolean isValid() {
   if (storeComboBox.isValid()
       && billTypeComboBox.isValid()
       && costField.isValid()
       && dateField.isValid()
       && noteField.isValid()) {
     return true;
   } else {
     return false;
   }
 }
  private void loadContratos() {
    mainPanel.mask("Carregando dados. Aguarde...");
    InstanceService.CONTRATO_SERVICE.pesquisa(
        null,
        tfData.getValue(),
        new AsyncCallback<List<DTOContrato>>() {

          @Override
          public void onSuccess(List<DTOContrato> contratos) {
            storeContratos.removeAll();
            storeContratos.add(contratos);
            mainPanel.unmask();
          }

          @Override
          public void onFailure(Throwable caught) {
            WebMessageBox.error(caught.getMessage());
            mainPanel.unmask();
          }
        });
  }
  private void initUI() {
    long time = new java.util.Date().getTime();
    GWT.log("Initializing the UI ", null);

    container = new LayoutContainer();
    container.setLayout(new CenterLayout());

    // Rpc Proxy setup
    pagingToolBar = setupRpcProxy();

    // Audit event grid setup
    grid = setupGrid();

    // Panel
    ContentPanel cp = new ContentPanel();
    cp.setHeading("Entity Event Viewer");
    cp.setFrame(true);
    cp.setIcon(IconHelper.create("images/search_icon_16x16.png"));
    cp.setLayout(new FormLayout());
    cp.setSize(1100, 630);

    // Search Container
    ContentPanel searchContainer = new ContentPanel();
    searchContainer.setHeaderVisible(false);
    FormLayout searchFormLayout = new FormLayout();
    searchFormLayout.setLabelWidth(130);
    searchFormLayout.setDefaultWidth(770);

    searchContainer.setLayout(searchFormLayout);

    selectedEvenyTypes = new TextField<String>();
    selectedEvenyTypes.setFieldLabel("Selected Event Types");
    selectedEvenyTypes.setReadOnly(true);

    evenyTypes = new ListView<AuditEventTypeWeb>();
    evenyTypes.setDisplayProperty("auditEventTypeName");
    evenyTypes.setWidth(220);
    evenyTypes.setHeight(110);
    evenyTypes.setStore(eventTypesStore);
    evenyTypes
        .getSelectionModel()
        .addListener(
            Events.SelectionChange,
            new Listener<SelectionChangedEvent<AuditEventTypeWeb>>() {

              public void handleEvent(SelectionChangedEvent<AuditEventTypeWeb> be) {
                List<AuditEventTypeWeb> selections = be.getSelection();
                String selectedTypes = "";
                for (AuditEventTypeWeb type : selections) {
                  if (selectedTypes.isEmpty()) {
                    selectedTypes = type.getAuditEventTypeName();
                  } else {
                    selectedTypes = selectedTypes + ", " + type.getAuditEventTypeName();
                  }
                }
                selectedEvenyTypes.setValue(selectedTypes);

                if (selectedTypes.isEmpty()) {
                  searchButton.disable();
                } else {
                  searchButton.enable();
                }
              }
            });

    DateTimePropertyEditor dateFormat = new DateTimePropertyEditor("yyyy-MM-dd HH:mm");
    startDate = new DateField();
    startDate.setFieldLabel("Start Date Time");
    startDate.setToolTip("yyyy-MM-dd HH:mm");
    startDate.setPropertyEditor(dateFormat);

    endDate = new DateField();
    endDate.setFieldLabel("End Date Time");
    endDate.setToolTip("yyyy-MM-dd HH:mm");
    endDate.setPropertyEditor(dateFormat);

    LayoutContainer main = new LayoutContainer();
    main.setLayout(new ColumnLayout());

    LayoutContainer left = new LayoutContainer();
    left.setStyleAttribute("paddingRight", "10px");
    FormLayout layout = new FormLayout();
    layout.setLabelWidth(130);
    layout.setDefaultWidth(220);
    // layout.setLabelAlign(LabelAlign.TOP);
    left.setLayout(layout);
    left.add(startDate);

    LayoutContainer right = new LayoutContainer();
    right.setStyleAttribute("paddingLeft", "10px");
    layout = new FormLayout();
    // layout.setLabelAlign(LabelAlign.TOP);
    layout.setLabelWidth(130);
    layout.setDefaultWidth(220);
    right.setLayout(layout);
    right.add(endDate);

    main.add(left, new ColumnData(.5));
    main.add(right, new ColumnData(.5));

    HBoxLayoutData dataSelectedTypes = new HBoxLayoutData(new Margins(5, 0, 0, 0));
    searchContainer.add(selectedEvenyTypes, dataSelectedTypes);
    HBoxLayoutData dataTypes = new HBoxLayoutData(new Margins(5, 0, 5, 135));
    searchContainer.add(evenyTypes, dataTypes);

    searchContainer.add(main);
    HBoxLayoutData dataButtons = new HBoxLayoutData(new Margins(0, 0, 5, 0));
    searchContainer.add(setupButtonPanel(3), dataButtons);

    cp.add(searchContainer);
    cp.add(grid);
    cp.setBottomComponent(pagingToolBar);

    container.add(cp);

    LayoutContainer wrapper = (LayoutContainer) Registry.get(Constants.CENTER_PANEL);
    wrapper.removeAll();
    wrapper.add(container);
    wrapper.layout();
    GWT.log("Done Initializing the UI in " + (new java.util.Date().getTime() - time), null);
  }
Exemple #8
0
  /**
   * 客户资料
   *
   * @return
   */
  private LayoutContainer CreateCCodeDetailPanel() {
    LayoutContainer main = new LayoutContainer();
    TableLayout tl = new TableLayout(2);

    main.setLayout(new TableLayout(2));
    BaseFormPanel leftpanel = new BaseFormPanel(store);
    leftpanel.setLayout(new FormLayout());
    FormData fd = new FormData(200, 30);
    leftpanel.setHeaderVisible(false);
    leftpanel.setBodyBorder(false);

    BaseFormPanel rightpanel = new BaseFormPanel(store);
    rightpanel.setBodyBorder(false);
    rightpanel.setHeaderVisible(false);

    TextField<String> ccode = new TextField<String>();
    ccode.setName("ccode");
    ccode.setAllowBlank(false);
    ccode.setFieldLabel("编码");

    TextField<String> name = new TextField<String>();
    name.setName("cname");
    name.setAllowBlank(false);
    name.setFieldLabel("名称");

    TextField<String> shortcode = new TextField<String>();
    shortcode.setName("shortcode");
    shortcode.setFieldLabel("简码");
    TextField<String> ccodesource = new TextField<String>();
    ccodesource.setName("ccodesource");
    ccodesource.setFieldLabel("客户来源");

    TextField<String> ncode = new TextField<String>();
    ncode.setName("ncode");
    ncode.setFieldLabel("国别");

    TextField<String> httpurl = new TextField<String>();
    httpurl.setName("httpurl");
    httpurl.setFieldLabel("网址");

    DateField setupdate = new DateField();
    setupdate.setName("setupdate");
    setupdate.setFieldLabel("成立时间");
    TextField<String> registercapital = new TextField<String>();
    registercapital.setName("registercapital");
    registercapital.setFieldLabel("注册资金");

    TextField<String> employeenum = new TextField<String>();
    employeenum.setName("employeenum");
    employeenum.setFieldLabel("雇用人数");

    TextField<String> branchorgnum = new TextField<String>();
    branchorgnum.setName("branchorgnum");
    branchorgnum.setFieldLabel("分支机构数");

    TextField<String> artperson = new TextField<String>();
    artperson.setName("artperson");
    artperson.setFieldLabel("法人代表");

    TextField<String> taxno = new TextField<String>();
    taxno.setName("taxno");
    taxno.setFieldLabel("税务登记号");

    TextField<String> partner = new TextField<String>();
    partner.setName("partner");
    partner.setFieldLabel("合伙人");

    /*
     * TextField<String> artno = new TextField<String>();
     * artno.setName("artno"); artno.setFieldLabel("企业代码");
     */

    TextField<String> comholsdatedesc = new TextField<String>();
    comholsdatedesc.setName("comholsdatedesc");
    comholsdatedesc.setFieldLabel("公司特殊假日");

    BaseGrid gudong = CreateCCodeGudongPanel();
    gudong.setAutoHeight(true);
    gudong.setAutoWidth(true);
    leftpanel.add(ccode, fd);
    rightpanel.add(name, fd);
    leftpanel.add(shortcode, fd);
    rightpanel.add(ccodesource, fd);
    leftpanel.add(httpurl, fd);
    rightpanel.add(setupdate, fd);
    leftpanel.add(registercapital, fd);
    rightpanel.add(employeenum, fd);
    leftpanel.add(branchorgnum, fd);
    rightpanel.add(artperson, fd);
    leftpanel.add(taxno, fd);
    rightpanel.add(partner, fd);
    leftpanel.add(comholsdatedesc, fd);

    TableData td = new TableData();
    td.setColspan(1);
    td.setRowspan(1);
    // 对齐方式
    td.setHorizontalAlign(HorizontalAlignment.LEFT);
    td.setVerticalAlign(VerticalAlignment.TOP);
    // rightpanel.add(gudong,td2);
    leftpanel.inited();
    rightpanel.inited();
    FieldSet fieldSet = new FieldSet();
    fieldSet.setHeading("股东占股比例");
    fieldSet.add(gudong);
    main.add(leftpanel, td);
    main.add(rightpanel, td);
    main.add(fieldSet, td);
    return main;
  }
    CreateFormIntervalliOre() {

      setLabelWidth(30);
      setFrame(true);
      setButtonAlign(HorizontalAlignment.CENTER);
      setHeading("Dettaglio Ore.");
      setHeaderVisible(false);
      setWidth(700);
      setHeight(95);
      setStyleAttribute("padding-left", "10px");
      setStyleAttribute("padding-top", "10px");
      setBorders(false);

      Date retVal = null;
      try {
        retVal = DateTimeFormat.getFormat("dd-MM-yyyy").parse(01 + "-" + 03 + "-" + 2013);
      } catch (Exception e) {
        retVal = null;
      }

      giornoRiferimento.setValue(new Date());
      giornoRiferimento.setMinValue(retVal);
      giornoRiferimento.setItemId("data");
      dtfldGiorno.setValue(giornoRiferimento.getValue());

      ListStore<PersonaleModel> store = new ListStore<PersonaleModel>();
      cmbxDipendente.setStore(store);
      cmbxDipendente.setFieldLabel("Dipendente");
      cmbxDipendente.setEnabled(true);
      cmbxDipendente.setEmptyText("Selezionare il dipendente..");
      cmbxDipendente.setEditable(false);
      cmbxDipendente.setVisible(true);
      cmbxDipendente.setTriggerAction(TriggerAction.ALL);
      cmbxDipendente.setAllowBlank(false);
      cmbxDipendente.setDisplayField("nomeCompleto");
      cmbxDipendente.addListener(
          Events.OnClick,
          new Listener<BaseEvent>() {
            @Override
            public void handleEvent(BaseEvent be) {
              getAllDipendenti();
            }
          });

      ButtonBar buttonBarTop = new ButtonBar();
      buttonBarTop.setAlignment(HorizontalAlignment.CENTER);
      buttonBarTop.setStyleAttribute("padding-bottom", "5px");
      buttonBarTop.setBorders(false);
      buttonBarTop.setWidth(570);
      buttonBarTop.setItemId("buttonBar");

      // buttonBarTop.add(btnPrev);
      buttonBarTop.add(giornoRiferimento);
      buttonBarTop.add(cmbxDipendente);
      buttonBarTop.add(btnSend);
      // buttonBarTop.add(btnNext);

      btnInviaCommenti.setIcon(AbstractImagePrototype.create(MyImages.INSTANCE.escl1()));
      btnInviaCommenti.setToolTip("Segnala eventuali problemi o anomalie.");
      btnInviaCommenti.setSize(26, 26);
      btnInviaCommenti.setIconAlign(IconAlign.TOP);
      btnInviaCommenti.addSelectionListener(
          new SelectionListener<ButtonEvent>() {
            @Override
            public void componentSelected(ButtonEvent ce) {
              Dialog d = new DialogInvioCommenti(txtfldUsername.getValue().toString(), new Date());
              d.show();
            }
          });

      btnRiepilogoCommesse.setEnabled(true);
      btnRiepilogoCommesse.setSize(26, 26);
      btnRiepilogoCommesse.setIcon(AbstractImagePrototype.create(MyImages.INSTANCE.riep_comm()));
      btnRiepilogoCommesse.setToolTip("Riepilogo Commesse");
      btnRiepilogoCommesse.addSelectionListener(
          new SelectionListener<ButtonEvent>() {

            @Override
            public void componentSelected(ButtonEvent ce) {
              /*Dialog d= new Dialog();
              d.setHeaderVisible(true);
              d.setHeading("Riepilogo dettagliato (Commesse).");
              d.setSize(550, 605);
              d.add(new PanelRiepilogoGiornalieroCommesse(txtfldUsername.getValue().toString(), giornoRiferimento.getValue()));
              d.setButtons("");
              d.show();*/
              Date data = dtfldGiorno.getValue();
              Dialog d = new Dialog();
              d.setHeaderVisible(true);
              d.setConstrain(false);
              d.setHeading("Riepilogo dettagliato (Commesse).");
              d.setSize(1500, 650);
              d.add(
                  new PanelRiepilogoMeseGiornalieroCommesseHorizontal(
                      0,
                      txtfldUsername.getValue().toString(),
                      data,
                      "0.00",
                      "0.00",
                      "0.00",
                      "0.00"));
              d.setButtons("");
              d.show();
            }
          });

      frm.setHeaderVisible(false);
      frm.setBorders(false);
      frm.setItemId("formPanel");
      frm.setWidth(1060);
      frm.setHeight(890);
      frm.setStyleAttribute("padding-left", "0px");
      frm.setStyleAttribute("padding-top", "0px");
      frm.setScrollMode(Scroll.AUTO);

      main.setLayout(new ColumnLayout());
      main.setBorders(false);
      main.setStyleAttribute("margin-top", "-10px");
      main.setItemId("main");

      left.setStyleAttribute("padding-left", "10px");
      FormLayout layout = new FormLayout();
      left.setLayout(layout);
      left.setItemId("left");

      right.setStyleAttribute("padding-left", "30px");
      layout = new FormLayout();
      right.setLayout(layout);
      right.setItemId("right");

      ButtonBar btnBarOperazioni = new ButtonBar();
      btnBarOperazioni.setHeight(28);
      btnBarOperazioni.setAlignment(HorizontalAlignment.LEFT);
      btnBarOperazioni.setBorders(false);
      btnBarOperazioni.add(btnRiepilogoCommesse);
      btnBarOperazioni.add(btnInviaCommenti);
      btnBarOperazioni.add(btnConferma);

      left.add(btnBarOperazioni);
      left.add(buttonBarTop);

      main.add(left);
      frm.add(main);
      frm.layout(true);
      add(frm);

      btnSend.setSize(26, 26);
      btnSend.setIcon(AbstractImagePrototype.create(MyImages.INSTANCE.reload()));
      btnSend.setToolTip("Carica Dati");
      btnSend.addSelectionListener(
          new SelectionListener<ButtonEvent>() {
            @Override
            public void componentSelected(ButtonEvent ce) {
              txtfldUsername.setValue(
                  cmbxDipendente
                      .getValue()
                      .get("username")
                      .toString()); // setto il valore globale dell'username per il caricamento dei
                                    // vari fieldset
              dtfldGiorno.setValue(
                  giornoRiferimento
                      .getValue()); // setto il valore globale della data con la data selezionata
              reloadFoglioOre();
            }
          });

      // btnConferma.setSize(46, 46);
      btnConferma.setIcon(AbstractImagePrototype.create(MyImages.INSTANCE.saveLittle()));
      btnConferma.setIconAlign(IconAlign.TOP);
      btnConferma.setToolTip("Conferma");
      btnConferma.setSize(26, 26);
      btnConferma.addSelectionListener(
          new SelectionListener<ButtonEvent>() {

            @Override
            public void componentSelected(ButtonEvent ce) {

              if (frm.isValid()) {
                String username = new String();
                Date giorno = new Date();
                DateField dtfld = new DateField();

                username = cmbxDipendente.getValue().get("username");
                List<IntervalliCommesseModel> intervalliC =
                    new ArrayList<IntervalliCommesseModel>();

                FldsetIntervalliCommesse fldSetIntervalliC;
                LayoutContainer lc = new LayoutContainer();
                LayoutContainer lcR = new LayoutContainer();
                ButtonBar bttnBar = new ButtonBar();

                lc = (LayoutContainer) frm.getItemByItemId("main");
                // Intervalli IU
                lc = (LayoutContainer) lc.getItemByItemId("left");

                // Data
                bttnBar = (ButtonBar) lc.getItemByItemId("buttonBar");
                dtfld = (DateField) bttnBar.getItemByItemId("data");
                giorno = dtfld.getValue();

                // Intervalli Comm
                fldSetIntervalliC =
                    (FldsetIntervalliCommesse) lc.getItemByItemId("fldSetIntervalliC");
                if (fldSetIntervalliC.getItemCount() > 1)
                  intervalliC = elaboraIntervalliC(fldSetIntervalliC);

                // Giustificativi
                lcR = (LayoutContainer) frm.getItemByItemId("main");
                lcR = (LayoutContainer) lcR.getItemByItemId("right");

                // txtfldOreTotali=fldSetGiustificativi.txtfldOreTotEffettive;

                AdministrationService.Util.getInstance()
                    .insertFoglioOreGiorno(
                        username,
                        giorno,
                        intervalliC,
                        new AsyncCallback<Boolean>() {

                          @Override
                          public void onFailure(Throwable caught) {
                            Window.alert("Errore di connessione on insertFoglioOreGiorno()!");
                          }

                          @Override
                          public void onSuccess(Boolean result) {
                            if (result) {
                              Window.alert("Caricamento avvenuto con successo.");
                              reloadFoglioOre();
                            } else {
                              Window.alert("error: Impossibile salvare i dati!");
                            }
                          }
                        });
              }
            }
          });
    }
Exemple #10
0
  LayoutContainer initProButtons() {

    TableLayout tl = new TableLayout(2);
    lc.setLayout(tl);

    TableData td1 = new TableData();
    td1.setColspan(1);
    TableData td2 = new TableData();
    td2.setColspan(2);

    bsd_add =
        new BcodeSelectDialog<TreeNodeModelData>() {
          public void doposted(List<TreeNodeModelData> modeldatalist) {
            if (modeldatalist.size() > 0) {
              this.setEmptyText("已经选择了数据");

              List<TreeNodeModelData> selectchecklist = bsd_add.getTree().getCheckedSelection();

              if (selectchecklist.size() <= 0) {
                MessageBox.alert("错误", "请选择“离职人员”", null);
                return;
              }
              String bcodestr = "";
              for (TreeNodeModelData tnmd : selectchecklist) {
                BusiObject bo = new BusiObject();

                bcodestr += " systembcode like '" + tnmd.get("systembcode") + "%25' or ";
              }
              bcodestr += " 1=2";
              GWT.log("bcodestr =" + bcodestr);

              String sql =
                  "select icode, bcode,employstatus,leavereason,leavemark,Resignationdate from bcode_job where exists (select * from systembcode_view where systembcode_view.bcode = bcode_job.bcode  and ( "
                      + bcodestr
                      + "))";
              GWT.log("sql =" + sql);
              store.getStoreinfo().setSql(sql);
              store.reload();
            }
          }
        };
    bsd_add.setNeesreselect(false);
    bsd_add.setEmptyText("未选择数据");
    bsd_add.setExpanded();
    bsd_add.setCheckNodes(CheckNodes.BOTH);

    Resignationdate = new DateField();
    Resignationdate.getPropertyEditor().setFormat(DateTimeFormat.getFormat("yyyy-MM-dd"));

    save.addListener(Events.OnClick, getListener());
    lc.add(new LabelField("选择人员:"), td1);
    lc.add(bsd_add, td1);

    lc.add(new LabelField("状态改变为:"), td1);
    lc.add(C_num8, td1);

    lc.add(leavereason_l, td1);
    lc.add(C_num9, td1);

    lc.add(resignationdate_l, td1);
    lc.add(Resignationdate, td1);

    lc.add(mark_l, td1);
    lc.add(mark_t, td1);

    leavereason_l.setVisible(false);
    C_num9.setVisible(false);
    mark_l.setVisible(false);
    mark_t.setVisible(false);
    resignationdate_l.setVisible(false);
    Resignationdate.setVisible(false);

    lc.add(save, td2);

    bsd_add.addListener(Events.Changed, getListener());
    C_num8.addListener(Events.Changed, getListener());
    C_num9.addListener(Events.Changed, getListener());
    mark_t.addListener(Events.Changed, getListener());
    Resignationdate.addListener(Events.Changed, getListener());
    return lc;
  }
Exemple #11
0
  @Override
  protected void onRender(Element parent, int index) {
    super.onRender(parent, index);

    final Stock stock = TestData.getStocks().get(0);

    HorizontalPanel hp = new HorizontalPanel();
    hp.setSpacing(10);

    StringBuffer sb = new StringBuffer();
    sb.append("<div class=text style='line-height: 1.5em'>");
    sb.append("<b>Name:</b> {name}<br>");
    sb.append("<b>Symbol:</b> {symbol}<br>");
    sb.append("<b>Last:</b> {last}<br>");
    sb.append("<b>Change:</b> {[new Number(values.change).toFixed(2)]}<br>");
    sb.append("<b>Updated:</b> {date:date(\"MM/dd/y\")}<br>");
    sb.append("</div>");

    final XTemplate template = XTemplate.create(sb.toString());
    final HTML html = new HTML();
    html.setWidth("160px");
    template.overwrite(html.getElement(), Util.getJsObject(stock));
    hp.add(html);
    // update template when model changes
    stock.addChangeListener(
        new ChangeListener() {
          public void modelChanged(ChangeEvent event) {
            template.overwrite(html.getElement(), Util.getJsObject(stock));
          }
        });

    FormPanel panel = new FormPanel();
    panel.setHeaderVisible(false);
    panel.setWidth(350);

    TextField<String> name = new TextField<String>();
    name.setName("nameField");
    name.setFieldLabel("Name");
    panel.add(name);

    TextField<String> symbol = new TextField<String>();
    symbol.setName("symbol");
    symbol.setFieldLabel("Symbol");
    panel.add(symbol);

    NumberField open = new NumberField();
    open.setName("last");
    open.setFieldLabel("Last");
    panel.add(open);

    NumberField change = new NumberField();
    change.setName("change");
    change.setFieldLabel("Change");
    change.setFormat(NumberFormat.getDecimalFormat());
    panel.add(change);

    DateField last = new DateField();
    last.setName("date");
    last.setFieldLabel("Updated");
    panel.add(last);

    SimpleComboBox<String> scb = new SimpleComboBox<String>();
    for (Stock s : TestData.getStocks()) {
      scb.add(s.getName());
    }
    scb.setFieldLabel("Name");
    scb.setForceSelection(true);
    scb.setTypeAhead(true);
    scb.setName("company");
    scb.setTriggerAction(TriggerAction.ALL);
    panel.add(scb);

    hp.add(panel);

    FormBinding binding = new FormBinding(panel);
    // manually add bindings
    binding.addFieldBinding(new FieldBinding(name, "name"));
    binding.addFieldBinding(new FieldBinding(symbol, "symbol"));
    binding.addFieldBinding(new SimpleComboBoxFieldBinding(scb, "name"));

    // auto bind remaining fields, field name must match model property name
    binding.autoBind();
    binding.bind(stock);

    add(hp);
  }
Exemple #12
0
  /** * 主窗口 */
  void initmainpanel() {

    w = new BaseFormPanel(getStore());
    w.setHeaderVisible(false);
    Label cardno_l = new Label("卡号:");
    cardno_l.setWidth("50");
    Label cname_l = new Label("名字:");
    cname_l.setWidth("50");
    Label sex_l = new Label("性别:");
    sex_l.setWidth("50");
    Label edu_l = new Label("学历:");
    Label bird_l = new Label("出生日期:");

    Label mobil_l = new Label("手机号:");
    Label idno_l = new Label("身份证号:");
    Label mark_l = new Label("备注:");

    cardno_t = new TextField<String>();
    cardno_t.setAllowBlank(false);
    cardno_t.addListener(Events.Change, this);
    cname_t = new TextField<String>();
    cname_t.setAllowBlank(false);

    //		passwordc_t.setAllowBlank(false);
    //		password_t.setAllowBlank(false);
    //
    // TextField<String> sex_t = new TextField<String>();
    // BaseGridEditor sex_t= CodeNameMapFactory.aa();
    BaseComboBoxForm<BaseModelData> sex_t = CodeNameMapFactory.createSexInput_F();
    TextField<String> edu_t = new TextField<String>();
    // CodeNameMapFactory codenamemap = new CodeNameMapFactory();

    // BaseGridEditor<String> edu_t =codenamemap.createSexInput_G();

    // createBocdeInput_F
    DateField bird_t = new DateField();
    bird_t.setAutoWidth(true);

    bird_t.getPropertyEditor().setFormat(DateTimeFormat.getFormat("yyyy-M-d H:mm:ss"));
    TextField<String> mobil_t = new TextField<String>();
    mobil_t.setAllowBlank(false);
    TextField<String> idno_t = new TextField<String>();

    TextArea mark_t = new TextArea();
    mark_t.setSize(420, 40);
    // TextField<String> password_t = new TextField<String>();

    password_t.setPassword(true);
    passwordc_t.setPassword(true);
    // password_t.setToolTip("将光标放到此处,并由会员录入自己的密码");
    ccode_t = new TextField<String>();
    // ccode_t.setEnabled(false);
    ccode_t.setVisible(false);
    icode_t = new TextField<String>();
    icode_t.setVisible(false);

    cardno_t.setName("s_cardno");
    cname_t.setName("cname");
    password_t.setName("password");

    sex_t.setName("s_sex");
    edu_t.setName("s_edu");
    bird_t.setName("s_birid");
    mobil_t.setName("s_mobil");
    idno_t.setName("s_idno");
    mark_t.setName("s_mark");
    ccode_t.setName("ccode");
    icode_t.setName("icode");
    // password_t.setName("password");

    TableLayout tl = new TableLayout(4);
    tl.setWidth("600");
    w.setLayout(tl);
    TableData td = new TableData();
    td.setColspan(1);
    // td.setWidth("2000");
    td.setMargin(100);
    td.setPadding(5);
    td.setRowspan(1);

    TableData td2 = new TableData();
    td2.setColspan(3);
    // td.setWidth("2000");
    td2.setMargin(100);
    td2.setPadding(5);
    td2.setRowspan(1);

    w.add(cardno_l, td);
    w.add(cardno_t, td);
    w.add(cname_l, td);
    w.add(cname_t, td);

    w.add(mobil_l, td);
    w.add(mobil_t, td);
    w.add(sex_l, td);
    w.add(sex_t, td);

    w.add(new Label("密码:"), td);
    w.add(password_t, td);
    w.add(new Label("重新录入密码:"), td);
    w.add(passwordc_t, td);

    w.add(edu_l, td);
    w.add(edu_t, td);
    w.add(bird_l, td);
    w.add(bird_t, td);

    w.add(idno_l, td);
    w.add(idno_t, td);
    w.add(new Label(""), td);
    w.add(new Label(""), td);
    w.add(mark_l, td);
    w.add(mark_t, td2);

    w.add(new Label("销售人员:"), td);
    BaseComboBoxForm<BaseModelData> cbf = createBcode_filter();
    cbf.setName("rbcode");
    cbf.setAllowBlank(false);
    w.add(cbf, td2);

    w.add(ccode_t, td);
    w.add(icode_t, td);
    w.setBottomComponent(addfinace);

    addfinace.addListener(Events.Select, this);
    addfinace.setEnabled(false);
    w.inited();

    // w.setAutoHeight(true);
    // w.setAutoWidth(true);
    // w.setSize(661, 300);

    cardno_t.addListener(Events.Change, this);
    cname_t.addListener(Events.Change, this);

    // mobil_t.addListener(Events.Change, this);

    cardno_t.setValidateOnBlur(true);
    cname_t.setValidateOnBlur(true);
  }
 public void setDate(Date date) {
   dateField.setValue(date);
 }
  public Date getDate() {
    Date date = dateField.getValue();

    return date;
  }
  public PanelGridContrato() {

    setCollapsible(true);
    setResizable(false);
    setMinimizable(true);
    setHeadingHtml("Contratos");
    setSize(700, 459);
    setLayout(new FitLayout());

    mainPanel = new ContentPanel();
    mainPanel.setFrame(true);
    mainPanel.setHeaderVisible(false);
    mainPanel.setLayout(new RowLayout(Orientation.VERTICAL));

    panelTool = new ContentPanel();
    panelTool.setHeaderVisible(false);
    panelTool.setFrame(true);
    panelTool.setCollapsible(true);
    panelTool.setLayout(new AbsoluteLayout());

    btnRelatrio = new Button("Relatório");
    btnRelatrio.setSize("44px", "44px");
    btnRelatrio.setIconAlign(IconAlign.TOP);
    btnRelatrio.setIcon(AbstractImagePrototype.create(ImagensResources.INSTANCE.report24()));
    //		btnRelatrio.setEnabled(false);
    btnRelatrio.addSelectionListener(
        new SelectionListener<ButtonEvent>() {
          @Override
          public void componentSelected(ButtonEvent ce) {
            ParametrosReport parametros = new ParametrosReport();
            parametros.setNomeRelatorio(JasperName.CONTRATO);
            parametros.setContratoId(getSelecaoGrid().getId());

            InstanceService.RELATORIO_SERVICE.relatorio(parametros, new RelatorioCallback());
          }
        });

    panelTool.add(btnRelatrio, new AbsoluteData(606, 6));

    btnEditar = new Button("Editar");
    btnEditar.setSize("44px", "44px");
    btnEditar.setIconAlign(IconAlign.TOP);
    btnEditar.setIcon(AbstractImagePrototype.create(ImagensResources.INSTANCE.iconEditar24()));
    btnEditar.addSelectionListener(
        new SelectionListener<ButtonEvent>() {

          @Override
          public void componentSelected(ButtonEvent ce) {

            DTOContrato contrato = getSelecaoGrid();

            if (contrato != null) {
              FormContrato formContrato = ProviderFacadeManager.formContrato.createInstance();
              formContrato.setModal(true);
              formContrato.loadDTOContrato(contrato);
              formContrato.show();
            } else {
              WebMessageBox.alert("Selecione o contrato para editar!");
            }
          }
        });
    panelTool.add(btnEditar, new AbsoluteData(556, 6));

    btnNovo = new Button("Novo");
    btnNovo.setSize("44px", "44px");
    btnNovo.setIconAlign(IconAlign.TOP);
    btnNovo.setIcon(AbstractImagePrototype.create(ImagensResources.INSTANCE.iconAdicionar24()));
    btnNovo.addSelectionListener(
        new SelectionListener<ButtonEvent>() {

          @Override
          public void componentSelected(ButtonEvent ce) {
            FormContrato formContrato = ProviderFacadeManager.formContrato.createInstance();
            formContrato.setModal(true);
            formContrato.show();
          }
        });
    panelTool.add(btnNovo, new AbsoluteData(506, 6));

    panelTool.add(new LabelField("Cliente:"), new AbsoluteData(6, 6));

    RpcProxy<PagingLoadResult<DTOCliente>> proxyCliente =
        new RpcProxy<PagingLoadResult<DTOCliente>>() {
          @Override
          public void load(
              Object loadConfig, AsyncCallback<PagingLoadResult<DTOCliente>> callback) {
            InstanceService.CLIENTE_SERVICE.loadPagingList((PagingLoadConfig) loadConfig, callback);
          }
        };

    PagingLoader<PagingLoadResult<ModelData>> loaderCliente =
        new BasePagingLoader<PagingLoadResult<ModelData>>(proxyCliente);

    storeCliente = new ListStore<DTOCliente>(loaderCliente);

    comboCliente = new ComboBox<DTOCliente>();
    comboCliente.setStore(storeCliente);
    comboCliente.setSize("286px", "22px");
    comboCliente.setTemplate(getTemplateNome());
    comboCliente.setValueField("id");
    comboCliente.setDisplayField("nome");
    comboCliente.setItemSelector("div.search-item");
    comboCliente.setHideTrigger(true);
    comboCliente.setLoadingText("Carregando...");
    comboCliente.setPageSize(10);
    comboCliente.addListener(
        Events.OnBlur,
        new Listener<ComponentEvent>() {
          public void handleEvent(ComponentEvent evt) {
            if (comboCliente.getValue() == null) {
              comboCliente.clear();
            }
          };
        });

    panelTool.add(comboCliente, new AbsoluteData(6, 28));

    tfData = new DateField();
    tfData.setSize("119px", "22px");
    tfData.setEditable(false);
    tfData.setValue(new Date());
    tfData
        .getDatePicker()
        .addListener(
            Events.Select,
            new Listener<DatePickerEvent>() {
              @Override
              public void handleEvent(DatePickerEvent be) {
                loadContratos();
              }
            });
    tfData.getPropertyEditor().setFormat(DateTimeFormat.getFormat("dd/MM/yyyy"));
    panelTool.add(tfData, new AbsoluteData(298, 28));

    btnPesquisa = new Button();
    btnPesquisa.setSize("44px", "44px");
    btnPesquisa.setIcon(AbstractImagePrototype.create(ImagensResources.INSTANCE.iconPesquisa24()));
    btnPesquisa.addSelectionListener(
        new SelectionListener<ButtonEvent>() {
          @Override
          public void componentSelected(ButtonEvent ce) {
            pesquisa();
          }
        });
    panelTool.add(btnPesquisa, new AbsoluteData(423, 6));

    panelTool.add(new LabelField("Data:"), new AbsoluteData(300, 6));
    mainPanel.add(panelTool, new RowData(Style.DEFAULT, 75.0, new Margins(3)));

    storeContratos = new ListStore<DTOContrato>();

    gridContratos = new Grid<DTOContrato>(storeContratos, getColumnModel());
    gridContratos.setBorders(true);
    gridContratos.setAutoExpandColumn("nomeCliente");

    mainPanel.add(gridContratos, new RowData(Style.DEFAULT, 340.0, new Margins(3)));

    add(mainPanel);

    loadContratos();
  }