Ejemplo n.º 1
0
        private void PrepareDuplicacyCheckProgressBar()
        {
            _uniqueString = string.Empty;
            foreach (InventoryItemSpecificationModel model in lstItemSpecifications)
            {
                _uniqueString += string.Format("{0}|", model.InventoryLevelValueID);
            }

            List <SelectListItem> lstStrings = (new ServiceInventoryItems()).GetUniqueStringsOfItemsForCategory(this.SelectedCategoryID);
            double maxMatchPercent           = 0;

            foreach (SelectListItem item in lstStrings)
            {
                if (item.ID != this.ItemID)
                {
                    double matchPercent = AppCommon.CalculateSimilarity(_uniqueString, item.Description);
                    if (matchPercent > maxMatchPercent)
                    {
                        maxMatchPercent = matchPercent;
                    }
                }
            }
            progressBar1.Maximum = 100;
            progressBar1.Value   = (int)(maxMatchPercent * 100);
            Application.DoEvents();
        }