Exemple #1
0
 private void loadLabels()
 {
     Console.WriteLine("loading labels");
     d.ContentLabelData ld = new d.ContentLabelData();
     ld.Create("news (admin label)", 1);
     ld.Create("foundation info (admin label)", 1);
     ld.Create("announcements (admin label)", 1);
 }
Exemple #2
0
        private void loadImageLabels()
        {
            Console.WriteLine("loading image labels");
            d.FileContentLabelData fl = new d.FileContentLabelData();
            DataTable dtFiles         = new d.FileData().GetImages("f.id").Tables[0];
            DataTable dtLabels        = new d.ContentLabelData().GetList();
            int       fileId;
            int       labelId;
            int       labelsToAdd;
            int       totalLabels = dtLabels.Rows.Count;

            foreach (DataRow dr in dtFiles.Rows)
            {
                fileId      = Convert.ToInt32(dr[0]);
                labelsToAdd = rnd.Next(totalLabels + 1);
                for (int i = 0; i < labelsToAdd; i++)
                {
                    labelId = Convert.ToInt32(dtLabels.Rows[rnd.Next(totalLabels)][0]);
                    fl.AddLink(fileId, labelId);
                }
            }
        }
Exemple #3
0
        private void loadPageLabels()
        {
            Console.WriteLine("loading page labels");
            d.PageContentLabelData pl = new d.PageContentLabelData();
            DataTable dtPages         = new d.PageData().GetList();
            DataTable dtLabels        = new d.ContentLabelData().GetList();
            int       pageId;
            int       labelId;
            int       labelsToAdd;
            int       totalLabels = dtLabels.Rows.Count;

            foreach (DataRow dr in dtPages.Rows)
            {
                pageId      = Convert.ToInt32(dr[0]);
                labelsToAdd = rnd.Next(totalLabels + 1);
                for (int i = 0; i < labelsToAdd; i++)
                {
                    labelId = Convert.ToInt32(dtLabels.Rows[rnd.Next(totalLabels)][0]);
                    pl.AddLink(pageId, labelId);
                }
            }
        }