public void CommmonTest()
        {
            //AppForm form = new AppForm();
            //var tab = new AppFormTab();
            //var section = new AppFormSection();
            //var item = new AppFormItem();
            //item.Options = new List<SelectOption>();
            //SelectOption so1 = new SelectOption();
            //so1.Value = "1";
            //so1.Text = "yes ";
            //SelectOption so2 = new SelectOption();
            //so2.Value = "0";
            //so2.Text = "no ";
            //item.Options.Add(so1);
            //item.Options.Add(so2);
            //section.Items.Add(item);
            //tab.Sections.Add(section);
            //form.Tabs.Add(tab);

            //var formXml = XmlHelper.XmlSerialize(form);
            System.Threading.Thread.Sleep(100000);

            DbAccessManager.Init("Server=wh-pc066;database=dotnet_erp302sp1_scxxw;user id=sa;password=95938");
            MapPage    page       = GetPage();
            PageResult pageresult = AppValidationManager.ValidatePage(page);

            foreach (Result result in pageresult.Results)
            {
                Debug.WriteLine(string.Format("Level: {0}, Title: {1}, Message: {2}", result.Level, result.Title, result.Message));
            }
        }
Beispiel #2
0
        /// <summary>
        /// 执行检测
        /// </summary>
        /// <param name="filepath"></param>
        /// <param name="xml"></param>
        /// <returns></returns>
        private PageResult Run(string filepath, string xml)
        {
            MapPage page = GetEntity(filepath, xml);

            if (page == null)
            {
                return(null);
            }

            page.PageXml = filepath;

            using (ConnectionScope scope = new ConnectionScope(TransactionMode.Inherits, AppConfigManager.ConnectionString))
            {
                if (AppConfigManager.Setting.Db.CanAccess)
                {
                    DbAccessManager.Reset();
                }
                return(AppValidationManager.ValidatePage(page));
            }
        }