private void DownloadComponentSuccess()
        {
            string[] args = new string[1];
            args[0] = successComponentName;
            string service = "OnlineStore";
            string method  = "ComponentDownloadSuccess";

            try
            {
                WebServiceInvoker invoker = new WebServiceInvoker(new Uri(OnlineStoreURL));
                invoker.InvokeMethod <string>(service, method, args);
                //  string tempFolder = HostingEnvironment.ApplicationPhysicalPath + "unZipComponentInstall";
                string tempFolder = HttpContext.Current.Server.MapPath(@"~\unZipComponentInstall");
                UnZipFiles(componentDownloadPath, tempFolder);
                WebBuilderController objController = new WebBuilderController();
                objController.UpdateComponentValue(downLoadcomponent.ComponentName, downLoadcomponent.ComponentValue, downLoadcomponent.UserModuleID, downLoadcomponent.Version, downLoadcomponent.UniversalComponentID, downLoadcomponent.Type);
                if (isLoopDepemdencyCheck)
                {
                    ComponentDependencies();
                }
            }
            catch (Exception ex)
            {
                //ProcessException(ex);
            }
        }
        public int UpdateComponentValue(string componentName, string componentValue, int userModuleID, decimal version, long UniversalComponentID, string type)
        {
            WebBuilderController objController = new WebBuilderController();

            return(objController.UpdateComponentValue(componentName, componentValue, userModuleID, version, UniversalComponentID, type));
            //WebBuilderDataProvider objDataProvider = new WebBuilderDataProvider();
            //return objDataProvider.UpdateComponentValue(componentName, componentValue, userModuleID, version, UniversalComponentID, type);
        }
        private void ProcessSite(string extractedPath)
        {
            //read json file
            string         filePath = extractedPath + "\\theme.json";
            string         json     = string.Empty;
            WebbuilderSite webInfo  = new WebbuilderSite();

            using (StreamReader readFrom = new StreamReader(filePath, System.Text.Encoding.ASCII))
            {
                json = readFrom.ReadToEnd();
            }
            if (json != string.Empty)
            {
                webInfo = JsonConvert.DeserializeObject <WebbuilderSite>(json);
            }
            if (webInfo != null)
            {
                UpdateThemeDownloadCount(themeID_);
                WebBuilderController objController = new WebBuilderController();
                webInfo.UserName     = userName_;
                webInfo.UserModuleID = userModuleID_;
                webInfo.PortalID     = portalID_;
                webInfo.Culture      = culture_;
                objController.CreateSite(webInfo);
                KeyValue      objKeyValue     = objController.GetInstalledComponentList();
                string[]      clientComponent = objKeyValue.Value.Split(',');
                string[]      siteComponent   = webInfo.Components.Split(',');
                List <string> unInstallCompo  = new List <string>();
                foreach (string siteCompo in siteComponent)
                {
                    bool exists = false;
                    foreach (string clientCom in clientComponent)
                    {
                        if (clientCom == siteCompo)
                        {
                            exists = true;
                        }
                    }
                    if (!exists)
                    {
                        unInstallCompo.Add(siteCompo);
                    }
                }
                if (unInstallCompo.Count > 0)
                {
                    using (WebClient wc = new WebClient())
                    {
                        SageFrameConfig         sageConfig     = new SageFrameConfig();
                        string                  onlineStoreURL = sageConfig.GetSettingValueByIndividualKey(SageFrameSettingKeys.OnlineStore);
                        List <BuilderComponent> objBuildCompo  = new List <BuilderComponent>();
                        string                  componentIDs   = string.Join(",", unInstallCompo);
                        var    reqparm    = new System.Collections.Specialized.NameValueCollection();
                        string resultData = GetOnlineComponents(componentIDs);
                        if (resultData != string.Empty)
                        {
                            objBuildCompo = JsonConvert.DeserializeObject <List <BuilderComponent> >(resultData);
                            foreach (BuilderComponent objBuildCompoitem in objBuildCompo)
                            {
                                objBuildCompoitem.UserModuleID = userModuleID_;
                                UpdateComponentForPage(objBuildCompoitem);
                                ClearUpdateCache();
                            }
                        }
                    }
                }
            }
            Directory.Delete(extractedPath, true);
        }