private void UninstallPaymentGateway(PaymentGateWayModuleInfo paymentGateWay, bool deleteModuleFolder, int gatewayID)
    {
        PaymentGatewayInstaller installerClass = new PaymentGatewayInstaller();
        string path = HttpContext.Current.Server.MapPath("~/");

        //checked if directory exist for current Payment Gateway foldername
        string paymentGatewayFolderPath = paymentGateWay.InstalledFolderPath;
        if (!string.IsNullOrEmpty(paymentGatewayFolderPath))
        {
            if (Directory.Exists(paymentGatewayFolderPath))
            {
                //check for valid .sfe file exist or not
                XmlDocument doc = new XmlDocument();
                doc.Load(paymentGatewayFolderPath + '\\' + paymentGateWay.ManifestFile);

                try
                {
                    if (paymentGateWay.PaymentGatewayTypeID > 0)
                    {
                        //Run script  
                        ReadUninstallScriptAndDLLFiles(doc, paymentGatewayFolderPath, installerClass);
                        //Rollback PaymentGatewayTypeID
                        //installerClass.PaymentGatewayRollBack(paymentGateWay.PaymentGatewayTypeID, GetPortalID, GetStoreID);
                        if (deleteModuleFolder == true)
                        {
                            //Delete Payment GateWay's Original Folder
                            installerClass.DeleteTempDirectory(paymentGateWay.InstalledFolderPath);
                        }
                        installhelp.InstallPackage(paymentModule, gatewayID);
                    }
                }
                catch (Exception ex)
                {
                    _exceptions = ex.Message;
                }
            }
            else if (!Directory.Exists(paymentGatewayFolderPath))
            {
                installhelp.InstallPackage(paymentModule, gatewayID);
            }
            else
            {
                ShowMessage(SageMessageTitle.Exception.ToString(), SageMessage.GetSageModuleLocalMessageByVertualPath("Modules/AspxCommerce/AspxPaymentGateWayManagement/ModuleLocalText", "PaymentGatewayFolderDoesnotExist"), "", SageMessageType.Error);
            }
        }
    }
    private void UninstallPaymentGateway(PaymentGateWayModuleInfo paymentGateWay, bool deleteModuleFolder, int gatewayID)
    {
        PaymentGatewayInstaller installerClass = new PaymentGatewayInstaller();
        string path = HttpContext.Current.Server.MapPath("~/");

        string paymentGatewayFolderPath = paymentGateWay.InstalledFolderPath;
        if (!string.IsNullOrEmpty(paymentGatewayFolderPath))
        {
            if (Directory.Exists(paymentGatewayFolderPath))
            {
                XmlDocument doc = new XmlDocument();
                if (File.Exists(paymentGatewayFolderPath + '\\' + paymentGateWay.ManifestFile))
                {

                    doc.Load(paymentGatewayFolderPath + '\\' + paymentGateWay.ManifestFile);

                    try
                    {
                        if (paymentGateWay.PaymentGatewayTypeID > 0)
                        {
                            ReadUninstallScriptAndDLLFiles(doc, paymentGatewayFolderPath, installerClass);
                            if (deleteModuleFolder == true)
                            {
                                installerClass.DeleteTempDirectory(paymentGateWay.InstalledFolderPath);
                            }
                            installhelp.InstallPackage(paymentModule, gatewayID);
                        }
                    }
                    catch (Exception ex)
                    {
                        _exceptions = ex.Message;
                    }
                }
                else
                {
                    if (deleteModuleFolder == true)
                    {
                        installerClass.DeleteTempDirectory(paymentGateWay.InstalledFolderPath);
                    }
                    installhelp.InstallPackage(paymentModule, gatewayID);
                }
            }
            else if (!Directory.Exists(paymentGatewayFolderPath))
            {
                installhelp.InstallPackage(paymentModule, gatewayID);
            }
            else
            {
                ShowMessage(SageMessageTitle.Exception.ToString(), SageMessage.GetSageModuleLocalMessageByVertualPath("Modules/AspxCommerce/AspxPaymentGateWayManagement/ModuleLocalText", "PaymentGatewayFolderDoesnotExist"), "", SageMessageType.Error);
            }
        }
    }