Exemple #1
0
        private void UpdateButtonOkStatus()
        {
            string message = string.Empty;

            // name
            if (string.IsNullOrEmpty(tbName.Text))
            {
                message = Resources.ID_FIELDNAMEEMPTY;
            }
            // description
            else if (string.IsNullOrEmpty(tbDescription.Text))
            {
                message = Resources.ID_FIELDDESCRIPTIONEMPTY;
            }
            // name validity
            else if (!_document.IsValidNewAnalysisName(tbName.Text, _analysis))
            {
                message = string.Format(Resources.ID_INVALIDNAME, tbName.Text);
            }
            // maximum load
            else if (!UseMaximumLoadOnLowerCylinder && !UseMaximumNumberOfItems && !UseMaximumPalletHeight && !UseMaximumPalletWeight)
            {
                message = Resources.ID_USEATLEASTONESTOPSTACKINGCRITERION;
            }
            // button OK
            bnOK.Enabled = string.IsNullOrEmpty(message);
            // status bar
            toolStripStatusLabelDef.ForeColor = string.IsNullOrEmpty(message) ? Color.Black : Color.Red;
            toolStripStatusLabelDef.Text      = string.IsNullOrEmpty(message) ? Resources.ID_READY : message;
        }
        private void UpdateButtonOkStatus()
        {
            string message = string.Empty;

            // name
            if (string.IsNullOrEmpty(tbName.Text))
            {
                message = Resources.ID_FIELDNAMEEMPTY;
            }
            // description
            else if (string.IsNullOrEmpty(tbDescription.Text))
            {
                message = Resources.ID_FIELDDESCRIPTIONEMPTY;
            }
            // name validity
            else if (!_document.IsValidNewAnalysisName(tbName.Text, _analysis))
            {
                message = string.Format(Resources.ID_INVALIDNAME, tbName.Text);
            }
            else if (UseMaximumPalletWeight && SelectedCylinder.Weight < 1.0E-06)
            {
                message = string.Format(Resources.ID_CANNOTUSEWEIGHTLIMIT, SelectedCylinder.Name);
            }

            // button OK
            bnOK.Enabled = string.IsNullOrEmpty(message);
            // status bar
            toolStripStatusLabelDef.ForeColor = string.IsNullOrEmpty(message) ? Color.Black : Color.Red;
            toolStripStatusLabelDef.Text      = string.IsNullOrEmpty(message) ? Resources.ID_READY : message;
        }
Exemple #3
0
        private void UpdateButtonOkStatus()
        {
            string message = string.Empty;

            // name
            if (string.IsNullOrEmpty(tbName.Text))
            {
                message = Resources.ID_FIELDNAMEEMPTY;
            }
            // name validity
            else if (!_document.IsValidNewAnalysisName(tbName.Text, _analysis))
            {
                message = string.Format(Resources.ID_INVALIDNAME, tbName.Text);
            }
            // description
            else if (string.IsNullOrEmpty(tbDescription.Text))
            {
                message = Resources.ID_FIELDDESCRIPTIONEMPTY;
            }
            // orientation
            else if (!AllowVerticalX && !AllowVerticalY && !AllowVerticalZ)
            {
                message = Resources.ID_DEFINEATLEASTONEVERTICALAXIS;
            }
            // maximum weight reached with only one box ?
            else if (UseMaximumCaseWeight && (MaximumCaseWeight < SelectedCase.Weight + SelectedBox.Weight))
            {
                message = string.Format(Resources.ID_MAXIMUMCASEWEIGHTSHOULDEXCEED, SelectedCase.Weight + SelectedBox.Weight);
            }
            // does box fits in case ?
            else if (!SelectedBox.FitsIn(SelectedCase, AllowVerticalX, AllowVerticalY, AllowVerticalZ))
            {
                message = string.Format(Resources.ID_BOXDOESNOTFITINCASE, SelectedBox.Name, SelectedCase.Name);
            }
            // update nud boxes according to checkbox
            nudMaximumCaseWeight.Enabled    = checkBoxMaximumCaseWeight.Checked;
            nudMaximumNumberOfBoxes.Enabled = checkBoxMaximumNumberOfBoxes.Checked;
            //---
            // button OK
            bnOk.Enabled = string.IsNullOrEmpty(message);
            // status bar
            toolStripStatusLabelDef.ForeColor = string.IsNullOrEmpty(message) ? Color.Black : Color.Red;
            toolStripStatusLabelDef.Text      = string.IsNullOrEmpty(message) ? Resources.ID_READY : message;
        }