Package com.commander4j.db

Examples of com.commander4j.db.JDBShifts


            Date dateNow = new Date();
            Calendar calendarNow = GregorianCalendar.getInstance();

            calendarNow.setTime(dateNow);

            JDBShifts selectedShift = (JDBShifts) jListShifts.getSelectedValue();

            Calendar startCal = GregorianCalendar.getInstance();
            startCal.setTime(dateNow);
            startCal.set(Calendar.HOUR_OF_DAY, selectedShift.getStartTimeHours());
            startCal.set(Calendar.MINUTE, selectedShift.getStartTimeMins());
            startCal.set(Calendar.SECOND, selectedShift.getStartTimeSecs());

            Calendar endCal = GregorianCalendar.getInstance();
            endCal.setTime(dateNow);
            endCal.set(Calendar.HOUR_OF_DAY, selectedShift.getEndTimeHours());
            endCal.set(Calendar.MINUTE, selectedShift.getEndTimeMins());
            endCal.set(Calendar.SECOND, selectedShift.getEndTimeSecs());

            if (startCal.compareTo(endCal) > 0)
            {
              endCal.add(Calendar.DATE, 1);
            }
View Full Code Here


  {
    if (jListShifts.isSelectionEmpty() == false)
    {
      if (Common.userList.getUser(Common.sessionID).isModuleAllowed("FRM_ADMIN_SHIFT_EDIT"))
      {
        JDBShifts shiftid = (JDBShifts) (jListShifts.getSelectedValue());
        JLaunchMenu.runDialog("FRM_ADMIN_SHIFT", shiftid.getShiftID());
        populateListUserShifts(shiftid.getShiftID());
      }
    }
  }
View Full Code Here

  {
    if (jListShifts.isSelectionEmpty() == false)
    {
      if (Common.userList.getUser(Common.sessionID).isModuleAllowed("FRM_ADMIN_SHIFT_DELETE"))
      {
        JDBShifts shiftid = (JDBShifts) (jListShifts.getSelectedValue());

        int n = JOptionPane.showConfirmDialog(Common.mainForm, "Delete Shift " + shiftid.getShiftID() + " - [" +shiftid.getDescription()+ "]" + " ?", "Confirm", JOptionPane.YES_NO_OPTION);
        if (n == 0)
        {

          shiftid.delete();
          populateListUserShifts("");
        }
      }
    }
  }
View Full Code Here

  }

  private void addShift()
  {

    JDBShifts shift = new JDBShifts(Common.selectedHostID, Common.sessionID);

    String shiftId = JOptionPane.showInputDialog(Common.mainForm, "Enter new Shift ID");
    if (shiftId != null)
    {
      if (shiftId.equals("") == false)
      {
        shiftId = shiftId.toUpperCase();
        shift.setShiftID(shiftId);
        if (shift.isValid(shiftId))
        {
          JUtility.errorBeep();
          JOptionPane.showMessageDialog(Common.mainForm, shift.getErrorMessage(), "Error", JOptionPane.ERROR_MESSAGE);
        } else
        {

          JLaunchMenu.runDialog("FRM_ADMIN_SHIFT", shiftId);
        }
View Full Code Here

  private void populateListUserShifts(String defaultitem)
  {
    DefaultComboBoxModel defComboBoxMod = new DefaultComboBoxModel();

    JDBShifts tempShifts = new JDBShifts(Common.selectedHostID, Common.sessionID);

    LinkedList<JDBShifts> tempShiftList = new LinkedList<JDBShifts>();

    tempShiftList = tempShifts.getShifts();

    int sel = -1;
    for (int j = 0; j < tempShiftList.size(); j++)
    {
      defComboBoxMod.addElement(tempShiftList.get(j));
View Full Code Here

            Date dateNow = new Date();
            Calendar calendarNow = GregorianCalendar.getInstance();

            calendarNow.setTime(dateNow);

            JDBShifts selectedShift = (JDBShifts) jListShifts.getSelectedValue();

            Calendar startCal = GregorianCalendar.getInstance();
            startCal.setTime(dateNow);
            startCal.set(Calendar.HOUR_OF_DAY, selectedShift.getStartTimeHours());
            startCal.set(Calendar.MINUTE, selectedShift.getStartTimeMins());
            startCal.set(Calendar.SECOND, selectedShift.getStartTimeSecs());

            Calendar endCal = GregorianCalendar.getInstance();
            endCal.setTime(dateNow);
            endCal.set(Calendar.HOUR_OF_DAY, selectedShift.getEndTimeHours());
            endCal.set(Calendar.MINUTE, selectedShift.getEndTimeMins());
            endCal.set(Calendar.SECOND, selectedShift.getEndTimeSecs());

            if (startCal.compareTo(endCal) > 0)
            {
              endCal.add(Calendar.DATE, 1);
            }
View Full Code Here

  {
    if (jListShifts.isSelectionEmpty() == false)
    {
      if (Common.userList.getUser(Common.sessionID).isModuleAllowed("FRM_ADMIN_SHIFT_EDIT"))
      {
        JDBShifts shiftid = (JDBShifts) (jListShifts.getSelectedValue());
        JLaunchMenu.runDialog("FRM_ADMIN_SHIFT", shiftid.getShiftID());
        populateListUserShifts(shiftid.getShiftID());
      }
    }
  }
View Full Code Here

  {
    if (jListShifts.isSelectionEmpty() == false)
    {
      if (Common.userList.getUser(Common.sessionID).isModuleAllowed("FRM_ADMIN_SHIFT_DELETE"))
      {
        JDBShifts shiftid = (JDBShifts) (jListShifts.getSelectedValue());

        int n = JOptionPane.showConfirmDialog(Common.mainForm, lang.get("dlg_Shift_Delete") + " " + shiftid.getShiftID() + " - [" +shiftid.getDescription()+ "]" + " ?", lang.get("dlg_Confirm"), JOptionPane.YES_NO_OPTION, 0, Common.icon_confirm);
        if (n == 0)
        {

          shiftid.delete();
          populateListUserShifts("");
        }
      }
    }
  }
View Full Code Here

  }

  private void addShift()
  {

    JDBShifts shift = new JDBShifts(Common.selectedHostID, Common.sessionID);

    String shiftId = JOptionPane.showInputDialog(Common.mainForm, lang.get("dlg_Shift_Create"));
    if (shiftId != null)
    {
      if (shiftId.equals("") == false)
      {
        shiftId = shiftId.toUpperCase();
        shift.setShiftID(shiftId);
        if (shift.isValid(shiftId))
        {
          JUtility.errorBeep();
          JOptionPane.showMessageDialog(Common.mainForm, shift.getErrorMessage(), lang.get("err_Error"), JOptionPane.ERROR_MESSAGE,Common.icon_confirm);
        } else
        {

          JLaunchMenu.runDialog("FRM_ADMIN_SHIFT", shiftId);
        }
View Full Code Here

  private void populateListUserShifts(String defaultitem)
  {
    DefaultComboBoxModel<JDBShifts> defComboBoxMod = new DefaultComboBoxModel<JDBShifts>();

    JDBShifts tempShifts = new JDBShifts(Common.selectedHostID, Common.sessionID);

    LinkedList<JDBShifts> tempShiftList = new LinkedList<JDBShifts>();

    tempShiftList = tempShifts.getShifts();

    int sel = -1;
    for (int j = 0; j < tempShiftList.size(); j++)
    {
      defComboBoxMod.addElement(tempShiftList.get(j));
View Full Code Here

TOP

Related Classes of com.commander4j.db.JDBShifts

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.