public LookUpEdit MapFrom(RouteStationResult result)
        {
            LookUpEdit       lookup = new LookUpEdit();
            RouteStationStep step   = result.Step;

            lookup.Properties.DataSource = step.ResultList.ResultListValues;
            step.ResultList.ResultListValues.DisplayableProperties = "This!;Value";
            lookup.Name = step.DisplayPrompt + "lookUp";
            lookup.Properties.NullText      = "Select " + step.DisplayPrompt + " result";
            lookup.Properties.DisplayMember = "Value";
            lookup.Properties.ValueMember   = "Value";
            lookup.DataBindings.Add("EditValue", result, "Result");
            lookup.EnterMoveNextControl = true;
            return(lookup);
        }
Example #2
0
 void resultListSelList_ButtonClick(object sender, ButtonPressedEventArgs e)
 {
     if (e.Button.Kind == ButtonPredefines.Delete)
     {
         RouteStationStep step = stepsView.GetFocusedRow() as RouteStationStep;
         if (step != null)
         {
             if (MessageBox.Show("Are you sure that you want to remove this list?", Application.ProductName, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
             {
                 step.ResultList = null;
                 MessageBox.Show("List Removed");
             }
         }
     }
 }
Example #3
0
        public void process_validator_fails_when_there_are_invalid_steps()
        {
            PartAttributesHeader header =
                Xpo.CreateXPObject <PartAttributesHeader>();

            PartAttributeValues values =
                Xpo.CreateXPObject <PartAttributeValues>();

            header.Attr1 = "Firmware";
            header.Attr2 = "ASR";

            values.Header = header;
            values.Attr1  = "E36X";
            values.Attr2  = "A03";

            // Create step1 with Firmware validation
            RouteStationStep step1 = Xpo.CreateXPObject <RouteStationStep>();

            step1.DisplayPrompt  = "Firmware";
            step1.ValidationType = StepResultValidationType.Firmware;

            // Create step2 with MSR validation
            RouteStationStep step2 = Xpo.CreateXPObject <RouteStationStep>();

            step2.DisplayPrompt  = "Current Revision";
            step2.ValidationType = StepResultValidationType.MinimumShippableRevision;

            // Create step3 with OpenText validation
            RouteStationStep step3 = Xpo.CreateXPObject <RouteStationStep>();

            step3.DisplayPrompt  = "Step3";
            step3.ValidationType = StepResultValidationType.OpenText;

            // Create a test part with dummy attributes
            Part part = Xpo.CreateXPObject <Part>();

            // Set the parts attributes to the fake attributes we created.
            part.Attributes = values;

            // Create Firmware step result
            RouteStationResult result1 =
                Xpo.CreateXPObject <RouteStationResult>();

            result1.Step   = step1;
            result1.Result = "E36X";

            // Create the MSR step result
            RouteStationResult result2 = Xpo.CreateXPObject <RouteStationResult>();

            result2.Step   = step2;
            result2.Result = "A04";

            // Create the OpenText step result
            RouteStationResult result3 = Xpo.CreateXPObject <RouteStationResult>();

            result3.Step   = step3;
            result3.Result = "i can type whatever i want to";

            // Create a station process SCENARIO
            RouteStationProcess process =
                Xpo.CreateXPObject <RouteStationProcess>();

            // Create a fake inventory item
            InventoryItem item = Xpo.CreateXPObject <InventoryItem>();

            // Set the inventory part to the attribute part we've created.
            item.Part = part;

            // Set the process inventory item to the fake inventory item we've created.
            process.Item = item;

            // Add the results to the process
            process.Results.Add(result1);
            process.Results.Add(result2);
            process.Results.Add(result3);

            // Generate a fake process outcome
            StationOutcome outcome = Xpo.CreateXPObject <StationOutcome>();

            outcome.Label = "PASS";

            // Assign the outcome to our fake process
            process.StationOutcome = outcome;

            // Validate the process
            RouteStationProcessValidator validator =
                new RouteStationProcessValidator(process);

            Assert.IsFalse(validator.Validated());
        }