Exemple #1
0
void address::sView()
{
    switch (_uses->altId())
    {
    case 1:
        sViewContact();
        break;

    case 2:
        sViewShipto();
        break;

    case 3:
        sViewVendor();
        break;

    case 4:
        sViewVendorAddress();
        break;

    case 5:
        sViewWarehouse();
        break;

    default:
        break;
    }
}
Exemple #2
0
void address::sPopulateMenu(QMenu *pMenu)
{
    int menuItem;
    QString editStr = tr("Edit...");
    QString viewStr = tr("View...");

    switch (_uses->altId())
    {
    case 1:
        if (_privileges->check("MaintainContacts") &&
                (cNew == _mode || cEdit == _mode))
            menuItem = pMenu->insertItem(editStr, this, SLOT(sEditContact()));
        else if (_privileges->check("ViewContacts"))
            menuItem = pMenu->insertItem(viewStr, this, SLOT(sViewContact()));

        break;

    case 2:	// ship-to
        if (_privileges->check("MaintainShiptos") &&
                (cNew == _mode || cEdit == _mode))
            menuItem = pMenu->insertItem(editStr, this, SLOT(sEditShipto()));
        else if (_privileges->check("ViewShiptos"))
            menuItem = pMenu->insertItem(viewStr, this, SLOT(sViewShipto()));

        break;

    case 3:	// vendor
        /* comment out until we make vendor a XDialog or address a XMainWindow
        if (_privileges->check("MaintainVendors") &&
        (cNew == _mode || cEdit == _mode))
        menuItem = pMenu->insertItem(editStr, this, SLOT(sEditVendor()));
             else if (_privileges->check("ViewVendors"))
        menuItem = pMenu->insertItem(viewStr, this, SLOT(sViewVendor()));
             */

        break;

    case 4:	// vendaddr
        if (_privileges->check("MaintainVendorAddresses") &&
                (cNew == _mode || cEdit == _mode))
            menuItem = pMenu->insertItem(editStr, this, SLOT(sEditVendorAddress()));
        else if (_privileges->check("ViewVendorAddresses"))
            menuItem = pMenu->insertItem(viewStr, this, SLOT(sViewVendorAddress()));

        break;

    case 5:	// warehouse
        if (_privileges->check("MaintainWarehouses") &&
                (cNew == _mode || cEdit == _mode))
            menuItem = pMenu->insertItem(editStr, this, SLOT(sEditWarehouse()));
        else if (_privileges->check("ViewWarehouses"))
            menuItem = pMenu->insertItem(viewStr, this, SLOT(sViewWarehouse()));

        break;

    default:
        break;
    }
}
Exemple #3
0
void contact::sViewUse()
{
  switch (_uses->altId())
  {
    case 1:
    case 2:
      sViewCRMAccount();
      break;

    case 3:
    case 4:
      sViewCustomer();
      break;

    case 5:
    case 6:
      sViewVendor();
      break;

    case 7:
      sViewProspect();
      break;

    case 8:
      sViewShipto();
      break;

    case 9:
      sViewVendorAddress();
      break;

    case 10:
      sViewWarehouse();
      break;

    case 11:
      sViewEmployee();
      break;

    default:
      break;
  }
}
Exemple #4
0
void contact::sPopulateUsesMenu(QMenu* pMenu)
{
  int menuItem;
  QString editStr = tr("Edit...");
  QString viewStr = tr("View...");
  QString detachStr = tr("Detach");

  switch (_uses->altId())
  {
    case 1:
    case 2:
      menuItem = pMenu->insertItem(editStr, this, SLOT(sEditCRMAccount()));
      pMenu->setItemEnabled(menuItem, _privileges->check("MaintainCRMAccounts"));
      menuItem = pMenu->insertItem(viewStr, this, SLOT(sViewCRMAccount()));
      pMenu->setItemEnabled(menuItem, _privileges->check("ViewCRMAccounts"));
      menuItem = pMenu->insertItem(detachStr, this, SLOT(sDetachUse()));
      pMenu->setItemEnabled(menuItem, _privileges->check("MaintainCRMAccounts"));
      break;

    case 3:
    case 4:
      menuItem = pMenu->insertItem(editStr, this, SLOT(sEditCustomer()));
      pMenu->setItemEnabled(menuItem, _privileges->check("MaintainCustomerMasters"));
      menuItem = pMenu->insertItem(viewStr, this, SLOT(sViewCustomer()));
      pMenu->setItemEnabled(menuItem, _privileges->check("ViewCustomerMasters"));
      menuItem = pMenu->insertItem(detachStr, this, SLOT(sDetachUse()));
      pMenu->setItemEnabled(menuItem, _privileges->check("MaintainCustomerMasters"));
      break;

    case 5:
    case 6:
      menuItem = pMenu->insertItem(editStr, this, SLOT(sEditVendor()));
      pMenu->setItemEnabled(menuItem, _privileges->check("MaintainVendors"));
      menuItem = pMenu->insertItem(viewStr, this, SLOT(sViewVendor()));
      pMenu->setItemEnabled(menuItem, _privileges->check("ViewVendors"));
      menuItem = pMenu->insertItem(detachStr, this, SLOT(sDetachUse()));
      pMenu->setItemEnabled(menuItem, _privileges->check("MaintainVendors"));
      break;

    case 7:
      menuItem = pMenu->insertItem(editStr, this, SLOT(sEditProspect()));
      pMenu->setItemEnabled(menuItem, _privileges->check("MaintainProspects"));
      menuItem = pMenu->insertItem(viewStr, this, SLOT(sViewProspect()));
      pMenu->setItemEnabled(menuItem, _privileges->check("ViewProspects"));
      menuItem = pMenu->insertItem(detachStr, this, SLOT(sDetachUse()));
      pMenu->setItemEnabled(menuItem, _privileges->check("MaintainProspects"));
      break;

    case 8:
      menuItem = pMenu->insertItem(editStr, this, SLOT(sEditShipto()));
      pMenu->setItemEnabled(menuItem, _privileges->check("MaintainShiptos"));
      menuItem = pMenu->insertItem(viewStr, this, SLOT(sViewShipto()));
      pMenu->setItemEnabled(menuItem, _privileges->check("ViewShiptos"));
      menuItem = pMenu->insertItem(detachStr, this, SLOT(sDetachUse()));
      pMenu->setItemEnabled(menuItem, _privileges->check("MaintainShiptos"));
      break;

    case 9:
      menuItem = pMenu->insertItem(editStr, this, SLOT(sEditVendorAddress()));
      pMenu->setItemEnabled(menuItem, _privileges->check("MaintainVendorAddresses"));
      menuItem = pMenu->insertItem(viewStr, this, SLOT(sViewVendorAddress()));
      pMenu->setItemEnabled(menuItem, _privileges->check("ViewVendorAddresses"));
      menuItem = pMenu->insertItem(detachStr, this, SLOT(sDetachUse()));
      pMenu->setItemEnabled(menuItem, _privileges->check("MaintainVendorAddresses"));
      break;

    case 10:
      menuItem = pMenu->insertItem(editStr, this, SLOT(sEditWarehouse()));
      pMenu->setItemEnabled(menuItem, _privileges->check("MaintainWarehouses"));
      menuItem = pMenu->insertItem(viewStr, this, SLOT(sViewWarehouse()));
      pMenu->setItemEnabled(menuItem, _privileges->check("ViewWarehouses"));
      menuItem = pMenu->insertItem(detachStr, this, SLOT(sDetachUse()));
      pMenu->setItemEnabled(menuItem, _privileges->check("MaintainWarehouses"));
      break;

    default:
      break;
  }
}