Пример #1
0
        private void getItemsForPublish()
        {
            if (nodeInfo.Count == 0)
            {
                return;
            }
            DataTable dt = new DataTable();

            dt.Columns.Add("type", typeof(string));
            dt.Columns.Add("nodeID", typeof(int));
            dt.Columns.Add("filename", typeof(string));
            dt.Columns.Add("title", typeof(string));
            dt.Columns.Add("modifiedBy", typeof(string));
            dt.Columns.Add("dateModified", typeof(DateTime));

            foreach (DictionaryEntry de in nodeInfo)
            {
                publishNodeInfo pni = (publishNodeInfo)de.Value;
                DataSet         ds  = SFGlobal.DAL.execDataSet(pni.SelectSP, null);
                foreach (DataRow dr in ds.Tables[0].Rows)
                {
                    dt.Rows.Add(new object[] { pni.Name, (int)dr["nodeID"], dr["filename"].ToString(), dr["title"].ToString(), dr["username"].ToString(), (DateTime)dr["dateModified"] });
                }
            }
            dt.DefaultView.Sort  = "dateModified DESC";
            itemsGrid.DataSource = dt.DefaultView;
            itemsGrid.DataBind();

            if (dt.Rows.Count == 0)
            {
                itemsGrid.Visible = false;
            }
        }
Пример #2
0
        private HybridDictionary getNodeInfo(string xmlFile)
        {
            HybridDictionary hd = new HybridDictionary();
            XmlDocument      xd = new XmlDocument();

            try
            {
                xd.Load(xmlFile);
                foreach (XmlNode xn in xd["nodeTypes"])
                {
                    if (xn.Attributes["publishSP"] != null && xn.Attributes["selectSP"] != null)
                    {
                        publishNodeInfo pni = new publishNodeInfo();
                        pni.Name      = xn.Attributes["name"].Value;
                        pni.PublishSP = xn.Attributes["publishSP"].Value;
                        pni.SelectSP  = xn.Attributes["selectSP"].Value;
                        hd.Add(pni.Name, pni);
                    }
                }
            }
            catch (Exception e)
            {
                throw new DuryTools.ErrorHandler("can't read xml..." + xmlFile, e);
            }
            return(hd);
        }
Пример #3
0
        private void publishItems()
        {
            string s = "";

            // first publish the nodes
            SFGlobal.DAL.execNonQuery("publishNodes", null);
            s += "published nodes<br>";

            // now publish what we want...
            foreach (ListItem li in nodesToPublish.Items)
            {
                if (li.Selected)
                {
                    publishNodeInfo pni = (publishNodeInfo)nodeInfo[li.Value];
                    SFGlobal.DAL.execNonQuery(pni.PublishSP, null);
                    s += "published " + pni.Name + "<BR>";
                }
            }
            SFGlobal.UpdateNodes();
            getItemsForPublish();
            results.Text = s;
        }