예제 #1
0
        public static void Check_Fields_Status(C1TopicPage Tp)
        {
            XmlNode     svfroot = mod_accueil.SVF.DocumentElement;
            XmlNode     idroot  = mod_global.Get_Codes_Id_DocElement();
            string      value   = string.Empty;
            XmlNodeList svfnodelist;
            XmlNode     idnode;

            Tp.SpecialStyle = false;

            foreach (C1TopicLink Tl in Tp.Links)
            {
                //Si le champ est obligatoire
                idnode = idroot.SelectSingleNode("/codes/code[id='" + Tl.Tag.ToString() + "']/renseigne");
                if (idnode.InnerText == "1")
                {
                    //On verifie que le champ est bien présent dans le SVF
                    svfnodelist = svfroot.SelectNodes("/inspection/ouvrage[@nom='" + mod_accueil.OUVRAGE + "']/identifications/code[id='" + Tl.Tag.ToString() + "']/valeur");
                    if (svfnodelist.Count > 0)
                    {
                        //Et que sa valeur n'est pas nulle
                        if (svfnodelist[0].InnerText == String.Empty)
                        {
                            Tp.SpecialStyle = true;
                        }
                    }
                    else
                    {
                        //Si le champ manque dans le SVF
                        Tp.SpecialStyle = true;
                    }
                }
            }
        }
예제 #2
0
파일: MainForm.cs 프로젝트: pigeon79/SMErp
        private void AddTopicBarLink(C1TopicPage tp, List <ND_MENU> menus, int parentid)
        {
            var list = from m in menus
                       where m.PARENTID == parentid
                       orderby m.SORTID
                       select m;

            foreach (ND_MENU m in list)
            {
                C1TopicLink tl = new C1TopicLink(m.MENUCAPTION);
                tl.Tag         = m;
                tl.ToolTipText = m.MENUCAPTION;
                tp.Links.Add(tl);
            }
        }
예제 #3
0
        private void BuildTopicBar()
        {
            // get list of the reports
            string fileName = @"..\..\" + c_FlexCommonTasks;

            string[] reports = C1FlexReport.GetReportList(fileName);

            // go over reports and get category from C1FlexReport.ReportInfo.Keywords
            using (C1FlexReport fr = new C1FlexReport())
            {
                List <Category> categories = new List <Category>();
                foreach (string reportName in reports)
                {
                    fr.Load(fileName, reportName);

                    string   keywords = fr.ReportInfo.Keywords;
                    string[] ss       = keywords.Split(new string[] { "\r\n" }, StringSplitOptions.None);
                    for (int i = 0; i < ss.Length; i++)
                    {
                        Category c = categories.Find((item) => string.Compare(item.Name, ss[i], true) == 0);
                        if (c == null)
                        {
                            c = new Category()
                            {
                                Name = ss[i]
                            };
                            categories.Add(c);
                        }
                        c.Reports.Add(reportName);
                    }
                }
                categories.Sort(CompareCategories);

                foreach (Category c in categories)
                {
                    // build items in the C1TopicBar
                    C1TopicPage tp = new C1TopicPage(c.Name);
                    foreach (string s in c.Reports)
                    {
                        C1TopicLink tl = new C1TopicLink(s);
                        tp.Links.Add(tl);
                    }
                    tbReports.Pages.Add(tp);
                }
            }
        }
예제 #4
0
파일: MainForm.cs 프로젝트: pigeon79/SMErp
        private void LoadTopicBar(List <ND_MENU> menus)
        {
            var list = (from m in menus
                        where m.OUTLOOKTAG == true
                        orderby m.SORTID
                        select m).ToList();

            int pageIndex = 0;

            foreach (ND_MENU m in list)
            {
                //if ((bool)m.OUTLOOKTAG) continue;
                C1TopicPage tp = new C1TopicPage(m.MENUCAPTION);
                pageIndex = this.TopicBar_Menu.Pages.Add(tp);
                AddTopicBarLink(tp, menus, m.Id);
            }
            this.TopicBar_Menu.CollapseAll();
            if (this.TopicBar_Menu.Pages.Count > 0)
            {
                this.TopicBar_Menu.Pages[0].Expand();
            }
        }
예제 #5
0
        public CommonReports()
        {
            InitializeComponent();
            C1Zoom.Target = null;

            // put C1TopicBur in the C1FlexViewer control
            tbReports.Parent = null;
            splitter1.Parent = null;

            var viewerControls = c1FlexViewer1.Controls;
            var c1             = viewerControls[0];
            var c2             = viewerControls[1];
            var c3             = viewerControls[2];

            viewerControls.Clear();

            viewerControls.Add(c1);
            viewerControls.Add(splitter1);
            viewerControls.Add(tbReports);
            viewerControls.Add(c2);
            viewerControls.Add(c3);

            // prepare the list of reports
            doc = new XmlDocument();
            doc.PreserveWhitespace = true;
            doc.LoadXml(ControlExplorer.Properties.Resources.FlexCommonTasks);

            // get the list of reports in the file
            string[] reports = C1FlexReport.GetReportList(doc);

            //
            // go over reports and get category from C1FlexReport.ReportInfo.Keywords
            using (C1FlexReport fr = new C1FlexReport())
            {
                foreach (string reportName in reports)
                {
                    fr.Load(doc, reportName);

                    string   keywords = fr.ReportInfo.Keywords;
                    string[] ss       = keywords.Split(new string[] { "\r\n" }, StringSplitOptions.None);
                    for (int i = 0; i < ss.Length; i++)
                    {
                        List <string> reps;
                        if (!categories.TryGetValue(ss[i], out reps))
                        {
                            reps = new List <string>();
                            categories.Add(ss[i], reps);
                        }
                        reps.Add(reportName);
                    }
                }

                // now categories dictionary contains list of categories and list of the reports in the each category
                // build content of the C1TopicBar
                foreach (KeyValuePair <string, List <string> > kvp in categories)
                {
                    C1TopicPage tp = new C1TopicPage(kvp.Key);
                    tp.ImageIndex = 0;
                    tp.ImageList  = imageList1;
                    foreach (string s in kvp.Value)
                    {
                        C1TopicLink tl = new C1TopicLink(s);
                        tp.Links.Add(tl);
                    }
                    tbReports.Pages.Add(tp);
                }
            }

            // add list of the reports to the ribbon

            var ribbon = c1FlexViewer1.Ribbon;

            tbMoreReports                 = new RibbonToggleButton();
            tbMoreReports.Pressed         = true;
            tbMoreReports.SmallImage      = ControlExplorer.Properties.Resources.MoreReports;
            tbMoreReports.Text            = "Reports panel";
            tbMoreReports.PressedChanged += MoreReports_PressedChanged;

            ribbon.QatItemsHolder.Insert(0, tbMoreReports);
            ribbon.Qat.Items.Insert(0, tbMoreReports);
            ribbon.Qat.MenuItems.Insert(0, tbMoreReports);

            comboReports = new RibbonComboBox();
            comboReports.GripHandleVisible     = true;
            comboReports.TextAreaWidth         = 170;
            comboReports.MaxDropDownItems      = 12;
            comboReports.DropDownStyle         = RibbonComboBoxStyle.DropDownList;
            comboReports.SelectedIndexChanged += comboReports_SelectedIndexChanged;

            var coll = comboReports.Items;

            foreach (string rn in reports)
            {
                coll.Add(new RibbonButton(rn));
            }

            ribbon.QatItemsHolder.Insert(0, comboReports);
            ribbon.Qat.ItemLinks.Insert(0, comboReports);

            var selReportLabel = new C1.Win.Ribbon.RibbonButton();

            ribbon.QatItemsHolder.Insert(0, selReportLabel);
            ribbon.Qat.ItemLinks.Insert(0, selReportLabel);
            selReportLabel.Text   = "Select Report:";
            selReportLabel.Click += selReportLabel_Click;

            report = new C1FlexReport();
        }