示例#1
0
        public void NewQueryLoadDataTest()
        {
            var avrMainForm = new AvrMainForm();
            var args        = new AvrTreeSelectedElementEventArgs(BaseReportTests.QueryId, -1, null, -1, AvrTreeElementType.Query);

            avrMainForm.OpenEditor(args, true);
            avrMainForm.Dispose();
        }
示例#2
0
        public void NewLayoutLoadDataTest()
        {
            //PresenterFactory.Init(new BaseForm());

            var avrMainForm = new AvrMainForm();
            var args        = new AvrTreeSelectedElementEventArgs(BaseReportTests.QueryId, -1, BaseReportTests.QueryId, -1,
                                                                  AvrTreeElementType.Layout);

            avrMainForm.OpenEditor(args, true);

            avrMainForm.Dispose();
        }
示例#3
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);
            }
        }