Exemple #1
0
        public void InsertWithTrans(PublishmentSystemInfo info, IDbTransaction trans)
        {
            //获取排序值
            var taxis       = GetMaxTaxis() + 1;
            var insertParms = new IDataParameter[]
            {
                GetParameter(ParmPublishmentsystemId, EDataType.Integer, info.PublishmentSystemId),
                GetParameter(ParmPublishmentsystemName, EDataType.NVarChar, 50, info.PublishmentSystemName),
                GetParameter(ParmPublishmentsystemType, EDataType.VarChar, 50, EPublishmentSystemTypeUtils.GetValue(info.PublishmentSystemType)),
                GetParameter(ParmAuxiliaryTableForContent, EDataType.VarChar, 50, info.AuxiliaryTableForContent),
                GetParameter(ParmAuxiliaryTableForGovpublic, EDataType.VarChar, 50, info.AuxiliaryTableForGovPublic),
                GetParameter(ParmAuxiliaryTableForGovinteract, EDataType.VarChar, 50, info.AuxiliaryTableForGovInteract),
                GetParameter(ParmAuxiliaryTableForVote, EDataType.VarChar, 50, info.AuxiliaryTableForVote),
                GetParameter(ParmAuxiliaryTableForJob, EDataType.VarChar, 50, info.AuxiliaryTableForJob),
                GetParameter(ParmIsCheckContentUseLevel, EDataType.VarChar, 18, info.IsCheckContentUseLevel.ToString()),
                GetParameter(ParmCheckContentLevel, EDataType.Integer, info.CheckContentLevel),
                GetParameter(ParmPublishmentsystemDir, EDataType.VarChar, 50, info.PublishmentSystemDir),
                GetParameter(ParmPublishmentsystemUrl, EDataType.VarChar, 200, info.PublishmentSystemUrl),
                GetParameter(ParmIsHeadquarters, EDataType.VarChar, 18, info.IsHeadquarters.ToString()),
                GetParameter(ParmParentPublishmentsystemid, EDataType.Integer, info.ParentPublishmentSystemId),
                GetParameter(ParmTaxis, EDataType.Integer, taxis),
                GetParameter(ParmSettingsXml, EDataType.NText, info.Additional.ToString()),
                GetParameter(ParmParentsCount, EDataType.Integer, info.ParentsCount)
            };

            ExecuteNonQuery(trans, SqlInsertPublishmentSystem, insertParms);
            PublishmentSystemManager.ClearCache(true);
        }
Exemple #2
0
        public void UpdateParentPublishmentSystemIdToZero(int parentPublishmentSystemId)
        {
            var sqlString = "UPDATE siteserver_PublishmentSystem SET ParentPublishmentSystemID = 0 WHERE ParentPublishmentSystemID = " + parentPublishmentSystemId;

            ExecuteNonQuery(sqlString);
            PublishmentSystemManager.ClearCache(true);
        }
Exemple #3
0
        public void Update(PublishmentSystemInfo info)
        {
            var updateParms = new IDataParameter[]
            {
                GetParameter(ParmPublishmentsystemName, EDataType.NVarChar, 50, info.PublishmentSystemName),
                GetParameter(ParmPublishmentsystemType, EDataType.VarChar, 50, EPublishmentSystemTypeUtils.GetValue(info.PublishmentSystemType)),
                GetParameter(ParmAuxiliaryTableForContent, EDataType.VarChar, 50, info.AuxiliaryTableForContent),
                GetParameter(ParmAuxiliaryTableForGovpublic, EDataType.VarChar, 50, info.AuxiliaryTableForGovPublic),
                GetParameter(ParmAuxiliaryTableForGovinteract, EDataType.VarChar, 50, info.AuxiliaryTableForGovInteract),
                GetParameter(ParmAuxiliaryTableForVote, EDataType.VarChar, 50, info.AuxiliaryTableForVote),
                GetParameter(ParmAuxiliaryTableForJob, EDataType.VarChar, 50, info.AuxiliaryTableForJob),
                GetParameter(ParmIsCheckContentUseLevel, EDataType.VarChar, 18, info.IsCheckContentUseLevel.ToString()),
                GetParameter(ParmCheckContentLevel, EDataType.Integer, info.CheckContentLevel),
                GetParameter(ParmPublishmentsystemDir, EDataType.VarChar, 50, info.PublishmentSystemDir),
                GetParameter(ParmPublishmentsystemUrl, EDataType.VarChar, 200, info.PublishmentSystemUrl),
                GetParameter(ParmIsHeadquarters, EDataType.VarChar, 18, info.IsHeadquarters.ToString()),
                GetParameter(ParmParentPublishmentsystemid, EDataType.Integer, info.ParentPublishmentSystemId),
                GetParameter(ParmTaxis, EDataType.Integer, info.Taxis),
                GetParameter(ParmSettingsXml, EDataType.NText, info.Additional.ToString()),
                GetParameter(ParmPublishmentsystemId, EDataType.Integer, info.PublishmentSystemId)
            };

            if (info.IsHeadquarters)
            {
                UpdateAllIsHeadquarters();
            }

            ExecuteNonQuery(SqlUpdatePublishmentSystem, updateParms);

            PublishmentSystemManager.ClearCache(true);
        }
Exemple #4
0
        private void UpdateAllIsHeadquarters()
        {
            var updateParms = new IDataParameter[]
            {
                GetParameter(ParmIsHeadquarters, EDataType.VarChar, 18, false.ToString())
            };

            ExecuteNonQuery(SqlUpdateAllIsHeadquarters, updateParms);
            PublishmentSystemManager.ClearCache(true);
        }
Exemple #5
0
        public void UpdateAll(PublishmentSystemInfo info)
        {
            var updateParms = new IDataParameter[]
            {
                GetParameter(ParmPublishmentsystemName, EDataType.NVarChar, 50, info.PublishmentSystemName),
                GetParameter(ParmPublishmentsystemType, EDataType.VarChar, 50, EPublishmentSystemTypeUtils.GetValue(info.PublishmentSystemType)),
                GetParameter(ParmAuxiliaryTableForContent, EDataType.VarChar, 50, info.AuxiliaryTableForContent),
                GetParameter(ParmAuxiliaryTableForGovpublic, EDataType.VarChar, 50, info.AuxiliaryTableForGovPublic),
                GetParameter(ParmAuxiliaryTableForGovinteract, EDataType.VarChar, 50, info.AuxiliaryTableForGovInteract),
                GetParameter(ParmAuxiliaryTableForVote, EDataType.VarChar, 50, info.AuxiliaryTableForVote),
                GetParameter(ParmAuxiliaryTableForJob, EDataType.VarChar, 50, info.AuxiliaryTableForJob),
                GetParameter(ParmIsCheckContentUseLevel, EDataType.VarChar, 18, info.IsCheckContentUseLevel.ToString()),
                GetParameter(ParmCheckContentLevel, EDataType.Integer, info.CheckContentLevel),
                GetParameter(ParmPublishmentsystemDir, EDataType.VarChar, 50, info.PublishmentSystemDir),
                GetParameter(ParmPublishmentsystemUrl, EDataType.VarChar, 200, info.PublishmentSystemUrl),
                GetParameter(ParmIsHeadquarters, EDataType.VarChar, 18, info.IsHeadquarters.ToString()),
                GetParameter(ParmParentPublishmentsystemid, EDataType.Integer, info.ParentPublishmentSystemId),
                GetParameter(ParmTaxis, EDataType.Integer, info.Taxis),
                GetParameter(ParmSettingsXml, EDataType.NText, info.Additional.ToString()),
                GetParameter(ParmPublishmentsystemId, EDataType.Integer, info.PublishmentSystemId)
            };
            var updateParmsDetails = new IDataParameter[]
            {
                GetParameter(ParmAreaId, EDataType.Integer, info.AreaId),
                GetParameter(ParmArea, EDataType.VarChar, 255, info.Area),
                GetParameter(ParmOrganizationTypeId, EDataType.Integer, info.OrganizationTypeId),
                GetParameter(ParmTelePhone, EDataType.VarChar, 20, info.TelePhone),
                GetParameter(ParmImageUrl, EDataType.VarChar, 200, info.ImageUrl),
                GetParameter(ParmAdrress, EDataType.VarChar, 500, info.Address),
                GetParameter(ParmBasicFacts, EDataType.NText, info.BasicFacts),
                GetParameter(ParmOrganizationCategory, EDataType.Integer, info.OrganizationCategory),
                GetParameter(ParmCharacteristic, EDataType.NText, info.Characteristic),
                GetParameter(ParmAdministratorAccount, EDataType.VarChar, 50, info.AdministratorAccount),
                GetParameter(ParmOldPublishmentSystemId, EDataType.Integer, info.PublishmentSystemId),
            };

            if (info.IsHeadquarters)
            {
                UpdateAllIsHeadquarters();
            }

            ExecuteNonQuery(SqlUpdatePublishmentSystem, updateParms);
            ExecuteNonQuery(SqlUpdatePublishmentSystemDetails, updateParmsDetails);
            PublishmentSystemManager.ClearCache(true);
        }
Exemple #6
0
        public void Delete(int publishmentSystemId)
        {
            var publishmentSystemInfo = PublishmentSystemManager.GetPublishmentSystemInfo(publishmentSystemId);
            var list = DataProvider.NodeDao.GetNodeIdListByPublishmentSystemId(publishmentSystemId);

            BaiRongDataProvider.TableStyleDao.Delete(list, publishmentSystemInfo.AuxiliaryTableForContent);

            BaiRongDataProvider.TagDao.DeleteTags(publishmentSystemId);

            DataProvider.NodeDao.Delete(publishmentSystemId);

            UpdateParentPublishmentSystemIdToZero(publishmentSystemId);

            ExecuteNonQuery($"DELETE FROM siteserver_PublishmentSystem WHERE PublishmentSystemID  = {publishmentSystemId}");

            PublishmentSystemManager.ClearCache(true);
            NodeManager.RemoveCache(publishmentSystemId);
            ProductPermissionsManager.Current.ClearCache();
        }
Exemple #7
0
        public void InsertPublishmentSystemDetailsWithTrans(PublishmentSystemInfo info, IDbTransaction trans)
        {
            //获取排序值
            var taxis       = GetMaxTaxis() + 1;
            var insertParms = new IDataParameter[]
            {
                GetParameter(ParmPublishmentsystemId, EDataType.Integer, info.PublishmentSystemId),
                GetParameter(ParmArea, EDataType.VarChar, 255, info.Area),
                GetParameter(ParmOrganizationTypeId, EDataType.Integer, info.OrganizationTypeId),
                GetParameter(ParmOrganizationCategory, EDataType.Integer, info.OrganizationCategory),
                GetParameter(ParmTelePhone, EDataType.VarChar, 20, info.TelePhone),
                GetParameter(ParmAdrress, EDataType.VarChar, 500, info.Address),
                GetParameter(ParmBasicFacts, EDataType.NText, 1000, info.BasicFacts),
                GetParameter(ParmCharacteristic, EDataType.Text, 1000, info.Characteristic),
                GetParameter(ParmImageUrl, EDataType.VarChar, 200, info.ImageUrl),
                GetParameter(ParmAdministratorAccount, EDataType.VarChar, 200, info.AdministratorAccount),
            };

            ExecuteNonQuery(trans, SqlInsertPublishmentSystemDetails, insertParms);
            PublishmentSystemManager.ClearCache(true);
        }
        public void Page_Load(object sender, EventArgs e)
        {
            if (IsForbidden)
            {
                return;
            }

            if (Body.IsQueryExists("PublishmentSystemID") && (Body.IsQueryExists("Up") || Body.IsQueryExists("Down")))
            {
                var publishmentSystemId = Body.GetQueryInt("PublishmentSystemID");

                if (Body.IsQueryExists("Up") && Body.GetQueryBool("Up"))
                {
                    //上升
                    DataProvider.PublishmentSystemDao.UpdateTaxisToUp(publishmentSystemId);
                    //清楚缓存
                    PublishmentSystemManager.ClearCache(false);
                }
                else
                {
                    //下降
                    DataProvider.PublishmentSystemDao.UpdateTaxisToDown(publishmentSystemId);
                    //清楚缓存
                    PublishmentSystemManager.ClearCache(false);
                }
            }

            if (!IsPostBack)
            {
                BreadCrumbSys(AppManager.Sys.LeftMenu.Site, "系统站点管理", AppManager.Sys.Permission.SysSite);

                _hqSiteId = DataProvider.PublishmentSystemDao.GetPublishmentSystemIdByIsHeadquarters();

                dgContents.DataSource     = PublishmentSystemManager.GetPublishmentSystemIdList();
                dgContents.ItemDataBound += dgContents_ItemDataBound;
                dgContents.DataBind();
            }
        }