Beispiel #1
0
        internal static void GetLayoutDetailControls
            (LayoutDetailPanel layoutDetail, out PivotDetailPanel pivotForm,
            out MapDetailPanel mapForm, out ChartDetailPanel chartForm)
        {
            pivotForm = null;
            mapForm   = null;
            chartForm = null;

            foreach (IRelatedObject child in layoutDetail.Children)
            {
                if (child is PivotDetailPanel)
                {
                    pivotForm = child as PivotDetailPanel;
                }
                if (child is MapDetailPanel)
                {
                    mapForm = child as MapDetailPanel;
                }
                if (child is ChartDetailPanel)
                {
                    chartForm = child as ChartDetailPanel;
                }
            }
            Assert.IsNotNull(pivotForm);
            Assert.IsNotNull(mapForm);
            Assert.IsNotNull(chartForm);
        }
Beispiel #2
0
        internal static LayoutDetailPanel CreateLayoutControls(out AvrMainForm avrMainForm)
        {
            avrMainForm = new AvrMainForm();

            LayoutDetailPanel layoutDetail = null;

            foreach (IRelatedObject child in avrMainForm.Children)
            {
                if (child is LayoutDetailPanel)
                {
                    layoutDetail = child as LayoutDetailPanel;
                }
            }

            Assert.IsNull(layoutDetail);

            avrMainForm.InitLayoutDetail(true);
            foreach (IRelatedObject child in avrMainForm.Children)
            {
                if (child is LayoutDetailPanel)
                {
                    layoutDetail = child as LayoutDetailPanel;
                }
            }
            Assert.IsNotNull(layoutDetail);
            return(layoutDetail);
        }
Beispiel #3
0
        internal static PivotDetailPanel GetLayoutDetailControls(LayoutDetailPanel layoutDetail)
        {
            PivotDetailPanel pivotForm;

            MapDetailPanel   mapForm;
            ChartDetailPanel chartForm;

            GetLayoutDetailControls(layoutDetail, out pivotForm, out mapForm, out chartForm);
            return(pivotForm);
        }
Beispiel #4
0
        public void LayoutBindingTest()
        {
            AvrMainForm       avrMainForm;
            LayoutDetailPanel layoutDetail = ViewHelper.CreateLayoutControls(out avrMainForm);

            object id = -1;

            layoutDetail.LoadData(ref id);

            avrMainForm.Dispose();
        }
Beispiel #5
0
        public static long LayoutFormSave()
        {
            using (new CultureInfoTransaction(new CultureInfo("ru-RU")))
            {
                AvrMainForm avrMainForm;
                ViewHelper.CreateLayoutControls(out avrMainForm);
                var newLayoutArgs = new AvrTreeSelectedElementEventArgs(BaseReportTests.QueryId, -1, BaseReportTests.QueryId, -1,
                                                                        AvrTreeElementType.Layout);
                avrMainForm.OpenEditor(newLayoutArgs, true);

                LayoutDetailPanel layoutDetail = null;
                foreach (IRelatedObject child in avrMainForm.Children)
                {
                    if (child is LayoutDetailPanel)
                    {
                        layoutDetail = child as LayoutDetailPanel;
                    }
                }
                Assert.IsNotNull(layoutDetail);
                Assert.IsNotNull(layoutDetail.baseDataSet);

                string  defaultLayoutName = "Some layout_" + Guid.NewGuid();
                string  layoutName        = "Russian layout_" + Guid.NewGuid();
                string  description       = "Description " + Guid.NewGuid();
                DataRow dataRow           = layoutDetail.baseDataSet.Tables["Layout"].Rows[0];

                BindLayoutDataTable(layoutDetail, dataRow, defaultLayoutName, layoutName, description, true, 10039002);

                layoutDetail.LayoutPost();
                Assert.IsTrue(avrMainForm.ForcePost(), "Layout could not be posted: " + avrMainForm.DbService.LastError);

                var layoutId = (long)dataRow["idflLayout"];
                Assert.IsTrue(layoutId > -1);

                avrMainForm.Dispose();

                return(layoutId);
            }
        }