示例#1
0
 public AlternateManufacturer(DesktopSession desktopSession, ref ActiveManufacturer aManufacturerModel)
 {
     DesktopSession = desktopSession;
     InitializeComponent();
     this.cancelButton.BackgroundImage   = DesktopSession.ResourceProperties.vistabutton_blue;
     this.continueButton.BackgroundImage = DesktopSession.ResourceProperties.vistabutton_blue;
     this.BackgroundImage     = DesktopSession.ResourceProperties.newDialog_400_BlueScale;
     _ActiveManufacturerModel = aManufacturerModel;
 }
示例#2
0
        // Standard Method to update the ProKnow Manufacturer information
        private void ManufacturerUpdate(ref ProKnowMatch proKnowMatch, ActiveManufacturer currentManufacturer, string sAnswerText, int iAnswerCode)
        {
            Answer updatedAnswer = proKnowMatch.manufacturerModelInfo[(int)currentManufacturer];

            updatedAnswer.AnswerText = sAnswerText;
            updatedAnswer.AnswerCode = iAnswerCode;

            proKnowMatch.manufacturerModelInfo.RemoveAt((int)currentManufacturer);
            proKnowMatch.manufacturerModelInfo.Insert((int)currentManufacturer, updatedAnswer);
        }
示例#3
0
        // Extracts the information returned from ProKnow manModelMatchType object
        public void ParseProKnowDetails(ref ProKnowMatch proKnowMatch, ref string levelNest, manModelMatchType selectedManModelMatchType, ActiveManufacturer _ActiveManufacturerModel, out ProKnowLookupAction LookupMatch)
        {
            Error        = false;
            ErrorMessage = "";
            LookupMatch  = ProKnowLookupAction.NO_ACTION;

            CategoryNode cnCategoryNodeWalker = DesktopSession.CategoryXML.GetMerchandiseCategory(selectedManModelMatchType.categoryCode.ToString(), ref levelNest);

            if (cnCategoryNodeWalker != null && _ActiveManufacturerModel == ActiveManufacturer.PRIMARY)
            {
                proKnowMatch.primaryCategoryCode            = cnCategoryNodeWalker.CategoryCode;
                proKnowMatch.primaryCategoryCodeDescription = cnCategoryNodeWalker.Description;
                proKnowMatch.primaryMaskPointer             = cnCategoryNodeWalker.Masks;
            }

            // Update Manufacturer and Model AnswerCodes
            ManufacturerUpdate(ref proKnowMatch,
                               _ActiveManufacturerModel,
                               proKnowMatch.manufacturerModelInfo[(int)_ActiveManufacturerModel].AnswerText,
                               cnCategoryNodeWalker.CategoryCode);

            // Get all the masknn properties from the manModelMatchType returned
            foreach (PropertyInfo pi in selectedManModelMatchType.preAnswered.GetType().GetProperties())
            {
                if (pi.Name.StartsWith("mask", StringComparison.OrdinalIgnoreCase) &&
                    !pi.Name.EndsWith("Specified", StringComparison.OrdinalIgnoreCase))
                {
                    var iPiValue = Convert.ToInt32(pi.GetValue(selectedManModelMatchType.preAnswered, null));

                    if (iPiValue > 0)
                    {
                        var manModelMatchAnswer = new Answer
                        {
                            AnswerText = pi.Name,
                            AnswerCode =
                                Convert.ToInt32(pi.GetValue(
                                                    selectedManModelMatchType.preAnswered, null))
                        };

                        if (proKnowMatch.preAnsweredQuestions == null)
                        {
                            proKnowMatch.preAnsweredQuestions = new List <Answer>();
                        }

                        proKnowMatch.preAnsweredQuestions.Add(manModelMatchAnswer);
                    }
                }
            }
            // Get FixedFeatures
            if (selectedManModelMatchType.fixedFeatures != null)
            {
                proKnowMatch.displayFixedFeaturesOnTag = selectedManModelMatchType.fixedFeatures.printTag;

                // Check to see if fixedFeaturesList has not been instantiated yet.  Instantiate it.
                if (proKnowMatch.fixedFeaturesList == null)
                {
                    proKnowMatch.fixedFeaturesList = new List <FixedFeature>();
                }

                foreach (var foundFixedFeatureType in selectedManModelMatchType.fixedFeatures.feature)
                {
                    var fixFeature = new FixedFeature
                    {
                        AnswerCode = foundFixedFeatureType.answerNumber,
                        AnswerText = foundFixedFeatureType.description
                    };
                    proKnowMatch.fixedFeaturesList.Add(fixFeature);
                }
            }
            // Get data from <values#> blocks
            foreach (PropertyInfo value in selectedManModelMatchType.GetType().GetProperties())
            {
                if (value != null &&
                    !string.IsNullOrEmpty(value.Name) &&
                    value.Name.StartsWith("values", StringComparison.OrdinalIgnoreCase))
                {
                    var foundValueType = (valuesType)value.GetValue(selectedManModelMatchType, null);

                    if (foundValueType != null)
                    {
                        var foundProKnowData = new ProKnowData
                        {
                            ConditionLevel =
                                Convert.ToInt32(value.Name.Replace("values", string.Empty)),
                            LoanAmount          = Convert.ToDecimal(foundValueType.loanAmount),
                            LoanVarHighAmount   = Convert.ToDecimal(foundValueType.loanVarHigh),
                            LoanVarLowAmount    = Convert.ToDecimal(foundValueType.loanVarLow),
                            PurchaseAmount      = Convert.ToDecimal(foundValueType.purchaseAmount),
                            RetailAmount        = Convert.ToDecimal(foundValueType.retailAmount),
                            RetailVarHighAmount =
                                Convert.ToDecimal(foundValueType.purchaseVarHigh),
                            RetailVarHighRetailer = string.Empty,
                            RetailVarLowAmount    =
                                Convert.ToDecimal(foundValueType.purchaseVarLow),
                            RetailVarLowRetailer = string.Empty
                        };

                        if (proKnowMatch.proKnowData == null)
                        {
                            proKnowMatch.proKnowData = new List <ProKnowData>();
                        }

                        proKnowMatch.selectedPKData = foundProKnowData;
                        proKnowMatch.proKnowData.Add(foundProKnowData);
                    }
                }
            }
            // Get <ProCallData> information
            if (selectedManModelMatchType.proCallData != null && _ActiveManufacturerModel == ActiveManufacturer.PRIMARY)
            {
                var proCallData = new ProCallData
                {
                    LastUpdateDate = selectedManModelMatchType.proCallData.lastUpdateDate
                };
                if (!string.IsNullOrEmpty(selectedManModelMatchType.proCallData.newRetail))
                {
                    proCallData.NewRetail = Utilities.GetDecimalValue(selectedManModelMatchType.proCallData.newRetail, 0);
                }
                proCallData.YearDiscontinued = selectedManModelMatchType.proCallData.yearDiscontinued;
                proCallData.YearIntroduced   = selectedManModelMatchType.proCallData.yearIntroduced;

                // Check to see if proCallData has not been instantiated yet.  Instantiate it.
                proKnowMatch.proCallData = proCallData;
            }

            if (selectedManModelMatchType.combinationCategoryInfo != null && proKnowMatch.transitionStatus != TransitionStatus.MAN_MODEL_PROKNOW_COMBO)
            {
                var describedMerchandise = new DescribedMerchandise(proKnowMatch.primaryMaskPointer);
                if (describedMerchandise.Exists)
                {
                    // If CashlinxDesktopSesson ActivePawnLoan is null, create a PawnLoad
                    // and add pawnItem to it
                    Item item = describedMerchandise.SelectedPawnItem;

                    if (DesktopSession.HistorySession.Trigger.Equals(Commons.TriggerTypes.CUSTOMERPURCHASE, StringComparison.OrdinalIgnoreCase) ||
                        DesktopSession.HistorySession.Trigger.Equals(Commons.TriggerTypes.DESCRIBEITEMCUSTOMERPURCHASE, StringComparison.OrdinalIgnoreCase) ||
                        DesktopSession.HistorySession.Trigger.Equals(Commons.TriggerTypes.CUSTOMERPURCHASEPFI, StringComparison.OrdinalIgnoreCase) ||
                        DesktopSession.HistorySession.Trigger.Equals(Commons.TriggerTypes.VENDORPURCHASE, StringComparison.OrdinalIgnoreCase))
                    {
                        if (DesktopSession.ActivePurchase == null)
                        {
                            DesktopSession.ActivePurchase = new PurchaseVO();
                        }

                        item.mItemOrder = DesktopSession.ActivePurchase.Items.Count + 1;
                        DesktopSession.ActivePurchase.Items.Add(item);
                    }
                    else
                    {
                        if (DesktopSession.ActivePawnLoan == null)
                        {
                            DesktopSession.ActivePawnLoan = new PawnLoan();
                        }

                        item.mItemOrder = DesktopSession.ActivePawnLoan.Items.Count + 1;
                        DesktopSession.ActivePawnLoan.Items.Add(item);
                    }

                    if (_ActiveManufacturerModel == ActiveManufacturer.PRIMARY)
                    {
                        // Create Secondary Manufacturer Answer object and add to Manufacturer Model Info
                        var secondaryManufacturer = new Answer
                        {
                            AnswerCode =
                                selectedManModelMatchType.combinationCategoryInfo.
                                secondaryManufacturer
                        };

                        ItemAttribute secondManufacturerItemAttribute = item.Attributes.Find(
                            iaManufacturer => iaManufacturer.AttributeCode == secondaryManufacturer.AnswerCode);

                        secondaryManufacturer.AnswerText = secondManufacturerItemAttribute.Description;
                        secondaryManufacturer.InputKey   = secondManufacturerItemAttribute.Description;
                        proKnowMatch.manufacturerModelInfo.Add(secondaryManufacturer);

                        // Create Secondary Model Answer object and add to Manufacturer Model Info
                        var secondaryModel = new Answer
                        {
                            AnswerCode =
                                selectedManModelMatchType.combinationCategoryInfo.secondaryModel
                        };

                        ItemAttribute secondModelItemAttribute = item.Attributes.Find(
                            iaModel => iaModel.AttributeCode == secondaryModel.AnswerCode);

                        secondaryModel.AnswerText = secondModelItemAttribute.Description;
                        secondaryModel.InputKey   = secondModelItemAttribute.Description;
                        proKnowMatch.manufacturerModelInfo.Add(secondaryModel);

                        proKnowMatch.transitionStatus = TransitionStatus.MAN_MODEL_PROKNOW_COMBO;

                        LookupMatch = ProKnowLookupAction.SECONDARY;
                    }
                }
            }
            else
            {
                proKnowMatch.transitionStatus = proKnowMatch.transitionStatus != TransitionStatus.MAN_MODEL_PROKNOW_COMBO ? TransitionStatus.MAN_MODEL_PROKNOW : TransitionStatus.MAN_MODEL_PROKNOW_COMBO;

                if (proKnowMatch.transitionStatus == TransitionStatus.MAN_MODEL_PROKNOW_COMBO)
                {
                    // Update Manufacturer and Model AnswerCodes
                    DataRow[] myDataRows = DesktopSession.MerchandiseManufacturers.Select("ANS_DESC='" + proKnowMatch.manufacturerModelInfo[2].AnswerText + "'");
                    if (myDataRows.Length > 0)
                    {
                        ManufacturerUpdate(ref proKnowMatch,
                                           _ActiveManufacturerModel,
                                           proKnowMatch.manufacturerModelInfo[(int)_ActiveManufacturerModel].AnswerText,
                                           Convert.ToInt32(myDataRows[0]["ANS_ID"]));
                    }
                }

                LookupMatch = ProKnowLookupAction.DESCRIBE_ITEM_DOUBLE;
            }
        }