private void wizardControl_NextClick(object sender, WizardCommandButtonClickEventArgs e)
        {
            if (e.Page == importFileWizardPage)
            {
                // If this is a filegroup-less XLS file, skip the file group
                // page completely.
                if (fileGroupsListBox.Items.Count <= 0)
                {
                    e.Handled = true;
                    wizardControl.SelectedPage = languagesWizardPage;
                }
                else
                {
                    e.Handled = true;
                    wizardControl.SelectedPage = fileGroupsWizardPage;
                }
            }
            else if (e.Page == languagesWizardPage)
            {
                e.Handled = true;
                wizardControl.SelectedPage = progressWizardPage;

                doImport();
            }
        }
Ejemplo n.º 2
0
 private void wcImport_NextClick(object sender, WizardCommandButtonClickEventArgs e)
 {
     this.m_Success = 0;
     this.m_Error   = 0;
     if (e.Page == this.wpSelectFile)
     {
         if (this.txtFilePath.Text != "")
         {
             this.FillSheet();
         }
         else
         {
             XtraMessageBox.Show("Vui l\x00f2ng chọn đường dẫn đến tập tin dữ liệu!", "Th\x00f4ng B\x00e1o", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
         }
     }
     else if (e.Page == this.wpSelectField)
     {
         if (!this.m_IsFieldFull)
         {
             XtraMessageBox.Show("Vui l\x00f2ng chọn đầy đủ th\x00f4ng tin cho c\x00e1c trường!", "Th\x00f4ng B\x00e1o");
         }
         else
         {
             this.wcImport.SelectedPage = this.wpProcessPage;
             this.Refresh();
             this.CreateNullMessage();
             this.Import();
             this.RaiseSuccessEventHander();
         }
     }
 }
Ejemplo n.º 3
0
        private void ValidateTaskSetting(WizardCommandButtonClickEventArgs e)
        {
            wpComplete.FinishText = "完成";
            memoRemark.Text       = "";
            //循环datagrid来创建和执行不同的任务
            for (int i = 0; i < gridViewCheckSetting.RowCount; i++)
            {
                if (i > 0)
                {
                    memoRemark.Text += "---------------------------------------------\r\n";
                }
                memoRemark.Text += string.Format("任务名称:{0}\r\n", gridViewCheckSetting.GetRowCellValue(i, gridViewCheckSetting.Columns["TaskName"]).ToString());
                memoRemark.Text += string.Format("数据目录:{0}\r\n", gridViewCheckSetting.GetRowCellValue(i, gridViewCheckSetting.Columns["Datasource"]).ToString());
                memoRemark.Text += string.Format("数据类型:{0}\r\n", ((enumDataType)gridViewCheckSetting.GetRowCellValue(i, gridViewCheckSetting.Columns["DataType"])).ToString());
                memoRemark.Text +=
                    string.Format("任务目录:{0}\r\n", gridViewCheckSetting.GetRowCellValue(i, gridViewCheckSetting.Columns["TaskPath"]).ToString());

                memoRemark.Text += string.Format("比例尺:\t1:{0}\r\n", gridViewCheckSetting.GetRowCellValue(i, gridViewCheckSetting.Columns["MapScale"]).ToString());
                memoRemark.Text += string.Format("拓扑容限:{0})\r\n", gridViewCheckSetting.GetRowCellValue(i, gridViewCheckSetting.Columns["TopoTolerance"]).ToString());

                memoRemark.Text += string.Format("检查单位:{0}\r\n", "");
                memoRemark.Text += string.Format("检查人:\t{0}\r\n", "");
                memoRemark.Text += string.Format("检查时间:{0}\r\n", DateTime.Now.ToString());
                //memoRemark.Text += string.Format("备注:\t\t{0}\r\n", "");
                memoRemark.Text += string.Format("检查方式:{0}\r\n\r\n", gridViewCheckSetting.GetRowCellValue(i, gridViewCheckSetting.Columns["CheckMode"]));
            }
        }
Ejemplo n.º 4
0
 private void wizardControl_PrevClick(
     object sender,
     WizardCommandButtonClickEventArgs e)
 {
     if (e.Page == errorOccurredWizardPage)
     {
         wizardControl.SelectedPage = sendWithZetaUploaderWizardPage;
         e.Handled = true;
     }
 }
Ejemplo n.º 5
0
        private void wizardControl_NextClick(
            object sender,
            WizardCommandButtonClickEventArgs e)
        {
            if (e.Page == sendWithZetaUploaderWizardPage)
            {
                e.Handled = true;
                wizardControl.SelectedPage = progressWizardPage;

                doExport();
            }
        }
        private void wizardControl_NextClick(
            object sender,
            WizardCommandButtonClickEventArgs e)
        {
            if (e.Page == receiversWizardPage)
            {
                if (!saveProject())
                {
                    // Stay on same page.
                    e.Handled = true;
                }
                else
                {
                    e.Handled = true;
                    wizardControl.SelectedPage = progressWizardPage;

                    doExport();
                }
            }
        }
Ejemplo n.º 7
0
 /// <summary>
 /// Fires after the next button has been clicked
 /// </summary>
 /// <param name="sender">Wizard Control</param>
 /// <param name="e">WizardCommandButtonClick EventArgs</param>
 private void WizardControl_NextClick(object sender, WizardCommandButtonClickEventArgs e)
 {
     e.Handled = !Validate(e.Page as XafWizardPage);
 }
Ejemplo n.º 8
0
        /// <summary>
        /// 必要参数验证
        /// </summary>
        /// <returns></returns>
        private void ValidatePrimaryArgs(WizardCommandButtonClickEventArgs e)
        {
            // 验证
            bool flag = true;
            if (cmbStandard.SelectedIndex < 0)
            {
                dxErrorProvider.SetError(cmbStandard, "必须选择任务标准");
                flag = false;
            }
            else if (cmbSchema.Properties.Items.Count == 0)
            {
                dxErrorProvider.SetError(cmbStandard, "当前任务标准下没有配置检查方案");
                flag = false;
            }

            if (cmbSchema.SelectedIndex < 0)
            {
                dxErrorProvider.SetError(cmbSchema, "必须选择检查方案");
                flag = false;
            }

            e.Handled = !flag;

            // 生成下页数据
            gridViewCheckSetting.Columns.Clear();
            GridCheckSetting.DataSource = null;
            GridCheckSetting.Refresh();
            DataTable pTasksDt = this.GenerateGridSource(txtTaskPath.Text,double.Parse(txtTopoTolerance.Text),m_MapScales[ cmbScale.SelectedIndex]);// CBatchTasksApi.GetTasksDtatTable(BatchTaskType, BtnEditDCCG.Text, BtnEditZJCGSCML.Text);
            if (pTasksDt != null || pTasksDt.Rows.Count > 0)
            {

                GridCheckSetting.DataSource = pTasksDt;
                GridCheckSetting.RefreshDataSource();
                //gridViewCheckSetting.BestFitColumns();
                gridViewCheckSetting.RefreshData();
                GridCheckSetting.Refresh();
                //设置grid的属性
                //gridViewCheckSetting.OptionsBehavior.Editable = false;
                //gridViewCheckSetting.Columns["TaskName"].Visible = false;
                GridCheckSetting.RepositoryItems.Add(m_RepTxtDatasource);
                GridCheckSetting.RepositoryItems.Add(m_RepCmbTaskPath);
                GridCheckSetting.RepositoryItems.Add(m_RepCmbMapScale);
                GridCheckSetting.RepositoryItems.Add(m_RepCmbCheckType);
                //在点击button时弹出目录选择对话框
                //gridViewCheckSetting.Columns["Datasource"].ColumnEdit = m_RepTxtDatasource;
                gridViewCheckSetting.Columns["Datasource"].Visible = false;
                gridViewCheckSetting.Columns["TaskPath"].ColumnEdit = m_RepCmbTaskPath;
                //在点击修改比例尺大小时。弹出combox对话框进行选择
                gridViewCheckSetting.Columns["MapScale"].ColumnEdit = m_RepCmbMapScale;
                gridViewCheckSetting.Columns["MapScale"].DisplayFormat.FormatType = DevExpress.Utils.FormatType.Custom;
                gridViewCheckSetting.Columns["MapScale"].DisplayFormat.FormatString = "1:{0}";

                //在点击检查方式时,弹出选择检查规则的对话框
                gridViewCheckSetting.Columns["CheckMode"].ColumnEdit = m_RepCmbCheckType;
                gridViewCheckSetting.Columns["Hy.Check.Rules"].Visible = false;
                gridViewCheckSetting.Columns["DataType"].Visible = false;
            }
            else
            {
                this.wpTaskSetting.AllowNext = false;
            }
        }
Ejemplo n.º 9
0
 /// <summary>
 /// Fires after the next button has been clicked
 /// </summary>
 /// <param name="sender">Wizard Control</param>
 /// <param name="e">WizardCommandButtonClick EventArgs</param>
 private void WizardControl_NextClick(object sender, WizardCommandButtonClickEventArgs e) {
     e.Handled = !Validate(e.Page as XafWizardPage);
 }
Ejemplo n.º 10
0
        /// <summary>
        /// Fires after the next button has been clicked
        /// </summary>
        /// <param name="sender">Wizard Control</param>
        /// <param name="e">WizardCommandButtonClick EventArgs</param>
        private void WizardControl_NextClick(object sender, WizardCommandButtonClickEventArgs e)
        {
            RuleValidationResult result;
            var validationResults = new RuleSetValidationResult();
            var usedProperties = new List<string>();
            var resultsHighlightControllers = new List<ResultsHighlightController> { Frame.GetController<ResultsHighlightController>() };

            foreach (var item in ((XafWizardPage)e.Page).View.GetItems<PropertyEditor>())
            {
                if (item.Control != null && ((Control)item.Control).Visible)
                {
                    usedProperties.Add(item.PropertyName);
                    if (item is ListPropertyEditor)
                    {
                        usedProperties.AddRange(((ListPropertyEditor)item).ListView.Editor.RequiredProperties.Select(property => property.TrimEnd('!')));

                        var nestedController = ((ListPropertyEditor)item).Frame.GetController<ResultsHighlightController>();
                        if (nestedController != null)
                        {
                            resultsHighlightControllers.Add(nestedController);
                        }
                    }
                }
            }

            foreach (var obj in ObjectSpace.ModifiedObjects)
            {
                IList<IRule> rules = Validator.RuleSet.GetRules(obj, ContextIdentifier.Save);
                foreach (IRule rule in rules)
                {
                    bool ruleInUse = rule.UsedProperties.Any(property => usedProperties.Contains(property) || !string.IsNullOrEmpty(usedProperties.Where(p => p.EndsWith(String.Format(".{0}", property))).FirstOrDefault()));

                    string reason;
                    if (ruleInUse && RuleSet.NeedToValidateRule(rule, obj, out reason))
                    {
                        result = rule.Validate(obj);

                        if (result.State == ValidationState.Invalid)
                        {
                            validationResults.AddResult(new RuleSetValidationResultItem(obj, ContextIdentifier.Save, rule, result));
                        }
                    }
                }
            }

            foreach (ResultsHighlightController resultsHighlightController in resultsHighlightControllers)
            {
                resultsHighlightController.ClearHighlighting();
                if (validationResults.State == ValidationState.Invalid)
                {
                    resultsHighlightController.HighlightResults(validationResults);
                }
            }

            if (validationResults.State == ValidationState.Invalid)
            {
                e.Handled = true;
            }
        }
Ejemplo n.º 11
0
        private void wizardControl_NextClick(
            object sender,
            WizardCommandButtonClickEventArgs e)
        {
            if (e.Page == optionsWizardPage)
            {
                e.Handled = true;
                wizardControl.SelectedPage = progressWizardPage;

                doExport();
            }
        }
Ejemplo n.º 12
0
        /// <summary>
        /// 必要参数验证
        /// </summary>
        /// <returns></returns>
        private void ValidatePrimaryArgs(WizardCommandButtonClickEventArgs e)
        {
            // 验证
            bool flag = true;

            if (cmbStandard.SelectedIndex < 0)
            {
                dxErrorProvider.SetError(cmbStandard, "必须选择任务标准");
                flag = false;
            }
            else if (cmbSchema.Properties.Items.Count == 0)
            {
                dxErrorProvider.SetError(cmbStandard, "当前任务标准下没有配置检查方案");
                flag = false;
            }

            if (cmbSchema.SelectedIndex < 0)
            {
                dxErrorProvider.SetError(cmbSchema, "必须选择检查方案");
                flag = false;
            }

            e.Handled = !flag;

            // 生成下页数据
            gridViewCheckSetting.Columns.Clear();
            GridCheckSetting.DataSource = null;
            GridCheckSetting.Refresh();
            DataTable pTasksDt = this.GenerateGridSource(txtTaskPath.Text, double.Parse(txtTopoTolerance.Text), m_MapScales[cmbScale.SelectedIndex]);// CBatchTasksApi.GetTasksDtatTable(BatchTaskType, BtnEditDCCG.Text, BtnEditZJCGSCML.Text);

            if (pTasksDt != null || pTasksDt.Rows.Count > 0)
            {
                GridCheckSetting.DataSource = pTasksDt;
                GridCheckSetting.RefreshDataSource();
                //gridViewCheckSetting.BestFitColumns();
                gridViewCheckSetting.RefreshData();
                GridCheckSetting.Refresh();
                //设置grid的属性
                //gridViewCheckSetting.OptionsBehavior.Editable = false;
                //gridViewCheckSetting.Columns["TaskName"].Visible = false;
                GridCheckSetting.RepositoryItems.Add(m_RepTxtDatasource);
                GridCheckSetting.RepositoryItems.Add(m_RepCmbTaskPath);
                GridCheckSetting.RepositoryItems.Add(m_RepCmbMapScale);
                GridCheckSetting.RepositoryItems.Add(m_RepCmbCheckType);
                //在点击button时弹出目录选择对话框
                //gridViewCheckSetting.Columns["Datasource"].ColumnEdit = m_RepTxtDatasource;
                gridViewCheckSetting.Columns["Datasource"].Visible  = false;
                gridViewCheckSetting.Columns["TaskPath"].ColumnEdit = m_RepCmbTaskPath;
                //在点击修改比例尺大小时。弹出combox对话框进行选择
                gridViewCheckSetting.Columns["MapScale"].ColumnEdit = m_RepCmbMapScale;
                gridViewCheckSetting.Columns["MapScale"].DisplayFormat.FormatType   = DevExpress.Utils.FormatType.Custom;
                gridViewCheckSetting.Columns["MapScale"].DisplayFormat.FormatString = "1:{0}";

                //在点击检查方式时,弹出选择检查规则的对话框
                gridViewCheckSetting.Columns["CheckMode"].ColumnEdit   = m_RepCmbCheckType;
                gridViewCheckSetting.Columns["Hy.Check.Rules"].Visible = false;
                gridViewCheckSetting.Columns["DataType"].Visible       = false;
            }
            else
            {
                this.wpTaskSetting.AllowNext = false;
            }
        }
Ejemplo n.º 13
0
 private void ValidatePath(WizardCommandButtonClickEventArgs e)
 {
 }
Ejemplo n.º 14
0
        private void ValidateTaskSetting(WizardCommandButtonClickEventArgs e)
        {
            wpComplete.FinishText = "完成";
            memoRemark.Text = "";
            //循环datagrid来创建和执行不同的任务
            for (int i = 0; i < gridViewCheckSetting.RowCount; i++)
            {
                if (i > 0)
                {
                    memoRemark.Text += "---------------------------------------------\r\n";
                }
                memoRemark.Text += string.Format("任务名称:{0}\r\n", gridViewCheckSetting.GetRowCellValue(i, gridViewCheckSetting.Columns["TaskName"]).ToString());
                memoRemark.Text += string.Format("数据目录:{0}\r\n", gridViewCheckSetting.GetRowCellValue(i, gridViewCheckSetting.Columns["Datasource"]).ToString());
                memoRemark.Text += string.Format("数据类型:{0}\r\n", ((enumDataType)gridViewCheckSetting.GetRowCellValue(i, gridViewCheckSetting.Columns["DataType"])).ToString());
                memoRemark.Text +=
                    string.Format("任务目录:{0}\r\n", gridViewCheckSetting.GetRowCellValue(i, gridViewCheckSetting.Columns["TaskPath"]).ToString());

                memoRemark.Text += string.Format("比例尺:\t1:{0}\r\n", gridViewCheckSetting.GetRowCellValue(i, gridViewCheckSetting.Columns["MapScale"]).ToString());
                memoRemark.Text += string.Format("拓扑容限:{0})\r\n", gridViewCheckSetting.GetRowCellValue(i, gridViewCheckSetting.Columns["TopoTolerance"]).ToString());

                memoRemark.Text += string.Format("检查单位:{0}\r\n", "");
                memoRemark.Text += string.Format("检查人:\t{0}\r\n", "");
                memoRemark.Text += string.Format("检查时间:{0}\r\n", DateTime.Now.ToString());
                //memoRemark.Text += string.Format("备注:\t\t{0}\r\n", "");
                memoRemark.Text += string.Format("检查方式:{0}\r\n\r\n", gridViewCheckSetting.GetRowCellValue(i, gridViewCheckSetting.Columns["CheckMode"]));
            }
        }
 private void wizardControl_PrevClick(object sender, WizardCommandButtonClickEventArgs e)
 {
     if (e.Page == languagesWizardPage)
     {
         // If this is a filegroup-less XLS file, skip the file group
         // page completely.
         if (fileGroupsListBox.Items.Count <= 0)
         {
             e.Handled = true;
             wizardControl.SelectedPage = importFileWizardPage;
         }
         else
         {
             e.Handled = true;
             wizardControl.SelectedPage = fileGroupsWizardPage;
         }
     }
     else if (e.Page == errorOccurredWizardPage)
     {
         wizardControl.SelectedPage = languagesWizardPage;
         e.Handled = true;
     }
 }
Ejemplo n.º 16
0
        private void importWizardControl_NextClick(object sender, WizardCommandButtonClickEventArgs e)
        {
            if (e.Page == importWizard.ImportModeWizardPage)
            {
                //...
            }

            if (e.Page == importWizard.NewPatientWizardPage)
            {
                //...
            }
        }
		private void wizardControl_NextClick(
			object sender,
			WizardCommandButtonClickEventArgs e)
		{
			if (e.Page == receiversWizardPage)
			{
				if (!saveProject())
				{
					// Stay on same page.
					e.Handled = true;
				}
				else
				{
					e.Handled = true;
					wizardControl.SelectedPage = progressWizardPage;

					doExport();
				}
			}
		}
Ejemplo n.º 18
0
        private async void wizardControl1_NextClick(object sender, WizardCommandButtonClickEventArgs e)
        {
            if (e.Page == welcomeWizardPage)
            {
                wpPreviewPackSiemens.Enabled = false;
                rtbPreviewLoad.Text = string.Empty;
                var logger = new Logger();
                SiemensProject project = null;

                var task = new Task(() => { project = Controller.LoadStructureSiemens(btnPath.Text, logger); });

                waitPanel.Visible = true;
                wpPreviewPackSiemens.AllowNext = false;
                wpPreviewPackSiemens.AllowBack = false;
                wpPreviewPackSiemens.AllowCancel = false;

                task.Start();
                await task;

                waitPanel.Visible = false;
                wpPreviewPackSiemens.AllowBack = true;
                wpPreviewPackSiemens.AllowCancel = true;

                wpPreviewPackSiemens.Enabled = true;

                foreach (var mess in logger.Messages)
                {
                    rtbPreviewLoad.AppendText(string.Format("{0}\n\r", mess));
                }

                if (!logger.ErrorHappens)
                {
                    _project = project;
                    wpPreviewPackSiemens.AllowNext = true;
                    rtbPreviewLoad.Text += rtbPreviewLoad.Text.Length == 0 ? "Загрузка прошла успешно, ошибок нет!\nМожно переходить к следующему этапу." : "Есть предупреждения. Переходите к следующему этапу, если вы игнорируете их.";
                }
            }

            if (e.Page == wpPreviewPackSiemens)
            {

                wpConvertedDataView.AllowNext = false;
                wpConvertedDataView.AllowBack = false;
                wpConvertedDataView.AllowCancel = false;
                waitPanelConversion.Visible = true;

                var logger = new Logger();
                var task = new Task(() => { _storage = Controller.ConvertSiemensToDrawings(_project, logger); });

                task.Start();
                await task;

                waitPanelConversion.Visible = false;
                if (_storage != null)
                {
                    tlDarwings.DataSource = _storage.Drawings;
                }

                lbMessages.DataSource = logger.Messages.Select(mess => new MessageListBox() { Tag = mess.Tag, Message = mess.Message }).ToList();

                waitPanelConversion.Visible = false;
                wpConvertedDataView.AllowNext = true;
                wpConvertedDataView.AllowBack = true;
                wpConvertedDataView.AllowCancel = true;
                SetVisibleLevelsLine();
            }
        }
		private void wizardControl_PrevClick(
			object sender,
			WizardCommandButtonClickEventArgs e)
		{
			if (e.Page == errorOccurredWizardPage)
			{
				wizardControl.SelectedPage = receiversWizardPage;
				e.Handled = true;
			}
		}
Ejemplo n.º 20
0
        /// <summary>
        /// Fires after the next button has been clicked
        /// </summary>
        /// <param name="sender">Wizard Control</param>
        /// <param name="e">WizardCommandButtonClick EventArgs</param>
        private void WizardControl_NextClick(object sender, WizardCommandButtonClickEventArgs e){
            RuleValidationResult result;
            var validationResults = new RuleSetValidationResult();
            var usedProperties = new List<string>();
            var resultsHighlightControllers = new List<ResultsHighlightController>
                                              {Frame.GetController<ResultsHighlightController>()};

            foreach (PropertyEditor item in ((XafWizardPage) e.Page).View.GetItems<PropertyEditor>()){
                if (((Control) item.Control).Visible){
                    usedProperties.Add(item.PropertyName);
                    if (item is ListPropertyEditor){
                        foreach (string property in ((ListPropertyEditor) item).ListView.Editor.RequiredProperties){
                            usedProperties.Add(property.TrimEnd('!'));
                        }

                        var nestedController =
                            ((ListPropertyEditor) item).Frame.GetController<ResultsHighlightController>();
                        if (nestedController != null){
                            resultsHighlightControllers.Add(nestedController);
                        }
                    }
                }
            }

            foreach (object obj in ObjectSpace.ModifiedObjects){
                IList<IRule> rules = Validator.RuleSet.GetRules(obj, ContextIdentifier.Save);
                foreach (IRule rule in rules){
                    bool ruleInUse = false;
                    foreach (string property in rule.UsedProperties){
                        if (usedProperties.Contains(property)){
                            ruleInUse = true;
                            break;
                        }
                    }

                    if (ruleInUse){
                        result = rule.Validate(obj);
                        if (result.State == ValidationState.Invalid){
                            validationResults.AddResult(new RuleSetValidationResultItem(obj, ContextIdentifier.Save,
                                                                                        rule, result));
                        }
                    }
                }
            }

            foreach (ResultsHighlightController resultsHighlightController in resultsHighlightControllers){
                resultsHighlightController.ClearHighlighting();
                if (validationResults.State == ValidationState.Invalid){
                    resultsHighlightController.HighlightResults(validationResults);
                }
            }

            if (validationResults.State == ValidationState.Invalid){
                e.Handled = true;
            }
        }
Ejemplo n.º 21
0
 private void ValidatePath(WizardCommandButtonClickEventArgs e)
 {
 }