Exemple #1
0
        public IActionResult CompareProducts(string prod1, string prod2)
        {
            var products = _productCompareService.GetProducts();
            var p1       = products.FirstOrDefault(m => m.Product_Name == prod1);
            var p2       = products.FirstOrDefault(m => m.Product_Name == prod2);

            var rootPath = _hostingEnvironment.WebRootPath + "\\";// + _configuration["UserFilePath:ProductImages"];

            if (p1 != null)
            {
                string folder = Path.Combine(rootPath, p1.ImagePath); //HNS.IOHelper.DirectorySearch(rootPath, prod1.Replace("IEC", ""));
                if (!string.IsNullOrWhiteSpace(folder))
                {
                    var files = Directory.GetFiles(folder, "*.jpg");
                    foreach (var file in files)
                    {
                        p1.Images.Add(Request.Headers["Origin"].ToString() + file.Replace(_hostingEnvironment.WebRootPath, "").Replace("\\", "/"));
                    }
                }
            }

            if (p2 != null)
            {
                string folder = Path.Combine(rootPath, p2.ImagePath);  //HNS.IOHelper.DirectorySearch(rootPath, prod2.Replace("IEC", ""));
                if (!string.IsNullOrWhiteSpace(folder))
                {
                    var files = Directory.GetFiles(folder, "*.jpg");
                    foreach (var file in files)
                    {
                        p2.Images.Add(Request.Headers["Origin"].ToString() + file.Replace(_hostingEnvironment.WebRootPath, "").Replace("\\", "/"));
                    }
                }
            }

            return(Json(new { product1 = p1, product2 = p2 }));
        }
Exemple #2
0
        public void PopulateProperties()
        {
            var products = _productService.GetProducts();

            //LCDSizeAndResolutions = new List<string>() { "None(외부 모니터 별도 구매 Anglog RGB Port,1024x768) ", "B","C" };
            BezelTypes = new List <string>()
            {
                "None(OpenFrame Type)", "B1(Bezel Type)", "B2(Bezel Type)"
            };
            CPUPerformances = new List <string>()
            {
                "1Ghz", "667Mhz", "266Mhz"
            };
            ExtensionPorts1 = new List <string>()
            {
                "16핀(Extension Port - I)"
            };
            ExtensionPorts2 = new List <string>()
            {
                "48핀(Extension Port - II)"
            };
            WiredLans = new List <string>()
            {
                "100Mbps", "10Mbps", "None"
            };
            RAMs = new List <string>()
            {
                "64MB", "256MB", "512MB"
            };
            Flases = new List <string>()
            {
                "64MB", "128MB", "256MB"
            };
            Powers = new List <string> {
                "DC 9 ~ 24V", "DC 5V only"
            };
            UARTs = new List <string> {
                "3Ch", "4Ch"
            };
            RS485s = new List <string> {
                "H/W 지원", "S/W 지원"
            };
            ADCs = new List <string> {
                "6Ch(12Bit)", "4Ch(12Bit)", "4Ch(10Bit)"
            };
            USBHosts = new List <string> {
                "2Ch", "1Ch"
            };
            CECertifications = new List <string> {
                "CE 인증 제품"
            };
            SmartIOs2 = new List <string> {
                "Smart I/O - II"
            };
            SmartIOs3 = new List <string> {
                "Smart I/O - III"
            };
            SmartVideos = new List <string> {
                "지원", "미지원"
            };
            SmartBatteries = new List <string> {
                "지원", "미지원"
            };

            //LCDSizeAndResolutions = products.Select(m => m.Screen_size).Distinct().ToList();
            //BezelTypes = products.Select(m => m.B1B2_Bezel).Distinct().ToList();
            //CPUPerformances = products.Select(m => m.CPU).Distinct().ToList();
            //ExtensionPorts = products.Select(m => m.Extension_Port_I_II).Distinct().ToList();
            //WiredLans = products.Select(m => m.WLAN).Distinct().ToList();
            //RAMs = products.Select(m => m.RAM).Distinct().ToList();
            //Flases = products.Select(m => m.Flash).Distinct().ToList();
            //Powers = products.Select(m => m.power).Distinct().ToList();
            //UARTs = products.Select(m => m.PWM).Distinct().ToList();
            //RS485s = products.Select(m => m.RS485).Distinct().ToList();
            //ADCs = products.Select(m => m.AD_Converter).Distinct().ToList();
            //USBHosts = products.Select(m => m.USBHost).Distinct().ToList();
            //CECertifications = products.Select(m => m.certification).Distinct().ToList();
            //SmartIOs = products.Select(m => m.SmartIO_III).Distinct().ToList();
            //SmartVideos = products.Select(m => m.SmartVideo).Distinct().ToList();
            //SmartBatteries = products.Select(m => m.SmartBattery).Distinct().ToList();
        }