Пример #1
0
        public static bool UninstallCallbackModule()
        {
            bool isInstall;

            ModuleSettingsProvider.RemoveSqlSetting("email4notify", _moduleName);
            ModuleSettingsProvider.RemoveSqlSetting("emailFormat", _moduleName);
            ModuleSettingsProvider.RemoveSqlSetting("emailSubject", _moduleName);
            ModuleSettingsProvider.RemoveSqlSetting("windowTitle", _moduleName);
            ModuleSettingsProvider.RemoveSqlSetting("windowText", _moduleName);

            using (var da = new SQLDataAccess())
            {
                if (!ModulesRepository.IsExistsModuleTable(da, "Module", _moduleName))
                {
                    return(true);
                }

                da.cmd.CommandText = "DROP TABLE Module." + _moduleName;
                da.cmd.CommandType = CommandType.Text;

                da.cnOpen();
                da.cmd.ExecuteNonQuery();
                da.cnClose();

                isInstall = ModulesRepository.IsExistsModuleTable(da, "Module", _moduleName);
            }
            return(isInstall);
        }
Пример #2
0
 public static bool IsAliveCallbackModule()
 {
     using (var da = new SQLDataAccess())
     {
         return(ModulesRepository.IsExistsModuleTable(da, "Module", _moduleName));
     }
 }
Пример #3
0
 public static bool IsAliveStoreReviewsModule()
 {
     using (var da = new SQLDataAccess())
     {
         return(ModulesRepository.IsExistsModuleTable(da, "Module", "StoreReview"));
     }
 }
Пример #4
0
        public static bool InstallStoreReviewsModule()
        {
            if (!ModulesRepository.IsExistsModuleTable("Module", "StoreReview"))
            {
                ModulesRepository.ModuleExecuteNonQuery(
                    @"CREATE TABLE Module.StoreReview
                    (  ID int NOT NULL IDENTITY (1, 1),
	                        ParentID int NULL,
	                        ReviewerEmail nvarchar(50) NOT NULL,
                            ReviewerName nvarchar(100) NOT NULL,
	                        Review nvarchar(MAX) NOT NULL,
	                        DateAdded datetime NOT NULL,
                            Moderated bit NOT NULL,
	                        Rate int NULL
	                        )  ON [PRIMARY]
	                            TEXTIMAGE_ON [PRIMARY]                                        
                        ALTER TABLE Module.StoreReview ADD CONSTRAINT
	                        PK_StoreReview PRIMARY KEY CLUSTERED 
	                        (
	                        ID
	                        ) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]                                        
                        ALTER TABLE Module.StoreReview SET (LOCK_ESCALATION = TABLE)
                        SET IDENTITY_INSERT Module.StoreReview ON",
                    CommandType.Text);
            }
            ModuleSettingsProvider.SetSettingValue("PageSize", "20", "StoreReviews");
            return(ModulesRepository.IsExistsModuleTable("Module", "StoreReview"));
        }
Пример #5
0
        public static bool UninstallStoreReviewsModule()
        {
            if (ModulesRepository.IsExistsModuleTable("Module", "StoreReview"))
            {
                ModulesRepository.ModuleExecuteNonQuery(@"DROP TABLE Module.StoreReview", CommandType.Text);
            }

            return(ModulesRepository.IsExistsModuleTable("Module", "StoreReview"));
        }
Пример #6
0
        public static bool InstallCallbackModule()
        {
            bool isInstall;

            using (var da = new SQLDataAccess())
            {
                if (ModulesRepository.IsExistsModuleTable(da, "Module", _moduleName))
                {
                    return(true);
                }

                da.cmd.CommandText = "CREATE TABLE Module." + _moduleName +
                                     @"(
	                                        ID int NOT NULL IDENTITY (1, 1),
                                            Name nvarchar(100) NOT NULL,
	                                        Phone nvarchar(50) NOT NULL,
                                            DateAdded nvarchar(50) not null,
	                                        Comment nvarchar(MAX) NOT NULL,
	                                        AdminComment nvarchar(MAX) NOT NULL,
                                            Processed bit NOT NULL,
	                                        )  ON [PRIMARY]
	                                         TEXTIMAGE_ON [PRIMARY]                                        
                                           ALTER TABLE Module." + _moduleName + @" ADD CONSTRAINT
	                                        PK_Callback PRIMARY KEY CLUSTERED 
	                                        (
	                                        ID
	                                        ) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]                                        
                                        ALTER TABLE Module." + _moduleName + @" SET (LOCK_ESCALATION = TABLE)
                                        SET IDENTITY_INSERT Module." + _moduleName + " ON";
                da.cmd.CommandType = CommandType.Text;

                da.cnOpen();
                da.cmd.ExecuteNonQuery();
                da.cnClose();

                ModuleSettingsProvider.SetSettingValue("email4notify", "", _moduleName);
                ModuleSettingsProvider.SetSettingValue("emailFormat", "<h4>Поступил новый заказ обратного звонка</h4><br/> Имя: #NAME# <br/> Телефон: #PHONE# <br/> Комментарий: #COMMENT#", _moduleName);
                ModuleSettingsProvider.SetSettingValue("emailSubject", "Заказ обратного звонка", _moduleName);
                ModuleSettingsProvider.SetSettingValue("windowTitle", "Обратный звонок", _moduleName);
                ModuleSettingsProvider.SetSettingValue("windowText", "Укажите свое имя и номер телефона, и мы Вам обязательно перезвоним.", _moduleName);

                isInstall = ModulesRepository.IsExistsModuleTable(da, "Module", _moduleName);
            }
            return(isInstall);
        }
Пример #7
0
        public static bool InstallStoreReviewsModule()
        {
            bool isInstall;

            using (var da = new SQLDataAccess())
            {
                if (ModulesRepository.IsExistsModuleTable(da, "Module", "StoreReview"))
                {
                    return(true);
                }

                da.cmd.CommandText = @"CREATE TABLE Module.StoreReview
	                                        (
	                                        ID int NOT NULL IDENTITY (1, 1),
	                                        ParentID int NULL,
	                                        ReviewerEmail nvarchar(50) NOT NULL,
                                            ReviewerName nvarchar(100) NOT NULL,
	                                        Review nvarchar(MAX) NOT NULL,
	                                        DateAdded datetime NOT NULL,
                                            Moderated bit NOT NULL,
	                                        Rate int NULL
	                                        )  ON [PRIMARY]
	                                         TEXTIMAGE_ON [PRIMARY]                                        
                                        ALTER TABLE Module.StoreReview ADD CONSTRAINT
	                                        PK_StoreReview PRIMARY KEY CLUSTERED 
	                                        (
	                                        ID
	                                        ) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]                                        
                                        ALTER TABLE Module.StoreReview SET (LOCK_ESCALATION = TABLE)
                                        SET IDENTITY_INSERT Module.StoreReview ON
                                        ";
                da.cmd.CommandType = CommandType.Text;

                da.cnOpen();
                da.cmd.ExecuteNonQuery();
                da.cnClose();

                ModuleSettingsProvider.SetSettingValue("PageSize", "20", "StoreReviews");
                isInstall = ModulesRepository.IsExistsModuleTable(da, "Module", "StoreReview");
            }
            return(isInstall);
        }
Пример #8
0
        public static bool UninstallStoreReviewsModule()
        {
            bool isInstall;

            using (var da = new SQLDataAccess())
            {
                if (!ModulesRepository.IsExistsModuleTable(da, "Module", "StoreReview"))
                {
                    return(true);
                }

                da.cmd.CommandText = "DROP TABLE Module.StoreReview";
                da.cmd.CommandType = CommandType.Text;

                da.cnOpen();
                da.cmd.ExecuteNonQuery();
                da.cnClose();

                isInstall = ModulesRepository.IsExistsModuleTable(da, "Module", "StoreReview");
            }
            return(isInstall);
        }
Пример #9
0
 public static bool IsAliveStoreReviewsModule()
 {
     return(ModulesRepository.IsExistsModuleTable("Module", "StoreReview"));
 }