Пример #1
0
        public void Update(GovInteractChannelInfo channelInfo)
        {
            var parms = new IDataParameter[]
            {
                GetParameter(ParmDepartmentidCollection, EDataType.NVarChar, 255, channelInfo.DepartmentIDCollection),
                GetParameter(ParmSummary, EDataType.NVarChar, 255, channelInfo.Summary),
                GetParameter(ParmNodeId, EDataType.Integer, channelInfo.NodeID)
            };

            ExecuteNonQuery(SqlUpdate, parms);
        }
Пример #2
0
        public override void Submit_OnClick(object sender, EventArgs e)
        {
            var isChanged = false;

            try
            {
                if (_channelId == 0)
                {
                    var parentId = TranslateUtils.ToInt(ParentID.SelectedValue);
                    if (parentId == 0)
                    {
                        parentId = PublishmentSystemInfo.Additional.GovInteractNodeId;
                    }
                    var nodeId = DataProvider.NodeDao.InsertNodeInfo(PublishmentSystemId, parentId, ChannelName.Text, string.Empty, EContentModelTypeUtils.GetValue(EContentModelType.GovInteract));

                    var channelInfo = new GovInteractChannelInfo(nodeId, PublishmentSystemId, 0, 0, string.Empty, Summary.Text);

                    DataProvider.GovInteractChannelDao.Insert(channelInfo);
                }
                else
                {
                    var nodeInfo = NodeManager.GetNodeInfo(PublishmentSystemId, _channelId);
                    nodeInfo.NodeName = ChannelName.Text;
                    DataProvider.NodeDao.UpdateNodeInfo(nodeInfo);

                    var channelInfo = DataProvider.GovInteractChannelDao.GetChannelInfo(PublishmentSystemId, _channelId);
                    if (channelInfo == null)
                    {
                        channelInfo = new GovInteractChannelInfo(_channelId, PublishmentSystemId, 0, 0, string.Empty, Summary.Text);
                        DataProvider.GovInteractChannelDao.Insert(channelInfo);
                    }
                    else
                    {
                        channelInfo.Summary = Summary.Text;
                        DataProvider.GovInteractChannelDao.Update(channelInfo);
                    }
                }

                Body.AddAdminLog("维护分类信息");

                SuccessMessage("分类设置成功!");
                isChanged = true;
            }
            catch (Exception ex)
            {
                FailMessage(ex, "分类设置失败!");
            }

            if (isChanged)
            {
                PageUtils.CloseModalPageAndRedirect(Page, _returnUrl);
            }
        }
Пример #3
0
        public int GetQueryStyleId(int publishmentSystemId, int nodeId)
        {
            string sqlString = $"SELECT QueryStyleID FROM wcm_GovInteractChannel WHERE NodeID = {nodeId}";
            var    styleId   = BaiRongDataProvider.DatabaseDao.GetIntResult(sqlString);

            if (styleId == 0)
            {
                var theChannelInfo = new GovInteractChannelInfo(nodeId, publishmentSystemId, 0, 0, string.Empty, string.Empty);
                DataProvider.GovInteractChannelDao.Insert(theChannelInfo);

                styleId = BaiRongDataProvider.DatabaseDao.GetIntResult(sqlString);
            }
            return(styleId);
        }
Пример #4
0
        public void Insert(int publishmentSystemId, GovInteractPermissionsInfo permissionsInfo)
        {
            if (!DataProvider.GovInteractChannelDao.IsExists(permissionsInfo.NodeID))
            {
                var channelInfo = new GovInteractChannelInfo(permissionsInfo.NodeID, publishmentSystemId, 0, 0, string.Empty, string.Empty);
                DataProvider.GovInteractChannelDao.Insert(channelInfo);
            }
            var parms = new IDataParameter[]
            {
                GetParameter(ParmUsername, EDataType.NVarChar, 50, permissionsInfo.UserName),
                GetParameter(ParmNodeId, EDataType.Integer, permissionsInfo.NodeID),
                GetParameter(ParmPermissions, EDataType.Text, permissionsInfo.Permissions)
            };

            ExecuteNonQuery(SqlInsert, parms);
        }
        private string GetDepartmentTreeHtml(GovInteractChannelInfo channelInfo)
        {
            var htmlBuilder      = new StringBuilder();
            var departmentIdList = GovInteractManager.GetFirstDepartmentIdList(channelInfo);

            var treeDirectoryUrl = SiteServerAssets.GetIconUrl("tree");

            var theDepartmentIdArrayList = DepartmentManager.GetDepartmentIdList();
            var isLastNodeArray          = new bool[theDepartmentIdArrayList.Count];

            foreach (var theDepartmentId in theDepartmentIdArrayList)
            {
                var departmentInfo = DepartmentManager.GetDepartmentInfo(theDepartmentId);
                htmlBuilder.Append(GetTitle(departmentInfo, treeDirectoryUrl, isLastNodeArray, departmentIdList));
                htmlBuilder.Append("<br/>");
            }
            return(htmlBuilder.ToString());
        }
Пример #6
0
        public void Insert(GovInteractChannelInfo channelInfo)
        {
            channelInfo.ApplyStyleID = DataProvider.TagStyleDao.Insert(new TagStyleInfo(0, channelInfo.NodeID.ToString(), StlGovInteractApply.ElementName, channelInfo.PublishmentSystemID, false, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty));
            channelInfo.QueryStyleID = DataProvider.TagStyleDao.Insert(new TagStyleInfo(0, channelInfo.NodeID.ToString(), StlGovInteractQuery.ElementName, channelInfo.PublishmentSystemID, false, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty));

            var parms = new IDataParameter[]
            {
                GetParameter(ParmNodeId, EDataType.Integer, channelInfo.NodeID),
                GetParameter(ParmPublishmentsystemid, EDataType.Integer, channelInfo.PublishmentSystemID),
                GetParameter(ParmApplyStyleId, EDataType.Integer, channelInfo.ApplyStyleID),
                GetParameter(ParmQueryStyleId, EDataType.Integer, channelInfo.QueryStyleID),
                GetParameter(ParmDepartmentidCollection, EDataType.NVarChar, 255, channelInfo.DepartmentIDCollection),
                GetParameter(ParmSummary, EDataType.NVarChar, 255, channelInfo.Summary)
            };

            ExecuteNonQuery(SqlInsert, parms);

            GovInteractManager.AddDefaultTypeInfos(channelInfo.PublishmentSystemID, channelInfo.NodeID);
        }
Пример #7
0
        public GovInteractChannelInfo GetChannelInfo(int publishmentSystemId, int nodeId)
        {
            GovInteractChannelInfo channelInfo = null;

            var parms = new IDataParameter[]
            {
                GetParameter(ParmNodeId, EDataType.Integer, nodeId)
            };

            using (var rdr = ExecuteReader(SqlSelect, parms))
            {
                if (rdr.Read())
                {
                    var i = 0;
                    channelInfo = new GovInteractChannelInfo(GetInt(rdr, i++), GetInt(rdr, i++), GetInt(rdr, i++), GetInt(rdr, i++), GetString(rdr, i++), GetString(rdr, i));
                }
                rdr.Close();
            }

            if (channelInfo == null)
            {
                var theChannelInfo = new GovInteractChannelInfo(nodeId, publishmentSystemId, 0, 0, string.Empty, string.Empty);
                DataProvider.GovInteractChannelDao.Insert(theChannelInfo);

                using (var rdr = ExecuteReader(SqlSelect, parms))
                {
                    if (rdr.Read())
                    {
                        var i = 0;
                        channelInfo = new GovInteractChannelInfo(GetInt(rdr, i++), GetInt(rdr, i++), GetInt(rdr, i++), GetInt(rdr, i++), GetString(rdr, i++), GetString(rdr, i));
                    }
                    rdr.Close();
                }
            }

            return(channelInfo);
        }
Пример #8
0
 public static List <int> GetFirstDepartmentIdList(GovInteractChannelInfo channelInfo)
 {
     return(string.IsNullOrEmpty(channelInfo?.DepartmentIDCollection) ? BaiRongDataProvider.DepartmentDao.GetDepartmentIdListByParentId(0) : BaiRongDataProvider.DepartmentDao.GetDepartmentIdListByDepartmentIdCollection(channelInfo.DepartmentIDCollection));
 }